diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..393885da7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# Text Editor TMP Files +*.swp diff --git a/.luacheckrc b/.luacheckrc index 556b2e8f0..9d0b8cb2a 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -40,4 +40,16 @@ read_globals = { "factorial" } }, + ------ + --MODS + ------ + + --GENERAL + "default", + + --ENTITIES + "cmi", + + --HUD + "sfinv", "sfinv_buttons", "unified_inventory", "cmsg", "inventory_plus", } \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 21facbd1b..4c9bf3e38 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,5 +1,5 @@ # Contributing to MineClone 2 -So you want to MineClone 2? +So you want to contribute to MineClone 2? Wow, thank you! :-) But first, some things to note: @@ -46,6 +46,28 @@ Your commit names should be relatively descriptive, e.g. when saying "Fix #issue Contributors will be credited in `CREDITS.md`. +## Code Style + +Each mod must provide `mod.conf`. +Each mod which add API functions should store functions inside a global table named like the mod. +Public functions should not use self references but rather just access the table directly. +Functions should be defined in this way: +```lua +function mcl_xyz.stuff(param) end +``` +Insteed of this way: +```lua +mcl_xyz.stuff = function(param) end +``` +Indentation must be unified, more likely with tabs. + +Time sensitive mods should make a local copy of most used API functions to improve performances. +```lua +local vector = vector +local get_node = minetest.get_node +``` + + ## Features > 1.12 If you want to make a feature that was added in a Minecraft version later than 1.12, you should fork MineClone5 (mineclone5 branch in the repository) and add your changes to this. diff --git a/CREDITS.md b/CREDITS.md index c6ca7d0fb..296e7c23b 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -22,6 +22,7 @@ * Nicu * aligator * Code-Sploit +* NO11 ## Contributors * Laurent Rocher @@ -40,7 +41,6 @@ * Jared Moody * Li0n * Midgard -* NO11 * Saku Laesvuori * Yukitty * ZedekThePD @@ -102,6 +102,7 @@ * leorockway * xMrVizzy * yutyo +* NO11 ## Translations * Wuzzy diff --git a/GROUPS.md b/GROUPS.md index 8c0c3563e..8286b29bc 100644 --- a/GROUPS.md +++ b/GROUPS.md @@ -149,7 +149,7 @@ These groups are used mostly for informational purposes * `trapdoor=2`: Open trapdoor * `glass=1`: Glass (full cubes only) * `rail=1`: Rail -* `music_record`: Music Disc (rating is track ID) +* `music_record`: Item is Music Disc * `tnt=1`: Block is TNT * `boat=1`: Boat * `minecart=1`: Minecart diff --git a/README.md b/README.md index ca4d01959..034d381ab 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ -# (Currently in feature freeze) - # MineClone 2 An unofficial Minecraft-like game for Minetest. Forked from MineClone by davedevils. Developed by many people. Not developed or endorsed by Mojang AB. @@ -77,15 +75,16 @@ To install MineClone 2 (if you haven't already), move this directory into the “games” directory of your Minetest data directory. Consult the help of Minetest to learn more. -## Reporting bugs -Please report all bugs and missing Minecraft features here: +## Useful links +The MineClone2 repository is hosted at Mesehub. To contribute or report issues, head there. - - -## Chating with the community -Join our discord server at: - - +* Mesehub: +* Discord: +* YouTube +* IRC: +* Matrix: +* Reddit: +* Minetest forums: ## Project description The main goal of **MineClone 2** is to be a clone of Minecraft and to be released as free software. diff --git a/menu/Header.blend b/menu/Header.blend new file mode 100644 index 000000000..78a9f6158 Binary files /dev/null and b/menu/Header.blend differ diff --git a/mods/CORE/_mcl_autogroup/init.lua b/mods/CORE/_mcl_autogroup/init.lua index c8475d0bd..e04fb2eac 100644 --- a/mods/CORE/_mcl_autogroup/init.lua +++ b/mods/CORE/_mcl_autogroup/init.lua @@ -83,7 +83,7 @@ local function get_hardness_values_for_groups() for _, ndef in pairs(minetest.registered_nodes) do for g, _ in pairs(mcl_autogroup.registered_diggroups) do - if ndef.groups[g] ~= nil then + if ndef.groups[g] then maps[g][ndef._mcl_hardness or 0] = true end end @@ -121,7 +121,7 @@ local hardness_values = get_hardness_values_for_groups() -- hardness_value. Used for quick lookup. local hardness_lookup = get_hardness_lookup_for_groups(hardness_values) -local function compute_creativetimes(group) +--[[local function compute_creativetimes(group) local creativetimes = {} for index, hardness in pairs(hardness_values[group]) do @@ -129,7 +129,7 @@ local function compute_creativetimes(group) end return creativetimes -end +end]] -- Get the list of digging times for using a specific tool on a specific -- diggroup. @@ -207,6 +207,10 @@ end function mcl_autogroup.can_harvest(nodename, toolname) local ndef = minetest.registered_nodes[nodename] + if not ndef then + return false + end + if minetest.get_item_group(nodename, "dig_immediate") >= 2 then return true end @@ -239,13 +243,13 @@ function mcl_autogroup.can_harvest(nodename, toolname) end -- Get one groupcap field for using a specific tool on a specific group. -local function get_groupcap(group, can_harvest, multiplier, efficiency, uses) +--[[local function get_groupcap(group, can_harvest, multiplier, efficiency, uses) return { times = get_digtimes(group, can_harvest, multiplier, efficiency), uses = uses, maxlevel = 0, } -end +end]] -- Returns the tool_capabilities from a tool definition or a default set of -- tool_capabilities @@ -271,7 +275,7 @@ end -- toolname - Name of the tool being enchanted (like "mcl_tools:diamond_pickaxe") -- efficiency - The efficiency level the tool is enchanted with (default 0) -- --- NOTE: +-- NOTE: -- This function can only be called after mod initialization. Otherwise a mod -- would have to add _mcl_autogroup as a dependency which would break the mod -- loading order. @@ -288,7 +292,7 @@ end -- toolname - Name of the tool used -- diggroup - The name of the diggroup the tool is used on -- --- NOTE: +-- NOTE: -- This function can only be called after mod initialization. Otherwise a mod -- would have to add _mcl_autogroup as a dependency which would break the mod -- loading order. @@ -298,7 +302,7 @@ function mcl_autogroup.get_wear(toolname, diggroup) return math.ceil(65535 / uses) end -local overwrite = function() +local function overwrite() for nname, ndef in pairs(minetest.registered_nodes) do local newgroups = table.copy(ndef.groups) if (nname ~= "ignore" and ndef.diggable) then @@ -315,12 +319,12 @@ local overwrite = function() newgroups.opaque = 1 end - local creative_breakable = false + --local creative_breakable = false -- Assign groups used for digging this node depending on -- the registered digging groups for g, gdef in pairs(mcl_autogroup.registered_diggroups) do - creative_breakable = true + --creative_breakable = true local index = hardness_lookup[g][ndef._mcl_hardness or 0] if ndef.groups[g] then if gdef.levels then diff --git a/mods/CORE/biomeinfo/init.lua b/mods/CORE/biomeinfo/init.lua index 5013647ed..950925f9d 100644 --- a/mods/CORE/biomeinfo/init.lua +++ b/mods/CORE/biomeinfo/init.lua @@ -81,11 +81,11 @@ if v6_use_snow_biomes then end local v6_freq_desert = tonumber(minetest.get_mapgen_setting("mgv6_freq_desert") or 0.45) -local NOISE_MAGIC_X = 1619 -local NOISE_MAGIC_Y = 31337 -local NOISE_MAGIC_Z = 52591 -local NOISE_MAGIC_SEED = 1013 -local noise2d = function(x, y, seed) +--local NOISE_MAGIC_X = 1619 +--local NOISE_MAGIC_Y = 31337 +--local NOISE_MAGIC_Z = 52591 +--local NOISE_MAGIC_SEED = 1013 +local function noise2d(x, y, seed) -- TODO: implement noise2d function for biome blend return 0 --[[ diff --git a/mods/CORE/controls/init.lua b/mods/CORE/controls/init.lua index 2ceb7e902..ef57281a4 100644 --- a/mods/CORE/controls/init.lua +++ b/mods/CORE/controls/init.lua @@ -1,6 +1,8 @@ local get_connected_players = minetest.get_connected_players local clock = os.clock +local pairs = pairs + controls = {} controls.players = {} @@ -20,15 +22,15 @@ function controls.register_on_hold(func) end local known_controls = { - jump=true, - right=true, - left=true, - LMB=true, - RMB=true, - sneak=true, - aux1=true, - down=true, - up=true, + jump = true, + right = true, + left = true, + LMB = true, + RMB = true, + sneak = true, + aux1 = true, + down = true, + up = true, } minetest.register_on_joinplayer(function(player) @@ -49,27 +51,27 @@ minetest.register_globalstep(function(dtime) local player_name = player:get_player_name() local player_controls = player:get_player_control() if controls.players[player_name] then - for cname, cbool in pairs(player_controls) do - if known_controls[cname] == true then - --Press a key - if cbool==true and controls.players[player_name][cname][1]==false then - for _, func in pairs(controls.registered_on_press) do - func(player, cname) + for cname, cbool in pairs(player_controls) do + if known_controls[cname] == true then + --Press a key + if cbool == true and controls.players[player_name][cname][1] == false then + for _, func in pairs(controls.registered_on_press) do + func(player, cname) + end + controls.players[player_name][cname] = {true, clock()} + elseif cbool == true and controls.players[player_name][cname][1] == true then + for _, func in pairs(controls.registered_on_hold) do + func(player, cname, clock()-controls.players[player_name][cname][2]) + end + --Release a key + elseif cbool == false and controls.players[player_name][cname][1] == true then + for _, func in pairs(controls.registered_on_release) do + func(player, cname, clock()-controls.players[player_name][cname][2]) + end + controls.players[player_name][cname] = {false} + end end - controls.players[player_name][cname] = {true, clock()} - elseif cbool==true and controls.players[player_name][cname][1]==true then - for _, func in pairs(controls.registered_on_hold) do - func(player, cname, clock()-controls.players[player_name][cname][2]) - end - --Release a key - elseif cbool==false and controls.players[player_name][cname][1]==true then - for _, func in pairs(controls.registered_on_release) do - func(player, cname, clock()-controls.players[player_name][cname][2]) - end - controls.players[player_name][cname] = {false} end end - end - end end end) diff --git a/mods/CORE/flowlib/init.lua b/mods/CORE/flowlib/init.lua index e4e22a20e..ab710e476 100644 --- a/mods/CORE/flowlib/init.lua +++ b/mods/CORE/flowlib/init.lua @@ -1,95 +1,100 @@ +local math = math + +local get_node = minetest.get_node +local get_item_group = minetest.get_item_group + +local registered_nodes = minetest.registered_nodes + flowlib = {} --sum of direction vectors must match an array index + +--(sum,root) +--(0,1), (1,1+0=1), (2,1+1=2), (3,1+2^2=5), (4,2^2+2^2=8) + +local inv_roots = { + [0] = 1, + [1] = 1, + [2] = 0.70710678118655, + [4] = 0.5, + [5] = 0.44721359549996, + [8] = 0.35355339059327, +} + local function to_unit_vector(dir_vector) - --(sum,root) - -- (0,1), (1,1+0=1), (2,1+1=2), (3,1+2^2=5), (4,2^2+2^2=8) - local inv_roots = {[0] = 1, [1] = 1, [2] = 0.70710678118655, [4] = 0.5 - , [5] = 0.44721359549996, [8] = 0.35355339059327} - local sum = dir_vector.x*dir_vector.x + dir_vector.z*dir_vector.z - return {x=dir_vector.x*inv_roots[sum],y=dir_vector.y - ,z=dir_vector.z*inv_roots[sum]} + local sum = dir_vector.x * dir_vector.x + dir_vector.z * dir_vector.z + return {x = dir_vector.x * inv_roots[sum], y = dir_vector.y, z = dir_vector.z * inv_roots[sum]} end -local is_touching = function(realpos,nodepos,radius) +local function is_touching(realpos,nodepos,radius) local boarder = 0.5 - radius - return (math.abs(realpos - nodepos) > (boarder)) + return math.abs(realpos - nodepos) > (boarder) end flowlib.is_touching = is_touching -local is_water = function(pos) - return (minetest.get_item_group(minetest.get_node( - {x=pos.x,y=pos.y,z=pos.z}).name - , "water") ~= 0) +local function is_water(pos) + return get_item_group(get_node(pos).name, "water") ~= 0 end flowlib.is_water = is_water -local node_is_water = function(node) - return (minetest.get_item_group(node.name, "water") ~= 0) +local function node_is_water(node) + return get_item_group(node.name, "water") ~= 0 end flowlib.node_is_water = node_is_water -local is_lava = function(pos) - return (minetest.get_item_group(minetest.get_node( - {x=pos.x,y=pos.y,z=pos.z}).name - , "lava") ~= 0) +local function is_lava(pos) + return get_item_group(get_node(pos).name, "lava") ~= 0 end flowlib.is_lava = is_lava -local node_is_lava = function(node) - return (minetest.get_item_group(node.name, "lava") ~= 0) +local function node_is_lava(node) + return get_item_group(node.name, "lava") ~= 0 end flowlib.node_is_lava = node_is_lava -local is_liquid = function(pos) - return (minetest.get_item_group(minetest.get_node( - {x=pos.x,y=pos.y,z=pos.z}).name - , "liquid") ~= 0) +local function is_liquid(pos) + return get_item_group(get_node(pos).name, "liquid") ~= 0 end flowlib.is_liquid = is_liquid -local node_is_liquid = function(node) - return (minetest.get_item_group(node.name, "liquid") ~= 0) +local function node_is_liquid(node) + return minetest.get_item_group(node.name, "liquid") ~= 0 end flowlib.node_is_liquid = node_is_liquid --This code is more efficient -local function quick_flow_logic(node,pos_testing,direction) +local function quick_flow_logic(node, pos_testing, direction) local name = node.name - if not minetest.registered_nodes[name] then + if not registered_nodes[name] then return 0 end - if minetest.registered_nodes[name].liquidtype == "source" then - local node_testing = minetest.get_node(pos_testing) - local param2_testing = node_testing.param2 - if not minetest.registered_nodes[node_testing.name] then + if registered_nodes[name].liquidtype == "source" then + local node_testing = get_node(pos_testing) + if not registered_nodes[node_testing.name] then return 0 end - if minetest.registered_nodes[node_testing.name].liquidtype - ~= "flowing" then + if registered_nodes[node_testing.name].liquidtype ~= "flowing" then return 0 else return direction end - elseif minetest.registered_nodes[name].liquidtype == "flowing" then - local node_testing = minetest.get_node(pos_testing) + elseif registered_nodes[name].liquidtype == "flowing" then + local node_testing = get_node(pos_testing) local param2_testing = node_testing.param2 - if not minetest.registered_nodes[node_testing.name] then + if not registered_nodes[node_testing.name] then return 0 end - if minetest.registered_nodes[node_testing.name].liquidtype - == "source" then + if registered_nodes[node_testing.name].liquidtype == "source" then return -direction - elseif minetest.registered_nodes[node_testing.name].liquidtype - == "flowing" then + elseif registered_nodes[node_testing.name].liquidtype == "flowing" then if param2_testing < node.param2 then if (node.param2 - param2_testing) > 6 then return -direction @@ -108,48 +113,41 @@ local function quick_flow_logic(node,pos_testing,direction) return 0 end -local quick_flow = function(pos,node) - local x = 0 - local z = 0 - +local function quick_flow(pos, node) if not node_is_liquid(node) then - return {x=0,y=0,z=0} + return {x = 0, y = 0, z = 0} end - - x = x + quick_flow_logic(node,{x=pos.x-1,y=pos.y,z=pos.z},-1) - x = x + quick_flow_logic(node,{x=pos.x+1,y=pos.y,z=pos.z}, 1) - z = z + quick_flow_logic(node,{x=pos.x,y=pos.y,z=pos.z-1},-1) - z = z + quick_flow_logic(node,{x=pos.x,y=pos.y,z=pos.z+1}, 1) - - return to_unit_vector({x=x,y=0,z=z}) + local x = quick_flow_logic(node,{x = pos.x-1, y = pos.y, z = pos.z},-1) + quick_flow_logic(node,{x = pos.x+1, y = pos.y, z = pos.z}, 1) + local z = quick_flow_logic(node,{x = pos.x, y = pos.y, z = pos.z-1},-1) + quick_flow_logic(node,{x = pos.x, y = pos.y, z = pos.z+1}, 1) + return to_unit_vector({x = x, y = 0, z = z}) end flowlib.quick_flow = quick_flow +--if not in water but touching, move centre to touching block +--x has higher precedence than z +--if pos changes with x, it affects z - --if not in water but touching, move centre to touching block - --x has higher precedence than z - --if pos changes with x, it affects z -local move_centre = function(pos,realpos,node,radius) - if is_touching(realpos.x,pos.x,radius) then - if is_liquid({x=pos.x-1,y=pos.y,z=pos.z}) then - node = minetest.get_node({x=pos.x-1,y=pos.y,z=pos.z}) - pos = {x=pos.x-1,y=pos.y,z=pos.z} - elseif is_liquid({x=pos.x+1,y=pos.y,z=pos.z}) then - node = minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z}) - pos = {x=pos.x+1,y=pos.y,z=pos.z} +local function move_centre(pos, realpos, node, radius) + if is_touching(realpos.x, pos.x, radius) then + if is_liquid({x = pos.x-1, y = pos.y, z = pos.z}) then + node = get_node({x=pos.x-1, y = pos.y, z = pos.z}) + pos = {x = pos.x-1, y = pos.y, z = pos.z} + elseif is_liquid({x = pos.x+1, y = pos.y, z = pos.z}) then + node = get_node({x = pos.x+1, y = pos.y, z = pos.z}) + pos = {x = pos.x+1, y = pos.y, z = pos.z} end end - if is_touching(realpos.z,pos.z,radius) then - if is_liquid({x=pos.x,y=pos.y,z=pos.z-1}) then - node = minetest.get_node({x=pos.x,y=pos.y,z=pos.z-1}) - pos = {x=pos.x,y=pos.y,z=pos.z-1} - elseif is_liquid({x=pos.x,y=pos.y,z=pos.z+1}) then - node = minetest.get_node({x=pos.x,y=pos.y,z=pos.z+1}) - pos = {x=pos.x,y=pos.y,z=pos.z+1} + if is_touching(realpos.z, pos.z, radius) then + if is_liquid({x = pos.x, y = pos.y, z = pos.z - 1}) then + node = get_node({x = pos.x, y = pos.y, z = pos.z - 1}) + pos = {x = pos.x, y = pos.y, z = pos.z - 1} + elseif is_liquid({x = pos.x, y = pos.y, z = pos.z + 1}) then + node = get_node({x = pos.x, y = pos.y, z = pos.z + 1}) + pos = {x = pos.x, y = pos.y, z = pos.z + 1} end end - return pos,node + return pos, node end flowlib.move_centre = move_centre diff --git a/mods/CORE/mcl_attached/init.lua b/mods/CORE/mcl_attached/init.lua index 146cb2251..4f538e104 100644 --- a/mods/CORE/mcl_attached/init.lua +++ b/mods/CORE/mcl_attached/init.lua @@ -1,17 +1,21 @@ +local vector = vector + +local facedir_to_dir = minetest.facedir_to_dir +local get_item_group = minetest.get_item_group +local remove_node = minetest.remove_node +local get_node = minetest.get_node + local original_function = minetest.check_single_for_falling -minetest.check_single_for_falling = function(pos) +function minetest.check_single_for_falling(pos) local ret_o = original_function(pos) - local ret = false local node = minetest.get_node(pos) - if minetest.get_item_group(node.name, "attached_node_facedir") ~= 0 then - local dir = minetest.facedir_to_dir(node.param2) + if get_item_group(node.name, "attached_node_facedir") ~= 0 then + local dir = facedir_to_dir(node.param2) if dir then - local cpos = vector.add(pos, dir) - local cnode = minetest.get_node(cpos) - if minetest.get_item_group(cnode.name, "solid") == 0 then - minetest.remove_node(pos) + if get_item_group(get_node(vector.add(pos, dir)).name, "solid") == 0 then + remove_node(pos) local drops = minetest.get_node_drops(node.name, "") for dr=1, #drops do minetest.add_item(pos, drops[dr]) @@ -20,7 +24,6 @@ minetest.check_single_for_falling = function(pos) end end end - return ret_o or ret end diff --git a/mods/CORE/mcl_explosions/init.lua b/mods/CORE/mcl_explosions/init.lua index e59e3ea12..0132d1669 100644 --- a/mods/CORE/mcl_explosions/init.lua +++ b/mods/CORE/mcl_explosions/init.lua @@ -12,10 +12,12 @@ under the LGPLv2.1 license. mcl_explosions = {} -local mod_fire = minetest.get_modpath("mcl_fire") ~= nil -local CONTENT_FIRE = minetest.get_content_id("mcl_fire:fire") +local mod_fire = minetest.get_modpath("mcl_fire") +--local CONTENT_FIRE = minetest.get_content_id("mcl_fire:fire") -local S = minetest.get_translator("mcl_explosions") +local math = math +local vector = vector +local table = table local hash_node_position = minetest.hash_node_position local get_objects_inside_radius = minetest.get_objects_inside_radius @@ -26,6 +28,7 @@ local get_voxel_manip = minetest.get_voxel_manip local bulk_set_node = minetest.bulk_set_node local check_for_falling = minetest.check_for_falling local add_item = minetest.add_item +local pos_to_string = minetest.pos_to_string -- Saved sphere explosion shapes for various radiuses local sphere_shapes = {} @@ -66,46 +69,44 @@ local function compute_sphere_rays(radius) local rays = {} local sphere = {} - for i=1, 2 do + local function add_ray(pos) + sphere[hash_node_position(pos)] = pos + end + + for y = -radius, radius do + for z = -radius, radius do + for x = -radius, 0 do + local d = x * x + y * y + z * z + if d <= radius * radius then + add_ray(vector.new(x, y, z)) + add_ray(vector.new(-x, y, z)) + break + end + end + end + end + + for x = -radius, radius do + for z = -radius, radius do + for y = -radius, 0 do + local d = x * x + y * y + z * z + if d <= radius * radius then + add_ray(vector.new(x, y, z)) + add_ray(vector.new(x, -y, z)) + break + end + end + end + end + + for x = -radius, radius do for y = -radius, radius do - for z = -radius, radius do - for x = -radius, 0, 1 do - local d = x * x + y * y + z * z - if d <= radius * radius then - local pos = { x = x, y = y, z = z } - sphere[hash_node_position(pos)] = pos - break - end - end - end - end - end - - for i=1,2 do - for x = -radius, radius do - for z = -radius, radius do - for y = -radius, 0, 1 do - local d = x * x + y * y + z * z - if d <= radius * radius then - local pos = { x = x, y = y, z = z } - sphere[hash_node_position(pos)] = pos - break - end - end - end - end - end - - for i=1,2 do - for x = -radius, radius do - for y = -radius, radius do - for z = -radius, 0, 1 do - local d = x * x + y * y + z * z - if d <= radius * radius then - local pos = { x = x, y = y, z = z } - sphere[hash_node_position(pos)] = pos - break - end + for z = -radius, 0 do + local d = x * x + y * y + z * z + if d <= radius * radius then + add_ray(vector.new(x, y, z)) + add_ray(vector.new(x, y, -z)) + break end end end @@ -176,14 +177,11 @@ local function trace_explode(pos, strength, raydirs, radius, info, direct, sourc local ystride = (emax.x - emin_x + 1) local zstride = ystride * (emax.y - emin_y + 1) - local pos_x = pos.x - local pos_y = pos.y - local pos_z = pos.z - local area = VoxelArea:new { + --[[local area = VoxelArea:new { MinEdge = emin, MaxEdge = emax - } + }]] local data = vm:get_data() local destroy = {} @@ -247,7 +245,7 @@ local function trace_explode(pos, strength, raydirs, radius, info, direct, sourc local ent = obj:get_luaentity() -- Ignore items to lower lag - if (obj:is_player() or (ent and ent.name ~= '__builtin.item')) and obj:get_hp() > 0 then + if (obj:is_player() or (ent and ent.name ~= "__builtin.item")) and obj:get_hp() > 0 then local opos = obj:get_pos() local collisionbox = nil @@ -260,12 +258,12 @@ local function trace_explode(pos, strength, raydirs, radius, info, direct, sourc if collisionbox then -- Create rays from random points in the collision box - local x1 = collisionbox[1] * 2 - local y1 = collisionbox[2] * 2 - local z1 = collisionbox[3] * 2 - local x2 = collisionbox[4] * 2 - local y2 = collisionbox[5] * 2 - local z2 = collisionbox[6] * 2 + local x1 = collisionbox[1] + local y1 = collisionbox[2] + local z1 = collisionbox[3] + local x2 = collisionbox[4] + local y2 = collisionbox[5] + local z2 = collisionbox[6] local x_len = math.abs(x2 - x1) local y_len = math.abs(y2 - y1) local z_len = math.abs(z2 - z1) @@ -363,9 +361,9 @@ local function trace_explode(pos, strength, raydirs, radius, info, direct, sourc local on_blast = node_on_blast[data[idx]] local remove = true - if do_drop or on_blast ~= nil then + if do_drop or on_blast then local npos = get_position_from_hash(hash) - if on_blast ~= nil then + if on_blast then on_blast(npos, 1.0, do_drop) remove = false else @@ -407,8 +405,7 @@ local function trace_explode(pos, strength, raydirs, radius, info, direct, sourc end -- Log explosion - minetest.log('action', 'Explosion at ' .. minetest.pos_to_string(pos) .. - ' with strength ' .. strength .. ' and radius ' .. radius) + minetest.log("action", "Explosion at "..pos_to_string(pos).." with strength "..strength.." and radius "..radius) end -- Create an explosion with strength at pos. diff --git a/mods/CORE/mcl_explosions/locale/mcl_explosions.de.tr b/mods/CORE/mcl_explosions/locale/mcl_explosions.de.tr deleted file mode 100644 index 4abbc64bf..000000000 --- a/mods/CORE/mcl_explosions/locale/mcl_explosions.de.tr +++ /dev/null @@ -1,2 +0,0 @@ -# textdomain:mcl_explosions -@1 was caught in an explosion.=@1 wurde Opfer einer Explosion. diff --git a/mods/CORE/mcl_explosions/locale/mcl_explosions.fr.tr b/mods/CORE/mcl_explosions/locale/mcl_explosions.fr.tr deleted file mode 100644 index cb9a0f38e..000000000 --- a/mods/CORE/mcl_explosions/locale/mcl_explosions.fr.tr +++ /dev/null @@ -1,2 +0,0 @@ -# textdomain:mcl_explosions -@1 was caught in an explosion.=@1 a été pris dans une explosion. \ No newline at end of file diff --git a/mods/CORE/mcl_explosions/locale/mcl_explosions.pl.tr b/mods/CORE/mcl_explosions/locale/mcl_explosions.pl.tr new file mode 100644 index 000000000..f7811d733 --- /dev/null +++ b/mods/CORE/mcl_explosions/locale/mcl_explosions.pl.tr @@ -0,0 +1,2 @@ +# textdomain:mcl_explosions +@1 was caught in an explosion.=@1 została wysadzona. diff --git a/mods/CORE/mcl_explosions/locale/mcl_explosions.ru.tr b/mods/CORE/mcl_explosions/locale/mcl_explosions.ru.tr deleted file mode 100644 index 2c885845f..000000000 --- a/mods/CORE/mcl_explosions/locale/mcl_explosions.ru.tr +++ /dev/null @@ -1,2 +0,0 @@ -# textdomain:mcl_explosions -@1 was caught in an explosion.=@1 не удалось пережить взрыва. diff --git a/mods/CORE/mcl_explosions/locale/template.txt b/mods/CORE/mcl_explosions/locale/template.txt deleted file mode 100644 index 6a9348ddf..000000000 --- a/mods/CORE/mcl_explosions/locale/template.txt +++ /dev/null @@ -1,2 +0,0 @@ -# textdomain:mcl_explosions -@1 was caught in an explosion.= diff --git a/mods/CORE/mcl_init/init.lua b/mods/CORE/mcl_init/init.lua index 066e555df..fec9c7ba9 100644 --- a/mods/CORE/mcl_init/init.lua +++ b/mods/CORE/mcl_init/init.lua @@ -32,9 +32,9 @@ local singlenode = mg_name == "singlenode" -- Calculate mapgen_edge_min/mapgen_edge_max mcl_vars.chunksize = math.max(1, tonumber(minetest.get_mapgen_setting("chunksize")) or 5) -mcl_vars.MAP_BLOCKSIZE = math.max(1, core.MAP_BLOCKSIZE or 16) +mcl_vars.MAP_BLOCKSIZE = math.max(1, minetest.MAP_BLOCKSIZE or 16) mcl_vars.mapgen_limit = math.max(1, tonumber(minetest.get_mapgen_setting("mapgen_limit")) or 31000) -mcl_vars.MAX_MAP_GENERATION_LIMIT = math.max(1, core.MAX_MAP_GENERATION_LIMIT or 31000) +mcl_vars.MAX_MAP_GENERATION_LIMIT = math.max(1, minetest.MAX_MAP_GENERATION_LIMIT or 31000) local central_chunk_offset = -math.floor(mcl_vars.chunksize / 2) mcl_vars.central_chunk_offset_in_nodes = central_chunk_offset * mcl_vars.MAP_BLOCKSIZE mcl_vars.chunk_size_in_nodes = mcl_vars.chunksize * mcl_vars.MAP_BLOCKSIZE diff --git a/mods/CORE/mcl_loot/init.lua b/mods/CORE/mcl_loot/init.lua index 6db743740..1b2c50807 100644 --- a/mods/CORE/mcl_loot/init.lua +++ b/mods/CORE/mcl_loot/init.lua @@ -40,10 +40,9 @@ function mcl_loot.get_loot(loot_definitions, pr) total_weight = total_weight + (loot_definitions.items[i].weight or 1) end - local stacks_min = loot_definitions.stacks_min - local stacks_max = loot_definitions.stacks_max - if not stacks_min then stacks_min = 1 end - if not stacks_max then stacks_max = 1 end + --local stacks_min = loot_definitions.stacks_min or 1 + --local stacks_max = loot_definitions.stacks_max or 1 + local stacks = pr:next(loot_definitions.stacks_min, loot_definitions.stacks_max) for s=1, stacks do local r = pr:next(1, total_weight) diff --git a/mods/CORE/mcl_particles/init.lua b/mods/CORE/mcl_particles/init.lua index 457f1a661..4b096ac65 100644 --- a/mods/CORE/mcl_particles/init.lua +++ b/mods/CORE/mcl_particles/init.lua @@ -1,3 +1,12 @@ +local vector = vector +local table = table + +local hash_node_position = minetest.hash_node_position +local add_particlespawner = minetest.add_particlespawner +local delete_particlespawner = minetest.delete_particlespawner + +local ipairs = ipairs + mcl_particles = {} -- Table of particlespawner IDs on a per-node hash basis @@ -32,11 +41,11 @@ function mcl_particles.add_node_particlespawner(pos, particlespawner_definition, if allowed_level == 0 or levels[level] > allowed_level then return end - local poshash = minetest.hash_node_position(pos) + local poshash = hash_node_position(pos) if not poshash then return end - local id = minetest.add_particlespawner(particlespawner_definition) + local id = add_particlespawner(particlespawner_definition) if id == -1 then return end @@ -47,6 +56,8 @@ function mcl_particles.add_node_particlespawner(pos, particlespawner_definition, return id end +local add_node_particlespawner = mcl_particles.add_node_particlespawner + -- Deletes all particlespawners that are assigned to a node position. -- If no particlespawners exist for this position, nothing happens. -- pos: Node positon. MUST use integer values! @@ -55,11 +66,11 @@ function mcl_particles.delete_node_particlespawners(pos) if allowed_level == 0 then return false end - local poshash = minetest.hash_node_position(pos) + local poshash = hash_node_position(pos) local ids = particle_nodes[poshash] if ids then for i=1, #ids do - minetest.delete_particlespawner(ids[i]) + delete_particlespawner(ids[i]) end particle_nodes[poshash] = nil return true diff --git a/mods/CORE/mcl_particles/textures/mcl_particles_bonemeal.png b/mods/CORE/mcl_particles/textures/mcl_particles_bonemeal.png new file mode 100644 index 000000000..684df9865 Binary files /dev/null and b/mods/CORE/mcl_particles/textures/mcl_particles_bonemeal.png differ diff --git a/mods/CORE/mcl_util/init.lua b/mods/CORE/mcl_util/init.lua index dbaaf067a..26b202b8e 100644 --- a/mods/CORE/mcl_util/init.lua +++ b/mods/CORE/mcl_util/init.lua @@ -150,7 +150,7 @@ function mcl_util.get_eligible_transfer_item_slot(src_inventory, src_list, dst_i end -- Returns true if itemstack is a shulker box -local is_not_shulker_box = function(itemstack) +local function is_not_shulker_box(itemstack) local g = minetest.get_item_group(itemstack:get_name(), "shulker_box") return g == 0 or g == nil end @@ -212,7 +212,7 @@ function mcl_util.move_item_container(source_pos, destination_pos, source_list, end -- Normalize double container by forcing to always use the left segment first - local normalize_double_container = function(pos, node, ctype) + local function normalize_double_container(pos, node, ctype) if ctype == 6 then pos = mcl_util.get_double_container_neighbor_pos(pos, node.param2, "right") if not pos then @@ -456,14 +456,7 @@ function mcl_util.calculate_durability(itemstack) end end end - if not uses then - local toolcaps = itemstack:get_tool_capabilities() - local groupcaps = toolcaps.groupcaps - for _, v in pairs(groupcaps) do - uses = v.uses - break - end - end + uses = uses or (next(itemstack:get_tool_capabilities().groupcaps) or {}).uses end return uses or 0 @@ -535,3 +528,12 @@ function mcl_util.get_object_name(object) return luaentity.nametag and luaentity.nametag ~= "" and luaentity.nametag or luaentity.description or luaentity.name end end + +function mcl_util.replace_mob(obj, mob) + local rot = obj:get_yaw() + local pos = obj:get_pos() + obj:remove() + obj = minetest.add_entity(pos, mob) + obj:set_yaw(rot) + return obj +end diff --git a/mods/CORE/mcl_worlds/API.md b/mods/CORE/mcl_worlds/API.md index a5509431c..dd96b01b5 100644 --- a/mods/CORE/mcl_worlds/API.md +++ b/mods/CORE/mcl_worlds/API.md @@ -61,20 +61,21 @@ In mc, you cant use clock in the nether and the end. * pos: position -## mcl_worlds.register_on_dimension_change(function(player, dimension)) +## mcl_worlds.register_on_dimension_change(function(player, dimension, last_dimension)) Register a callback function func(player, dimension). It will be called whenever a player changes between dimensions. The void counts as dimension. -* player: player, the player who changed the dimension -* dimension: position, The new dimension of the player ("overworld", "nether", "end", "void"). +* player: player, the player who changed of dimension +* dimension: string, The new dimension of the player ("overworld", "nether", "end", "void"). +* last_dimension: string, The dimension where the player was ("overworld", "nether", "end", "void"). ## mcl_worlds.registered_on_dimension_change Table containing all function registered with mcl_worlds.register_on_dimension_change() ## mcl_worlds.dimension_change(player, dimension) -Notify this mod of a dimmension change of to +Notify this mod of a dimension change of to * player: player, player who changed the dimension * dimension: string, new dimension ("overworld", "nether", "end", "void") \ No newline at end of file diff --git a/mods/CORE/mcl_worlds/init.lua b/mods/CORE/mcl_worlds/init.lua index 6cdeaab7e..203f69401 100644 --- a/mods/CORE/mcl_worlds/init.lua +++ b/mods/CORE/mcl_worlds/init.lua @@ -1,5 +1,7 @@ mcl_worlds = {} +local get_connected_players = minetest.get_connected_players + -- For a given position, returns a 2-tuple: -- 1st return value: true if pos is in void -- 2nd return value: true if it is in the deadly part of the void @@ -33,60 +35,64 @@ end -- If the Y coordinate is not located in any dimension, it will return: -- nil, "void" function mcl_worlds.y_to_layer(y) - if y >= mcl_vars.mg_overworld_min then - return y - mcl_vars.mg_overworld_min, "overworld" - elseif y >= mcl_vars.mg_nether_min and y <= mcl_vars.mg_nether_max+128 then - return y - mcl_vars.mg_nether_min, "nether" - elseif y >= mcl_vars.mg_end_min and y <= mcl_vars.mg_end_max then - return y - mcl_vars.mg_end_min, "end" - else - return nil, "void" - end + if y >= mcl_vars.mg_overworld_min then + return y - mcl_vars.mg_overworld_min, "overworld" + elseif y >= mcl_vars.mg_nether_min and y <= mcl_vars.mg_nether_max+128 then + return y - mcl_vars.mg_nether_min, "nether" + elseif y >= mcl_vars.mg_end_min and y <= mcl_vars.mg_end_max then + return y - mcl_vars.mg_end_min, "end" + else + return nil, "void" + end end +local y_to_layer = mcl_worlds.y_to_layer + -- Takes a pos and returns the dimension it belongs to (same as above) function mcl_worlds.pos_to_dimension(pos) - local _, dim = mcl_worlds.y_to_layer(pos.y) + local _, dim = y_to_layer(pos.y) return dim end +local pos_to_dimension = mcl_worlds.pos_to_dimension + -- Takes a Minecraft layer and a “dimension” name -- and returns the corresponding Y coordinate for -- MineClone 2. -- mc_dimension is one of "overworld", "nether", "end" (default: "overworld"). function mcl_worlds.layer_to_y(layer, mc_dimension) - if mc_dimension == "overworld" or mc_dimension == nil then - return layer + mcl_vars.mg_overworld_min - elseif mc_dimension == "nether" then - return layer + mcl_vars.mg_nether_min - elseif mc_dimension == "end" then - return layer + mcl_vars.mg_end_min - end + if mc_dimension == "overworld" or mc_dimension == nil then + return layer + mcl_vars.mg_overworld_min + elseif mc_dimension == "nether" then + return layer + mcl_vars.mg_nether_min + elseif mc_dimension == "end" then + return layer + mcl_vars.mg_end_min + end end -- Takes a position and returns true if this position can have weather function mcl_worlds.has_weather(pos) - -- Weather in the Overworld and the high part of the void below - return pos.y <= mcl_vars.mg_overworld_max and pos.y >= mcl_vars.mg_overworld_min - 64 + -- Weather in the Overworld and the high part of the void below + return pos.y <= mcl_vars.mg_overworld_max and pos.y >= mcl_vars.mg_overworld_min - 64 end -- Takes a position and returns true if this position can have Nether dust function mcl_worlds.has_dust(pos) - -- Weather in the Overworld and the high part of the void below - return pos.y <= mcl_vars.mg_nether_max + 138 and pos.y >= mcl_vars.mg_nether_min - 10 + -- Weather in the Overworld and the high part of the void below + return pos.y <= mcl_vars.mg_nether_max + 138 and pos.y >= mcl_vars.mg_nether_min - 10 end -- Takes a position (pos) and returns true if compasses are working here function mcl_worlds.compass_works(pos) - -- It doesn't work in Nether and the End, but it works in the Overworld and in the high part of the void below - local _, dim = mcl_worlds.y_to_layer(pos.y) - if dim == "nether" or dim == "end" then - return false - elseif dim == "void" then - return pos.y <= mcl_vars.mg_overworld_max and pos.y >= mcl_vars.mg_overworld_min - 64 - else - return true - end + -- It doesn't work in Nether and the End, but it works in the Overworld and in the high part of the void below + local _, dim = mcl_worlds.y_to_layer(pos.y) + if dim == "nether" or dim == "end" then + return false + elseif dim == "void" then + return pos.y <= mcl_vars.mg_overworld_max and pos.y >= mcl_vars.mg_overworld_min - 64 + else + return true + end end -- Takes a position (pos) and returns true if clocks are working here @@ -112,12 +118,15 @@ local last_dimension = {} -- * player: Player who changed the dimension -- * dimension: New dimension ("overworld", "nether", "end", "void") function mcl_worlds.dimension_change(player, dimension) + local playername = player:get_player_name() for i=1, #mcl_worlds.registered_on_dimension_change do - mcl_worlds.registered_on_dimension_change[i](player, dimension) - last_dimension[player:get_player_name()] = dimension + mcl_worlds.registered_on_dimension_change[i](player, dimension, last_dimension[playername]) end + last_dimension[playername] = dimension end +local dimension_change = mcl_worlds.dimension_change + ----------------------- INTERNAL STUFF ---------------------- -- Update the dimension callbacks every DIM_UPDATE seconds @@ -125,19 +134,19 @@ local DIM_UPDATE = 1 local dimtimer = 0 minetest.register_on_joinplayer(function(player) - last_dimension[player:get_player_name()] = mcl_worlds.pos_to_dimension(player:get_pos()) + last_dimension[player:get_player_name()] = pos_to_dimension(player:get_pos()) end) minetest.register_globalstep(function(dtime) -- regular updates based on iterval dimtimer = dimtimer + dtime; if dimtimer >= DIM_UPDATE then - local players = minetest.get_connected_players() - for p=1, #players do - local dim = mcl_worlds.pos_to_dimension(players[p]:get_pos()) + local players = get_connected_players() + for p = 1, #players do + local dim = pos_to_dimension(players[p]:get_pos()) local name = players[p]:get_player_name() if dim ~= last_dimension[name] then - mcl_worlds.dimension_change(players[p], dim) + dimension_change(players[p], dim) end end dimtimer = 0 diff --git a/mods/CORE/walkover/init.lua b/mods/CORE/walkover/init.lua index 220157c8b..4d712c308 100644 --- a/mods/CORE/walkover/init.lua +++ b/mods/CORE/walkover/init.lua @@ -4,6 +4,7 @@ local get_connected_players = minetest.get_connected_players local get_node = minetest.get_node local vector_add = vector.add local ceil = math.ceil +local pairs = pairs walkover = {} walkover.registered_globals = {} @@ -31,24 +32,21 @@ minetest.register_globalstep(function(dtime) timer = timer + dtime; if timer >= 0.3 then for _,player in pairs(get_connected_players()) do - local pp = player:get_pos() - pp.y = ceil(pp.y) - local loc = vector_add(pp, {x=0,y=-1,z=0}) - if loc ~= nil then - - local nodeiamon = get_node(loc) - - if nodeiamon ~= nil then - if on_walk[nodeiamon.name] then - on_walk[nodeiamon.name](loc, nodeiamon, player) - end - for i = 1, #registered_globals do + local pp = player:get_pos() + pp.y = ceil(pp.y) + local loc = vector_add(pp, {x=0,y=-1,z=0}) + if loc then + local nodeiamon = get_node(loc) + if nodeiamon then + if on_walk[nodeiamon.name] then + on_walk[nodeiamon.name](loc, nodeiamon, player) + end + for i = 1, #registered_globals do registered_globals[i](loc, nodeiamon, player) - end - end - end - end - + end + end + end + end timer = 0 end end) diff --git a/mods/ENTITIES/drippingwater/init.lua b/mods/ENTITIES/drippingwater/init.lua index 730cb7b77..e17bdda40 100644 --- a/mods/ENTITIES/drippingwater/init.lua +++ b/mods/ENTITIES/drippingwater/init.lua @@ -1,6 +1,8 @@ --Dripping Water Mod --by kddekadenz +local math = math + -- License of code, textures & sounds: CC0 --Drop entities @@ -20,26 +22,21 @@ minetest.register_entity("drippingwater:drop_water", { spritediv = {x=1, y=1}, initial_sprite_basepos = {x=0, y=0}, static_save = false, - on_activate = function(self, staticdata) self.object:set_sprite({x=0,y=0}, 1, 1, true) end, - on_step = function(self, dtime) - local k = math.random(1,222) - local ownpos = self.object:get_pos() - - if k==1 then - self.object:set_acceleration({x=0, y=-5, z=0}) - end - - if minetest.get_node({x=ownpos.x, y=ownpos.y +0.5, z=ownpos.z}).name == "air" then - self.object:set_acceleration({x=0, y=-5, z=0}) - end - + local k = math.random(1,222) + local ownpos = self.object:get_pos() + if k==1 then + self.object:set_acceleration({x=0, y=-5, z=0}) + end + if minetest.get_node({x=ownpos.x, y=ownpos.y +0.5, z=ownpos.z}).name == "air" then + self.object:set_acceleration({x=0, y=-5, z=0}) + end if minetest.get_node({x=ownpos.x, y=ownpos.y -0.5, z=ownpos.z}).name ~= "air" then - self.object:remove() - minetest.sound_play({name="drippingwater_drip"}, {pos = ownpos, gain = 0.5, max_hear_distance = 8}, true) + self.object:remove() + minetest.sound_play({name="drippingwater_drip"}, {pos = ownpos, gain = 0.5, max_hear_distance = 8}, true) end end, }) @@ -61,27 +58,21 @@ minetest.register_entity("drippingwater:drop_lava", { spritediv = {x=1, y=1}, initial_sprite_basepos = {x=0, y=0}, static_save = false, - on_activate = function(self, staticdata) self.object:set_sprite({x=0,y=0}, 1, 0, true) end, - on_step = function(self, dtime) - local k = math.random(1,222) - local ownpos = self.object:get_pos() - - if k==1 then - self.object:set_acceleration({x=0, y=-5, z=0}) - end - - if minetest.get_node({x=ownpos.x, y=ownpos.y +0.5, z=ownpos.z}).name == "air" then - self.object:set_acceleration({x=0, y=-5, z=0}) - end - - + local k = math.random(1,222) + local ownpos = self.object:get_pos() + if k == 1 then + self.object:set_acceleration({x=0, y=-5, z=0}) + end + if minetest.get_node({x=ownpos.x, y=ownpos.y +0.5, z=ownpos.z}).name == "air" then + self.object:set_acceleration({x=0, y=-5, z=0}) + end if minetest.get_node({x=ownpos.x, y=ownpos.y -0.5, z=ownpos.z}).name ~= "air" then - self.object:remove() - minetest.sound_play({name="drippingwater_lavadrip"}, {pos = ownpos, gain = 0.5, max_hear_distance = 8}, true) + self.object:remove() + minetest.sound_play({name="drippingwater_lavadrip"}, {pos = ownpos, gain = 0.5, max_hear_distance = 8}, true) end end, }) @@ -90,36 +81,34 @@ minetest.register_entity("drippingwater:drop_lava", { --Create drop -minetest.register_abm( - { +minetest.register_abm({ label = "Create water drops", nodenames = {"group:opaque", "group:leaves"}, neighbors = {"group:water"}, - interval = 2, - chance = 22, - action = function(pos) - if minetest.get_item_group(minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name, "water") ~= 0 and - minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name == "air" then + interval = 2, + chance = 22, + action = function(pos) + if minetest.get_item_group(minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name, "water") ~= 0 + and minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name == "air" then local i = math.random(-45,45) / 100 minetest.add_entity({x=pos.x + i, y=pos.y - 0.501, z=pos.z + i}, "drippingwater:drop_water") end - end, + end, }) --Create lava drop -minetest.register_abm( - { +minetest.register_abm({ label = "Create lava drops", nodenames = {"group:opaque"}, neighbors = {"group:lava"}, - interval = 2, - chance = 22, - action = function(pos) - if minetest.get_item_group(minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name, "lava") ~= 0 and - minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name == "air" then + interval = 2, + chance = 22, + action = function(pos) + if minetest.get_item_group(minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name, "lava") ~= 0 + and minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name == "air" then local i = math.random(-45,45) / 100 minetest.add_entity({x=pos.x + i, y=pos.y - 0.501, z=pos.z + i}, "drippingwater:drop_lava") end - end, -}) + end, +}) \ No newline at end of file diff --git a/mods/ENTITIES/mcl_boats/init.lua b/mods/ENTITIES/mcl_boats/init.lua index 433096df1..f99956a2a 100644 --- a/mods/ENTITIES/mcl_boats/init.lua +++ b/mods/ENTITIES/mcl_boats/init.lua @@ -1,4 +1,4 @@ -local S = minetest.get_translator("mcl_boats") +local S = minetest.get_translator(minetest.get_current_modname()) local boat_visual_size = {x = 1, y = 1, z = 1} local paddling_speed = 22 @@ -270,10 +270,10 @@ function boat.on_step(self, dtime, moveresult) p.y = p.y - boat_y_offset local new_velo - local new_acce = {x = 0, y = 0, z = 0} + local new_acce if not is_water(p) and not on_ice then -- Not on water or inside water: Free fall - local nodedef = minetest.registered_nodes[minetest.get_node(p).name] + --local nodedef = minetest.registered_nodes[minetest.get_node(p).name] new_acce = {x = 0, y = -9.8, z = 0} new_velo = get_velocity(self._v, self.object:get_yaw(), self.object:get_velocity().y) @@ -412,6 +412,6 @@ minetest.register_craft({ burntime = 20, }) -if minetest.get_modpath("doc_identifier") ~= nil then +if minetest.get_modpath("doc_identifier") then doc.sub.identifier.register_object("mcl_boats:boat", "craftitems", "mcl_boats:boat") end diff --git a/mods/ENTITIES/mcl_boats/locale/mcl_boats.fr.tr b/mods/ENTITIES/mcl_boats/locale/mcl_boats.fr.tr index 04d6d9da9..785d50146 100644 --- a/mods/ENTITIES/mcl_boats/locale/mcl_boats.fr.tr +++ b/mods/ENTITIES/mcl_boats/locale/mcl_boats.fr.tr @@ -6,6 +6,7 @@ Boats are used to travel on the surface of water.=Les bateaux sont utilisés pou Dark Oak Boat=Bateau en Chêne Noir Jungle Boat=Bateau en Acajou Oak Boat=Bateau en Chêne -Rightclick on a water source to place the boat. Rightclick the boat to enter it. Use [Left] and [Right] to steer, [Forwards] to speed up and [Backwards] to slow down or move backwards. Rightclick the boat again to leave it, punch the boat to make it drop as an item.=Faites un clic droit sur une source d'eau pour placer le bateau. Faites un clic droit sur le bateau pour y entrer. Utilisez [Gauche] et [Droite] pour diriger, [Avant] pour accélérer et [Arrière] pour ralentir ou reculer. Cliquez de nouveau avec le bouton droit sur le bateau pour le quitter, frappez le bateau pour le faire tomber en tant qu'objet. +Rightclick on a water source to place the boat. Rightclick the boat to enter it. Use [Left] and [Right] to steer, [Forwards] to speed up and [Backwards] to slow down or move backwards. Use [Sneak] to leave the boat, punch the boat to make it drop as an item.=Faites un clic droit sur une source d'eau pour placer le bateau. Faites un clic droit sur le bateau pour y entrer. Utilisez [Gauche] et [Droite] pour diriger, [Avant] pour accélérer et [Arrière] pour ralentir ou reculer. Utilisez [Sneak] pour le quitter, frappez le bateau pour le faire tomber en tant qu'objet. Spruce Boat=Bateau en Sapin -Water vehicle=Véhicule aquatique \ No newline at end of file +Water vehicle=Véhicule aquatique +Sneak to dismount= \ No newline at end of file diff --git a/mods/ENTITIES/mcl_boats/locale/mcl_boats.pl.tr b/mods/ENTITIES/mcl_boats/locale/mcl_boats.pl.tr new file mode 100644 index 000000000..17b5183bc --- /dev/null +++ b/mods/ENTITIES/mcl_boats/locale/mcl_boats.pl.tr @@ -0,0 +1,12 @@ +# textdomain: mcl_boats +Acacia Boat=Akacjowa łódź +Birch Boat=Brzozowa łódź +Boat=Łódź +Boats are used to travel on the surface of water.=Łodzie są wykorzystywane do podróżowania po powierzchni wody. +Dark Oak Boat=Ciemno-dębowa łódź +Jungle Boat=Tropikalna łódź +Oak Boat=Dębowa łódź +Rightclick on a water source to place the boat. Rightclick the boat to enter it. Use [Left] and [Right] to steer, [Forwards] to speed up and [Backwards] to slow down or move backwards. Use [Sneak] to leave the boat, punch the boat to make it drop as an item.=Kliknij prawym przyciskiem myszy na źródło wody by postawić łódź. Kliknij prawym przyciskiem myszy by w nią wsiąść. Użyj przycisków [Lewy] oraz [Prawy] by sterować, [Naprzód] by przyspieszyć i [W tył] by zwolnić lub się cofać. Kliknij [Skradanie] by z niej wyjść, uderz ją by wziąć ją jako przedmiot. +Spruce Boat=Świerkowa łódź +Water vehicle=Pojazd wodny +Sneak to dismount=Skradaj się by opuścić łódź diff --git a/mods/ENTITIES/mcl_boats/mod.conf b/mods/ENTITIES/mcl_boats/mod.conf index a5d6cc8cb..61463b6ec 100644 --- a/mods/ENTITIES/mcl_boats/mod.conf +++ b/mods/ENTITIES/mcl_boats/mod.conf @@ -1,7 +1,7 @@ name = mcl_boats author = PilzAdam description = Adds drivable boats. -depends = mcl_player, flowlib +depends = mcl_player, flowlib, mcl_title optional_depends = mcl_core, doc_identifier diff --git a/mods/ENTITIES/mcl_burning/api.lua b/mods/ENTITIES/mcl_burning/api.lua index 71697ab2a..a8c1648a7 100644 --- a/mods/ENTITIES/mcl_burning/api.lua +++ b/mods/ENTITIES/mcl_burning/api.lua @@ -1,5 +1,3 @@ -local S = minetest.get_translator("mcl_burning") - function mcl_burning.get_storage(obj) if obj:is_player() then return mcl_burning.storage[obj] @@ -79,22 +77,15 @@ function mcl_burning.set_on_fire(obj, burn_time) end if not storage.burn_time or burn_time >= storage.burn_time then - if obj:is_player() and not storage.fire_hud_id then - storage.fire_hud_id = obj:hud_add({ - hud_elem_type = "image", - position = {x = 0.5, y = 0.5}, - scale = {x = -100, y = -100}, - text = "mcl_burning_entity_flame_animated.png^[opacity:180^[verticalframe:" .. mcl_burning.animation_frames .. ":" .. 1, - z_index = 1000, - }) + if obj:is_player() then + mcl_burning.channels[obj]:send_all(tostring(mcl_burning.animation_frames)) + mcl_burning.channels[obj]:send_all("start") end storage.burn_time = burn_time storage.fire_damage_timer = 0 local fire_entity = minetest.add_entity(obj:get_pos(), "mcl_burning:fire") local fire_luaentity = fire_entity:get_luaentity() - fire_luaentity:update_visual_size(obj, storage) - fire_luaentity:update_frame(obj, storage) for _, other in pairs(minetest.get_objects_inside_radius(fire_entity:get_pos(), 0)) do local other_luaentity = other:get_luaentity() @@ -110,9 +101,7 @@ function mcl_burning.extinguish(obj) if mcl_burning.is_burning(obj) then local storage = mcl_burning.get_storage(obj) if obj:is_player() then - if storage.fire_hud_id then - obj:hud_remove(storage.fire_hud_id) - end + mcl_burning.channels[obj]:send_all("stop") mcl_burning.storage[obj] = {} else storage.burn_time = nil diff --git a/mods/ENTITIES/mcl_burning/init.lua b/mods/ENTITIES/mcl_burning/init.lua index 3092a3b65..bce656657 100644 --- a/mods/ENTITIES/mcl_burning/init.lua +++ b/mods/ENTITIES/mcl_burning/init.lua @@ -1,15 +1,20 @@ -local S = minetest.get_translator("mcl_burning") -local modpath = minetest.get_modpath("mcl_burning") +local modpath = minetest.get_modpath(minetest.get_current_modname()) + +local pairs = pairs + +local get_connected_players = minetest.get_connected_players +local get_item_group = minetest.get_item_group mcl_burning = { storage = {}, + channels = {}, animation_frames = tonumber(minetest.settings:get("fire_animation_frames")) or 8 } dofile(modpath .. "/api.lua") minetest.register_globalstep(function(dtime) - for _, player in pairs(minetest.get_connected_players()) do + for _, player in pairs(get_connected_players()) do local storage = mcl_burning.storage[player] if not mcl_burning.tick(player, dtime, storage) and not mcl_burning.is_affected_by_rain(player) then local nodes = mcl_burning.get_touching_nodes(player, {"group:puts_out_fire", "group:set_on_fire"}, storage) @@ -17,12 +22,12 @@ minetest.register_globalstep(function(dtime) for _, pos in pairs(nodes) do local node = minetest.get_node(pos) - if minetest.get_item_group(node.name, "puts_out_fire") > 0 then + if get_item_group(node.name, "puts_out_fire") > 0 then burn_time = 0 break end - local value = minetest.get_item_group(node.name, "set_on_fire") + local value = get_item_group(node.name, "set_on_fire") if value > burn_time then burn_time = value end @@ -65,13 +70,11 @@ minetest.register_on_joinplayer(function(player) end mcl_burning.storage[player] = storage + mcl_burning.channels[player] = minetest.mod_channel_join("mcl_burning:" .. player:get_player_name()) end) minetest.register_on_leaveplayer(function(player) - local storage = mcl_burning.storage[player] - storage.fire_hud_id = nil - player:get_meta():set_string("mcl_burning:data", minetest.serialize(storage)) - + player:get_meta():set_string("mcl_burning:data", minetest.serialize(mcl_burning.storage[player])) mcl_burning.storage[player] = nil end) @@ -80,28 +83,28 @@ minetest.register_entity("mcl_burning:fire", { initial_properties = { physical = false, collisionbox = {0, 0, 0, 0, 0, 0}, - visual = "cube", + visual = "upright_sprite", + textures = { + name = "mcl_burning_entity_flame_animated.png", + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 1.0, + }, + }, + spritediv = {x = 1, y = mcl_burning.animation_frames}, pointable = false, glow = -1, + backface_culling = false, }, - animation_frame = 0, animation_timer = 0, - - on_step = function(self, dtime) - local parent, storage = self:sanity_check() - - if parent then - self.animation_timer = self.animation_timer + dtime - if self.animation_timer >= 0.1 then - self.animation_timer = 0 - self.animation_frame = self.animation_frame + 1 - if self.animation_frame > mcl_burning.animation_frames - 1 then - self.animation_frame = 0 - end - self:update_frame(parent, storage) - end - else + on_activate = function(self) + self.object:set_sprite({x = 0, y = 0}, mcl_burning.animation_frames, 1.0 / mcl_burning.animation_frames) + end, + on_step = function(self) + if not self:sanity_check() then self.object:remove() end end, @@ -109,24 +112,16 @@ minetest.register_entity("mcl_burning:fire", { local parent = self.object:get_attach() if not parent then - return + return false end local storage = mcl_burning.get_storage(parent) if not storage or not storage.burn_time then - return + return false end - return parent, storage - end, - update_frame = function(self, parent, storage) - local frame_overlay = "^[opacity:180^[verticalframe:" .. mcl_burning.animation_frames .. ":" .. self.animation_frame - local fire_texture = "mcl_burning_entity_flame_animated.png" .. frame_overlay - self.object:set_properties({textures = {"blank.png", "blank.png", fire_texture, fire_texture, fire_texture, fire_texture}}) - if parent:is_player() then - parent:hud_change(storage.fire_hud_id, "text", "mcl_burning_hud_flame_animated.png" .. frame_overlay) - end + return true end, update_visual_size = function(self, parent, storage) parent = parent or self.object:get_attach() diff --git a/mods/ENTITIES/mcl_falling_nodes/init.lua b/mods/ENTITIES/mcl_falling_nodes/init.lua index af2c06703..d527603de 100644 --- a/mods/ENTITIES/mcl_falling_nodes/init.lua +++ b/mods/ENTITIES/mcl_falling_nodes/init.lua @@ -1,7 +1,4 @@ -local S = minetest.get_translator("mcl_falling_nodes") -local has_mcl_armor = minetest.get_modpath("mcl_armor") - -local get_falling_depth = function(self) +local function get_falling_depth(self) if not self._startpos then -- Fallback self._startpos = self.object:get_pos() @@ -9,7 +6,7 @@ local get_falling_depth = function(self) return self._startpos.y - vector.round(self.object:get_pos()).y end -local deal_falling_damage = function(self, dtime) +local function deal_falling_damage(self, dtime) if minetest.get_item_group(self.node.name, "falling_node_damage") == 0 then return end @@ -22,7 +19,10 @@ local deal_falling_damage = function(self, dtime) end self._hit = self._hit or {} for _, obj in ipairs(minetest.get_objects_inside_radius(pos, 1)) do - if mcl_util.get_hp(obj) > 0 and not self._hit[obj] then + local entity = obj:get_luaentity() + if entity and entity.name == "__builtin:item" then + obj:remove() + elseif mcl_util.get_hp(obj) > 0 and not self._hit[obj] then self._hit[obj] = true local way = self._startpos.y - pos.y local damage = (way - 1) * 2 @@ -38,7 +38,7 @@ local deal_falling_damage = function(self, dtime) inv:set_stack("armor", 2, helmet) end end - local deathmsg, dmg_type + local dmg_type if minetest.get_item_group(self.node.name, "anvil") ~= 0 then dmg_type = "anvil" else @@ -60,10 +60,8 @@ minetest.register_entity(":__builtin:falling_node", { collide_with_objects = false, collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, }, - node = {}, meta = {}, - set_node = function(self, node, meta) local def = minetest.registered_nodes[node.name] -- Change falling node if definition tells us to @@ -90,7 +88,6 @@ minetest.register_entity(":__builtin:falling_node", { glow = glow, }) end, - get_staticdata = function(self) local meta = self.meta -- Workaround: Save inventory seperately from metadata. @@ -111,7 +108,6 @@ minetest.register_entity(":__builtin:falling_node", { } return minetest.serialize(ds) end, - on_activate = function(self, staticdata) self.object:set_armor_groups({immortal = 1}) @@ -134,7 +130,6 @@ minetest.register_entity(":__builtin:falling_node", { end self._startpos = vector.round(self._startpos) end, - on_step = function(self, dtime) -- Set gravity local acceleration = self.object:get_acceleration() @@ -186,10 +181,9 @@ minetest.register_entity(":__builtin:falling_node", { return end local nd = minetest.registered_nodes[n2.name] - if n2.name == "mcl_portals:portal_end" then - -- TODO: Teleport falling node. - - elseif (nd and nd.buildable_to == true) or minetest.get_item_group(self.node.name, "crush_after_fall") ~= 0 then + --if n2.name == "mcl_portals:portal_end" then + -- TODO: Teleport falling node. + if (nd and nd.buildable_to == true) or minetest.get_item_group(self.node.name, "crush_after_fall") ~= 0 then -- Replace destination node if it's buildable to minetest.remove_node(np) -- Run script hook @@ -256,7 +250,6 @@ minetest.register_entity(":__builtin:falling_node", { self.object:set_pos(npos) end end - deal_falling_damage(self, dtime) end }) diff --git a/mods/ENTITIES/mcl_falling_nodes/locale/mcl_falling_nodes.de.tr b/mods/ENTITIES/mcl_falling_nodes/locale/mcl_falling_nodes.de.tr deleted file mode 100644 index 71dfa4be9..000000000 --- a/mods/ENTITIES/mcl_falling_nodes/locale/mcl_falling_nodes.de.tr +++ /dev/null @@ -1,3 +0,0 @@ -# textdomain: mcl_falling_nodes -@1 was smashed by a falling anvil.=@1 wurde von einem fallenden Amboss zerschmettert. -@1 was smashed by a falling block.=@1 wurde von einem fallenden Block zerschmettert. diff --git a/mods/ENTITIES/mcl_falling_nodes/locale/mcl_falling_nodes.es.tr b/mods/ENTITIES/mcl_falling_nodes/locale/mcl_falling_nodes.es.tr deleted file mode 100644 index 41cbf61b4..000000000 --- a/mods/ENTITIES/mcl_falling_nodes/locale/mcl_falling_nodes.es.tr +++ /dev/null @@ -1,3 +0,0 @@ -# textdomain: mcl_falling_nodes -@1 was smashed by a falling anvil.=@1 fue aplastado por la caída de un yunque. -@1 was smashed by a falling block.=@1 fue aplastado por la caída de un bloque. diff --git a/mods/ENTITIES/mcl_falling_nodes/locale/mcl_falling_nodes.fr.tr b/mods/ENTITIES/mcl_falling_nodes/locale/mcl_falling_nodes.fr.tr deleted file mode 100644 index 781cd7048..000000000 --- a/mods/ENTITIES/mcl_falling_nodes/locale/mcl_falling_nodes.fr.tr +++ /dev/null @@ -1,3 +0,0 @@ -# textdomain: mcl_falling_nodes -@1 was smashed by a falling anvil.=@1 a été écrasé par une enclume qui tombait. -@1 was smashed by a falling block.=@1 a été écrasé par un bloc qui tombait. diff --git a/mods/ENTITIES/mcl_falling_nodes/locale/mcl_falling_nodes.ru.tr b/mods/ENTITIES/mcl_falling_nodes/locale/mcl_falling_nodes.ru.tr deleted file mode 100644 index 6c8b9375a..000000000 --- a/mods/ENTITIES/mcl_falling_nodes/locale/mcl_falling_nodes.ru.tr +++ /dev/null @@ -1,3 +0,0 @@ -# textdomain: mcl_falling_nodes -@1 was smashed by a falling anvil.=@1 придавило падающей наковальней. -@1 was smashed by a falling block.=@1 раздавило падающим блоком. diff --git a/mods/ENTITIES/mcl_falling_nodes/locale/template.txt b/mods/ENTITIES/mcl_falling_nodes/locale/template.txt deleted file mode 100644 index 4adabaf01..000000000 --- a/mods/ENTITIES/mcl_falling_nodes/locale/template.txt +++ /dev/null @@ -1,3 +0,0 @@ -# textdomain: mcl_falling_nodes -@1 was smashed by a falling anvil.= -@1 was smashed by a falling block.= diff --git a/mods/ENTITIES/mcl_item_entity/init.lua b/mods/ENTITIES/mcl_item_entity/init.lua index 895bfc892..cfd141f04 100644 --- a/mods/ENTITIES/mcl_item_entity/init.lua +++ b/mods/ENTITIES/mcl_item_entity/init.lua @@ -1,5 +1,5 @@ --these are lua locals, used for higher performance -local minetest,math,vector,ipairs = minetest,math,vector,ipairs +local minetest, math, vector, ipairs, pairs = minetest, math, vector, ipairs, pairs --this is used for the player pool in the sound buffer local pool = {} @@ -38,7 +38,7 @@ item_drop_settings.drop_single_item = false --if true, the drop control dro item_drop_settings.magnet_time = 0.75 -- how many seconds an item follows the player before giving up -local get_gravity = function() +local function get_gravity() return tonumber(minetest.settings:get("movement_gravity")) or 9.81 end @@ -60,7 +60,7 @@ mcl_item_entity.register_pickup_achievement("mcl_mobitems:blaze_rod", "mcl:blaze mcl_item_entity.register_pickup_achievement("mcl_mobitems:leather", "mcl:killCow") mcl_item_entity.register_pickup_achievement("mcl_core:diamond", "mcl:diamonds") -local check_pickup_achievements = function(object, player) +local function check_pickup_achievements(object, player) if has_awards then local itemname = ItemStack(object:get_luaentity().itemstring):get_name() local playername = player:get_player_name() @@ -72,7 +72,7 @@ local check_pickup_achievements = function(object, player) end end -local enable_physics = function(object, luaentity, ignore_check) +local function enable_physics(object, luaentity, ignore_check) if luaentity.physical_state == false or ignore_check == true then luaentity.physical_state = true object:set_properties({ @@ -83,7 +83,7 @@ local enable_physics = function(object, luaentity, ignore_check) end end -local disable_physics = function(object, luaentity, ignore_check, reset_movement) +local function disable_physics(object, luaentity, ignore_check, reset_movement) if luaentity.physical_state == true or ignore_check == true then luaentity.physical_state = false object:set_properties({ @@ -98,13 +98,11 @@ end minetest.register_globalstep(function(dtime) - tick = not tick for _,player in pairs(minetest.get_connected_players()) do if player:get_hp() > 0 or not minetest.settings:get_bool("enable_damage") then - local name = player:get_player_name() local pos = player:get_pos() @@ -235,7 +233,7 @@ function minetest.handle_node_drops(pos, drops, digger) local dug_node = minetest.get_node(pos) local tooldef local tool - if digger ~= nil then + if digger then tool = digger:get_wielded_item() tooldef = minetest.registered_tools[tool:get_name()] @@ -316,7 +314,7 @@ function minetest.handle_node_drops(pos, drops, digger) end -- Spawn item and apply random speed local obj = minetest.add_item(dpos, drop_item) - if obj ~= nil then + if obj then local x = math.random(1, 5) if math.random(1,2) == 1 then x = -x @@ -365,6 +363,17 @@ if not time_to_live then time_to_live = 300 end +local function cxcz(o, cw, one, zero) + if cw < 0 then + table.insert(o, { [one]=1, y=0, [zero]=0 }) + table.insert(o, { [one]=-1, y=0, [zero]=0 }) + else + table.insert(o, { [one]=-1, y=0, [zero]=0 }) + table.insert(o, { [one]=1, y=0, [zero]=0 }) + end + return o +end + minetest.register_entity(":__builtin:item", { initial_properties = { hp_max = 1, @@ -385,7 +394,7 @@ minetest.register_entity(":__builtin:item", { -- The itemstring MUST be set immediately to a non-empty string after creating the entity. -- The hand is NOT permitted as dropped item. ;-) -- Item entities will be deleted if they still have an empty itemstring on their first on_step tick. - itemstring = '', + itemstring = "", -- If true, item will fall physical_state = true, @@ -426,13 +435,9 @@ minetest.register_entity(":__builtin:item", { if itemtable then itemname = stack:to_table().name end - local item_texture = nil - local item_type = "" local glow local def = minetest.registered_items[itemname] if def then - item_texture = def.inventory_image - item_type = def.type description = def.description glow = def.light_source end @@ -475,7 +480,7 @@ minetest.register_entity(":__builtin:item", { end, get_staticdata = function(self) - return minetest.serialize({ + local data = minetest.serialize({ itemstring = self.itemstring, always_collect = self.always_collect, age = self.age, @@ -483,6 +488,39 @@ minetest.register_entity(":__builtin:item", { _flowing = self._flowing, _removed = self._removed, }) + -- sfan5 guessed that the biggest serializable item + -- entity would have a size of 65530 bytes. This has + -- been experimentally verified to be still too large. + -- + -- anon5 has calculated that the biggest serializable + -- item entity has a size of exactly 65487 bytes: + -- + -- 1. serializeString16 can handle max. 65535 bytes. + -- 2. The following engine metadata is always saved: + -- • 1 byte (version) + -- • 2 byte (length prefix) + -- • 14 byte “__builtin:item” + -- • 4 byte (length prefix) + -- • 2 byte (health) + -- • 3 × 4 byte = 12 byte (position) + -- • 4 byte (yaw) + -- • 1 byte (version 2) + -- • 2 × 4 byte = 8 byte (pitch and roll) + -- 3. This leaves 65487 bytes for the serialization. + if #data > 65487 then -- would crash the engine + local stack = ItemStack(self.itemstring) + stack:get_meta():from_table(nil) + self.itemstring = stack:to_string() + minetest.log( + "warning", + "Overlong item entity metadata removed: “" .. + self.itemstring .. + "” had serialized length of " .. + #data + ) + return self:get_staticdata() + end + return data end, on_activate = function(self, staticdata, dtime_s) @@ -570,7 +608,7 @@ minetest.register_entity(":__builtin:item", { return true end, - on_step = function(self, dtime) + on_step = function(self, dtime, moveresult) if self._removed then self.object:set_properties({ physical = false @@ -580,7 +618,7 @@ minetest.register_entity(":__builtin:item", { return end self.age = self.age + dtime - if self._collector_timer ~= nil then + if self._collector_timer then self._collector_timer = self._collector_timer + dtime end if time_to_live > 0 and self.age > time_to_live then @@ -637,6 +675,18 @@ minetest.register_entity(":__builtin:item", { end end + -- Destroy item when it collides with a cactus + if moveresult and moveresult.collides then + for _, collision in pairs(moveresult.collisions) do + local pos = collision.node_pos + if collision.type == "node" and minetest.get_node(pos).name == "mcl_core:cactus" then + self._removed = true + self.object:remove() + return + end + end + end + -- Push item out when stuck inside solid opaque node if def and def.walkable and def.groups and def.groups.opaque == 1 then local shootdir @@ -648,16 +698,6 @@ minetest.register_entity(":__builtin:item", { -- 1st: closest -- 2nd: other direction -- 3rd and 4th: other axis - local cxcz = function(o, cw, one, zero) - if cw < 0 then - table.insert(o, { [one]=1, y=0, [zero]=0 }) - table.insert(o, { [one]=-1, y=0, [zero]=0 }) - else - table.insert(o, { [one]=-1, y=0, [zero]=0 }) - table.insert(o, { [one]=1, y=0, [zero]=0 }) - end - return o - end if math.abs(cx) < math.abs(cz) then order = cxcz(order, cx, "x", "z") order = cxcz(order, cz, "z", "x") diff --git a/mods/ENTITIES/mcl_minecarts/functions.lua b/mods/ENTITIES/mcl_minecarts/functions.lua index 42cdecd12..2f0dfe0ae 100644 --- a/mods/ENTITIES/mcl_minecarts/functions.lua +++ b/mods/ENTITIES/mcl_minecarts/functions.lua @@ -1,3 +1,5 @@ +local vector = vector + function mcl_minecarts:get_sign(z) if z == 0 then return 0 @@ -38,11 +40,9 @@ end function mcl_minecarts:check_front_up_down(pos, dir_, check_down, railtype) local dir = vector.new(dir_) - local cur = nil - -- Front dir.y = 0 - cur = vector.add(pos, dir) + local cur = vector.add(pos, dir) if mcl_minecarts:is_rail(cur, railtype) then return dir end @@ -65,9 +65,9 @@ end function mcl_minecarts:get_rail_direction(pos_, dir, ctrl, old_switch, railtype) local pos = vector.round(pos_) - local cur = nil + local cur local left_check, right_check = true, true - + -- Check left and right local left = {x=0, y=0, z=0} local right = {x=0, y=0, z=0} @@ -78,7 +78,7 @@ function mcl_minecarts:get_rail_direction(pos_, dir, ctrl, old_switch, railtype) left.z = dir.x right.z = -dir.x end - + if ctrl then if old_switch == 1 then left_check = false @@ -100,13 +100,13 @@ function mcl_minecarts:get_rail_direction(pos_, dir, ctrl, old_switch, railtype) right_check = true end end - + -- Normal cur = mcl_minecarts:check_front_up_down(pos, dir, true, railtype) if cur then return cur end - + -- Left, if not already checked if left_check then cur = mcl_minecarts:check_front_up_down(pos, left, false, railtype) @@ -114,7 +114,7 @@ function mcl_minecarts:get_rail_direction(pos_, dir, ctrl, old_switch, railtype) return cur end end - + -- Right, if not already checked if right_check then cur = mcl_minecarts:check_front_up_down(pos, right, false, railtype) @@ -122,7 +122,6 @@ function mcl_minecarts:get_rail_direction(pos_, dir, ctrl, old_switch, railtype) return cur end end - -- Backwards if not old_switch then cur = mcl_minecarts:check_front_up_down(pos, { @@ -134,7 +133,5 @@ function mcl_minecarts:get_rail_direction(pos_, dir, ctrl, old_switch, railtype) return cur end end - return {x=0, y=0, z=0} -end - +end \ No newline at end of file diff --git a/mods/ENTITIES/mcl_minecarts/init.lua b/mods/ENTITIES/mcl_minecarts/init.lua index 70bf16477..4d3873cc2 100644 --- a/mods/ENTITIES/mcl_minecarts/init.lua +++ b/mods/ENTITIES/mcl_minecarts/init.lua @@ -1,9 +1,10 @@ -local S = minetest.get_translator("mcl_minecarts") +local modname = minetest.get_current_modname() +local S = minetest.get_translator(modname) local has_mcl_wip = minetest.get_modpath("mcl_wip") mcl_minecarts = {} -mcl_minecarts.modpath = minetest.get_modpath("mcl_minecarts") +mcl_minecarts.modpath = minetest.get_modpath(modname) mcl_minecarts.speed_max = 10 mcl_minecarts.check_float_time = 15 @@ -204,7 +205,7 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick, o rou_pos = vector.round(pos) node = minetest.get_node(rou_pos) local g = minetest.get_item_group(node.name, "connect_to_raillike") - if g ~= self._railtype and self._railtype ~= nil then + if g ~= self._railtype and self._railtype then -- Detach driver if player then if self._old_pos then @@ -486,7 +487,6 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick, o if update.pos then self.object:set_pos(pos) end - update = nil end function cart:get_staticdata() @@ -497,7 +497,7 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick, o end -- Place a minecart at pointed_thing -mcl_minecarts.place_minecart = function(itemstack, pointed_thing, placer) +function mcl_minecarts.place_minecart(itemstack, pointed_thing, placer) if not pointed_thing.type == "node" then return end @@ -524,7 +524,7 @@ mcl_minecarts.place_minecart = function(itemstack, pointed_thing, placer) local cart = minetest.add_entity(railpos, entity_id) local railtype = minetest.get_item_group(node.name, "connect_to_raillike") local le = cart:get_luaentity() - if le ~= nil then + if le then le._railtype = railtype end local cart_dir = mcl_minecarts:get_rail_direction(railpos, {x=1, y=0, z=0}, nil, nil, railtype) @@ -541,7 +541,7 @@ mcl_minecarts.place_minecart = function(itemstack, pointed_thing, placer) end -local register_craftitem = function(itemstring, entity_id, description, tt_help, longdesc, usagehelp, icon, creative) +local function register_craftitem(itemstring, entity_id, description, tt_help, longdesc, usagehelp, icon, creative) entity_mapping[itemstring] = entity_id local groups = { minecart = 1, transport = 1 } @@ -607,7 +607,7 @@ Register a minecart local function register_minecart(itemstring, entity_id, description, tt_help, longdesc, usagehelp, mesh, textures, icon, drop, on_rightclick, on_activate_by_rail, creative) register_entity(entity_id, mesh, textures, drop, on_rightclick, on_activate_by_rail) register_craftitem(itemstring, entity_id, description, tt_help, longdesc, usagehelp, icon, creative) - if minetest.get_modpath("doc_identifier") ~= nil then + if minetest.get_modpath("doc_identifier") then doc.sub.identifier.register_object(entity_id, "craftitems", itemstring) end end @@ -646,7 +646,7 @@ register_minecart( if player then mcl_player.player_set_animation(player, "sit" , 30) player:set_eye_offset({x=0, y=-5.5, z=0},{x=0, y=-4, z=0}) - mcl_tmp_message.message(clicker, S("Sneak to dismount")) + mcl_title.set(clicker, "actionbar", {text=S("Sneak to dismount"), color="white", stay=60}) end end, name) end @@ -817,31 +817,30 @@ minetest.register_craft({ }) -- TODO: Re-enable crafting of special minecarts when they have been implemented -if false then - minetest.register_craft({ - output = "mcl_minecarts:furnace_minecart", - recipe = { - {"mcl_furnaces:furnace"}, - {"mcl_minecarts:minecart"}, - }, - }) +--[[minetest.register_craft({ + output = "mcl_minecarts:furnace_minecart", + recipe = { + {"mcl_furnaces:furnace"}, + {"mcl_minecarts:minecart"}, + }, +}) - minetest.register_craft({ - output = "mcl_minecarts:hopper_minecart", - recipe = { - {"mcl_hoppers:hopper"}, - {"mcl_minecarts:minecart"}, - }, - }) +minetest.register_craft({ + output = "mcl_minecarts:hopper_minecart", + recipe = { + {"mcl_hoppers:hopper"}, + {"mcl_minecarts:minecart"}, + }, +}) + +minetest.register_craft({ + output = "mcl_minecarts:chest_minecart", + recipe = { + {"mcl_chests:chest"}, + {"mcl_minecarts:minecart"}, + }, +})]] - minetest.register_craft({ - output = "mcl_minecarts:chest_minecart", - recipe = { - {"mcl_chests:chest"}, - {"mcl_minecarts:minecart"}, - }, - }) -end if has_mcl_wip then mcl_wip.register_wip_item("mcl_minecarts:chest_minecart") diff --git a/mods/ENTITIES/mcl_minecarts/locale/mcl_minecarts.fr.tr b/mods/ENTITIES/mcl_minecarts/locale/mcl_minecarts.fr.tr index 39cdfd013..67ed5eb1b 100644 --- a/mods/ENTITIES/mcl_minecarts/locale/mcl_minecarts.fr.tr +++ b/mods/ENTITIES/mcl_minecarts/locale/mcl_minecarts.fr.tr @@ -33,3 +33,4 @@ Activates minecarts when powered=Active les wagonnets lorsqu'il est alimenté Emits redstone power when a minecart is detected=Émet de l'énergie redstone lorsqu'un wagonnet est détecté Vehicle for fast travel on rails=Véhicule pour voyager rapidement sur rails Can be ignited by tools or powered activator rail=Peut être allumé par des outils ou un rail d'activation motorisé +Sneak to dismount= \ No newline at end of file diff --git a/mods/ENTITIES/mcl_minecarts/locale/mcl_minecarts.pl.tr b/mods/ENTITIES/mcl_minecarts/locale/mcl_minecarts.pl.tr new file mode 100644 index 000000000..b36ec5eb1 --- /dev/null +++ b/mods/ENTITIES/mcl_minecarts/locale/mcl_minecarts.pl.tr @@ -0,0 +1,36 @@ +# textdomain: mcl_minecarts +Minecart=Wagonik +Minecarts can be used for a quick transportion on rails.=Wagoniki mogą być użyte do szybkiego transportu po torach. +Minecarts only ride on rails and always follow the tracks. At a T-junction with no straight way ahead, they turn left. The speed is affected by the rail type.=Wagoniki mogą jeździć tylko po torach i zawsze podążają za wytyczoną ścieżką. W przypadku skrzyżowań typu T, gdzie nie ma prostej ścieżki, skręcają w lew. Ich szybkość zależy od typu torów. +You can place the minecart on rails. Right-click it to enter it. Punch it to get it moving.=Możesz postawić wagonik na torach. Kliknij prawym przyciskiem myszy aby do niego wejść. Uderz go by zaczął się poruszać. +To obtain the minecart, punch it while holding down the sneak key.=Aby odzyskać wagonik uderz go podczas skradania. +A minecart with TNT is an explosive vehicle that travels on rail.=Wagonik z TNT jest wybuchowym pojazdem podróżującym po torach. +Place it on rails. Punch it to move it. The TNT is ignited with a flint and steel or when the minecart is on an powered activator rail.=Postaw go na torach. Uderz by zaczął się poruszać. TNT zapala się krzesiwem lub gdy wagonik jest na zasilonych torach aktywacyjnych. +To obtain the minecart and TNT, punch them while holding down the sneak key. You can't do this if the TNT was ignited.=Aby odzyskać wagonik z TNT uderz go podczas skradania. Nie możesz tego zrobić gdy TNT jest zapalone. +A minecart with furnace is a vehicle that travels on rails. It can propel itself with fuel.=Wagonik z piecem jest pojazdem podróżującym na torach. Napędza on samego siebie za pomocą paliwa. +Place it on rails. If you give it some coal, the furnace will start burning for a long time and the minecart will be able to move itself. Punch it to get it moving.=Postaw go na torach. Jeśli dasz mu nieco węgla piec zacznie palić przez długi czas, a wagonik będzie się sam poruszał. Uderz go by zaczął się poruszać. +To obtain the minecart and furnace, punch them while holding down the sneak key.=Aby odzyskać wagonik z piecem uderz go podczas skradania. +Minecart with Chest=Wagonik ze skrzynią +Minecart with Furnace=Wagonik z piecem +Minecart with Command Block=Wagonik z blokiem poleceń +Minecart with Hopper=Wagonik z lejem +Minecart with TNT=Wagonik z TNT +Place them on the ground to build your railway, the rails will automatically connect to each other and will turn into curves, T-junctions, crossings and slopes as needed.=Postaw je na ziemi by zbudować ścieżkę z torów. Tory automatycznie połączą się ze sobą i zamienią się w zakręty, skrzyżowania typu T, skrzyżowania i równie w zależności od potrzeb. +Rail=Tor +Rails can be used to build transport tracks for minecarts. Normal rails slightly slow down minecarts due to friction.=Tory mogą być wykorzystane do zbudowania torów dla wagoników. Zwyczajne tory nieco spowalniają wagoniki ze względu na tarcie. +Powered Rail=Zasilane tory +Rails can be used to build transport tracks for minecarts. Powered rails are able to accelerate and brake minecarts.=Tory mogą być wykorzystane do zbudowania torów dla wagoników. Zasilane tory mogą przyspieszać lub spowalniać wagoniki. +Without redstone power, the rail will brake minecarts. To make this rail accelerate minecarts, power it with redstone power.=Bez zasilania czerwienitem tory będą spowalniać wagoniki. Aby sprawić by je przyspieszały zasil je czerwienitem. +Activator Rail=Tory aktywacyjne +Rails can be used to build transport tracks for minecarts. Activator rails are used to activate special minecarts.=Tory mogą być wykorzystane do zbudowania torów dla wagoników. Tory aktywacyjne są wykorzystywane do aktywacji specjalnych wagoników. +To make this rail activate minecarts, power it with redstone power and send a minecart over this piece of rail.=Aby ten tor aktywował wagonik, zasil go czerwienitem i spraw by wagonik po nim przejechał. +Detector Rail=Tory z czujnikiem +Rails can be used to build transport tracks for minecarts. A detector rail is able to detect a minecart above it and powers redstone mechanisms.=Tory mogą być wykorzystane do zbudowania torów dla wagoników. Tory z czujnikiem są w stanie wykryć kiedy wagonik po nich przejeżdża i wysłać sygnał do czerwienitowych mechanizmów. +To detect a minecart and provide redstone power, connect it to redstone trails or redstone mechanisms and send any minecart over the rail.=Aby wykryć wagonik i dostarczyć zasilanie czerwienitem podłącz go czerwienitem to mechanizmu i spraw by wagonik po nim przejechał. +Track for minecarts=Tor dla wagoników +Speed up when powered, slow down when not powered=Przyspiesza gdy zasilane, spowalnia gdy nie +Activates minecarts when powered=Aktywuje wagoniki gdy zasilane +Emits redstone power when a minecart is detected=Emituje zasilanie czerwienitem gdy wagonik jest wykryty +Vehicle for fast travel on rails=Pojazd do szybkiej podróży na torach +Can be ignited by tools or powered activator rail=Może być zapalony przez narzędzia, lub zasilane tor aktywacyjne +Sneak to dismount=Zacznij się skradać by zejść diff --git a/mods/ENTITIES/mcl_minecarts/mod.conf b/mods/ENTITIES/mcl_minecarts/mod.conf index 9fff9175d..3b8ae5551 100644 --- a/mods/ENTITIES/mcl_minecarts/mod.conf +++ b/mods/ENTITIES/mcl_minecarts/mod.conf @@ -1,6 +1,6 @@ name = mcl_minecarts author = Krock description = Minecarts are vehicles to move players quickly on rails. -depends = mcl_explosions, mcl_core, mcl_sounds, mcl_player, mcl_achievements, mcl_chests, mcl_furnaces, mesecons_commandblock, mcl_hoppers, mcl_tnt, mesecons +depends = mcl_title, mcl_explosions, mcl_core, mcl_sounds, mcl_player, mcl_achievements, mcl_chests, mcl_furnaces, mesecons_commandblock, mcl_hoppers, mcl_tnt, mesecons optional_depends = doc_identifier, mcl_wip diff --git a/mods/ENTITIES/mcl_minecarts/rails.lua b/mods/ENTITIES/mcl_minecarts/rails.lua index 4c26aea8c..91282f253 100644 --- a/mods/ENTITIES/mcl_minecarts/rails.lua +++ b/mods/ENTITIES/mcl_minecarts/rails.lua @@ -1,7 +1,7 @@ -local S = minetest.get_translator("mcl_minecarts") +local S = minetest.get_translator(minetest.get_current_modname()) -- Template rail function -local register_rail = function(itemstring, tiles, def_extras, creative) +local function register_rail(itemstring, tiles, def_extras, creative) local groups = {handy=1,pickaxey=1, attached_node=1,rail=1,connect_to_raillike=minetest.raillike_group("rail"),dig_by_water=1,destroy_by_lava_flow=1, transport=1} if creative == false then groups.not_in_creative_inventory = 1 @@ -206,11 +206,11 @@ register_rail("mcl_minecarts:detector_rail_on", -- Crafting minetest.register_craft({ - output = 'mcl_minecarts:rail 16', + output = "mcl_minecarts:rail 16", recipe = { - {'mcl_core:iron_ingot', '', 'mcl_core:iron_ingot'}, - {'mcl_core:iron_ingot', 'mcl_core:stick', 'mcl_core:iron_ingot'}, - {'mcl_core:iron_ingot', '', 'mcl_core:iron_ingot'}, + {"mcl_core:iron_ingot", "", "mcl_core:iron_ingot"}, + {"mcl_core:iron_ingot", "mcl_core:stick", "mcl_core:iron_ingot"}, + {"mcl_core:iron_ingot", "", "mcl_core:iron_ingot"}, } }) diff --git a/mods/ENTITIES/mcl_mobs/LICENSE-MEDIA.md b/mods/ENTITIES/mcl_mobs/LICENSE-MEDIA.md index 65f1f8896..7f9e005ea 100644 --- a/mods/ENTITIES/mcl_mobs/LICENSE-MEDIA.md +++ b/mods/ENTITIES/mcl_mobs/LICENSE-MEDIA.md @@ -190,9 +190,10 @@ Origin of those models: * [Spennnyyy](https://freesound.org/people/Spennnyyy/) (CC0) * `mcl_totems_totem.ogg` * Source: -* [Baŝto](https://opengameart.org/users/ba%C5%9Dto) +* [Baŝto](https://opengameart.org/users/ba%C5%9Dto) (remixer) and [kantouth](https://freesound.org/people/kantouth/) (original author) * `mobs_mc_skeleton_random.*.ogg` (CC BY 3.0) * Source: + * Based on: * [spookymodem](https://freesound.org/people/spookymodem/) * `mobs_mc_skeleton_death.ogg` (CC0) * @@ -306,4 +307,4 @@ Origin of those models: Note: Many of these sounds have been more or less modified to fit the game. -Sounds not mentioned hre are licensed under CC0. +Sounds not mentioned here are licensed under CC0. diff --git a/mods/ENTITIES/mcl_mobs/README.md b/mods/ENTITIES/mcl_mobs/README.md index d7ffef303..aa79d909c 100644 --- a/mods/ENTITIES/mcl_mobs/README.md +++ b/mods/ENTITIES/mcl_mobs/README.md @@ -1,33 +1,74 @@ -# MineClone2 Mobs -This is a merged version of Mobs redo MineClone2 Edition (API) and mobs_mc (Mobs content). -The API was rewritten by jordan4ibanez and later Fleckenstein from Mobs redo MineClone2 Edition and merged with mobs_mc by Fleckenstein. -Mobs redo MineClone2 Edition was built by Wuzzy2 and contributors from Mobs Redo. Mobs redo was built by TenPlus1 from Simple Mobs by PilzAdam and mobs_mc was built by maikerumine. +Mobs Redo: MineClone 2 Edition -Seems like we've come a long way since 2012. +Based on Mobs Redo from TenPlus1 +Built from PilzAdam's original Simple Mobs with additional mobs by KrupnoPavel, Zeg9, ExeterDad and AspireMint. -## Credits -* Fleckenstein: Rewrite of jordan's work, merged mobs_mc and mcl_mobs -* jordan4ibanez: Rewrite of the mcl_mobs API -* [maikerumine](https://github.com/maikerumine): Creator of mobs_mc (Coding behaviour, spawning, drops, and misc) -* TenPlus1: Built the original Mobs Redo API -* PilzAdam: Created Simple Mobs which Mobs Redo is based on together with KrupnoPavel, Zeg9, ExeterDad and AspireMint -* [Wuzzy2](https://github.com/Wuzzy2): Zombies, husks, item textures, and code, created Mobs redo MineClone2 Edition -* [toby109tt](https://github.com/tobyplowy): Mapping fixes - better 2D planes -* [22i](https://github.com/22i): Models (done in Blender) and mob icons for spawn eggs -* [XSSheep](https://www.planetminecraft.com/member/xssheep/): Mob and item textures (from [Pixel Perfection](https://www.planetminecraft.com/texture_pack/131pixel-perfection/)) -* MysticTempest: More mob textures -* See `LICENSE-MEDIA.md` for detailed credits about each file +This mod contains the API only for adding your own mobs into the world, so please use the additional modpacks to add animals, monsters etc. -## Licensing -* Media: MIT, CC0, CC BY 3.0 CC BY-SA 4.0, LGPLv2.1, GPLv3. See `LICENSE-MEDIA.md` for details -* License of mobs_mc code: GPLv3 -* Mobs Redo: See `LICENSE-API.txt` +https://forum.minetest.net/viewtopic.php?f=11&t=9917 -### Links +------------ +Credits: -* [`mobs_mc`](https://github.com/maikerumine/mobs_mc) -* [Blender models](https://github.com/22i/minecraft-voxel-blender-models) -* [How to recreate mobs from textures with Blender and Gimp](http://imgur.com/a/Iqg88) +mcl_mobs_mob_poof.ogg: +- by Planman (license: Creative Commons Zero) +- Source: + +------------ + +Changelog from original Mobs Redo mod: +- 1.41- Mob pathfinding has been updated thanks to Elkien3 +- 1.40- Updated to use newer functions, requires Minetest 0.4.16+ to work. +- 1.39- Added 'on_breed', 'on_grown' and 'do_punch' custom functions per mob +- 1.38- Better entity checking, nametag setting and on_spawn function added to mob registry, tweaked light damage +- 1.37- Added support for Raymoo's CMI (common mob interface) mod: https://forum.minetest.net/viewtopic.php?f=9&t=15448 +- 1.36- Death check added, if mob dies in fire/lava/with lava pick then drops are cooked +- 1.35- Added owner_loyal flag for owned mobs to attack player enemies, also fixed group_attack +- 1.34- Added function to fly mob using directional movement (thanks D00Med for flying code) +- 1.33- Added functions to mount ride mobs (mobs.attach, mobs.detach, mobs.drive) many thanks to Blert2112 +- 1.32- Added new spawn check to count specific mobs AND new minetest.conf setting to chance spawn chance and numbers, added ability to protect tamed mobs +- 1.31- Added 'attack_animals' and 'specific_attack' flags for custom monster attacks, also 'mob_difficulty' .conf setting to make mobs harder. +- 1.30- Added support for invisibility mod (mobs cant attack what they cant see), tweaked and tidied code +- 1.29- Split original Mobs Redo into a modpack to make it easier to disable mob sets (animal, monster, npc) or simply use the Api itself for your own mod +- 1.28- New damage system added with ability for mob to be immune to weapons or healed by them :) +- 1.27- Added new sheep, lava flan and spawn egg textures. New Lava Pick tool smelts what you dig. New atan checking function. +- 1.26- Pathfinding feature added thanks to rnd, when monsters attack they become scary smart in finding you :) also, beehive produces honey now :) +- 1.25- Mobs no longer spawn within 12 blocks of player or despawn within same range, spawners now have player detection, Code tidy and tweak. +- 1.24- Added feature where certain animals run away when punched (runaway = true in mob definition) +- 1.23- Added mob spawner block for admin to setup spawners in-game (place and right click to enter settings) +- 1.22- Added ability to name tamed animals and npc using nametags, also npc will attack anyone who punches them apart from owner +- 1.21- Added some more error checking to reduce serialize.h error and added height checks for falling off cliffs (thanks cmdskp) +- 1.20- Error checking added to remove bad mobs, out of map limit mobs and stop serialize.h error +- 1.19- Chickens now drop egg items instead of placing the egg, also throwing eggs result in 1/8 chance of spawning chick +- 1.18- Added docile_by_day flag so that monsters will not attack automatically during daylight hours unless hit first +- 1.17- Added 'dogshoot' attack type, shoots when out of reach, melee attack when in reach, also api tweaks and self.reach added +- 1.16- Mobs follow multiple items now, Npc's can breed +- 1.15- Added Feeding/Taming/Breeding function, right-click to pick up any sheep with X mark on them and replace with new one to fix compatibility. +- 1.14- All .self variables saved in staticdata, Fixed self.health bug +- 1.13- Added capture function (thanks blert2112) chance of picking up mob with hand; net; magic lasso, replaced some .x models with newer .b3d one's +- 1.12- Added animal ownership so that players cannot steal your tamed animals +- 1.11- Added flying mobs (and swimming), fly=true and fly_in="air" or "deafult:water_source" for fishy +- 1,10- Footstep removed (use replace), explosion routine added for exploding mobs. +- 1.09- reworked breeding routine, added mob rotation value, added footstep feature, added jumping mobs with sounds feature, added magic lasso for picking up animals +- 1.08- Mob throwing attack has been rehauled so that they can damage one another, also drops and on_die function added +- 1.07- Npc's can now be set to follow player or stand by using self.order and self.owner variables +- beta- Npc mob added, kills monsters, attacks player when punched, right click with food to heal or gold lump for drop +- 1.06- Changed recovery times after breeding, and time taken to grow up (can be sped up by feeding baby animal) +- 1.05- Added ExeterDad's bunny's which can be picked up and tamed with 4 carrots from farming redo or farming_plus, also shears added to get wool from sheep and lastly Jordach/BSD's kitten +- 1.04- Added mating for sheep, cows and hogs... feed animals to make horny and hope for a baby which is half size, will grow up quick though :) +- 1.03- Added mob drop/replace feature so that chickens can drop eggs, cow/sheep can eat grass/wheat etc. +- 1.02- Sheared sheep are remembered and spawn shaven, Warthogs will attack when threatened, Api additions +- 1.01- Mobs that suffer fall damage or die in water/lava/sunlight will now drop items +- 1.0 - more work on Api so that certain mobs can float in water while some sink like a brick :) +- 0.9 - Spawn eggs added for all mobs (admin only, cannot be placed in protected areas)... Api tweaked +- 0.8 - Added sounds to monster mobs (thanks Cyberpangolin for the sfx) and also chicken sound +- 0.7 - mobs.protected switch added to api.lua, when set to 1 mobs no longer spawn in protected areas, also bug fixes +- 0.6 - Api now supports multi-textured mobs, e.g oerkki, dungeon master, rats and chickens have random skins when spawning (sheep fix TODO), also new Honey block +- 0.5 - Mobs now float in water, die from falling, and some code improvements +- 0.4 - Dungeon Masters and Mese Monsters have much better aim due to shoot_offset, also they can both shoot through nodes that aren't walkable (flowers, grass etc) plus new sheep sound :) +- 0.3 - Added LOTT's Spider mob, made Cobwebs, added KPavel's Bee with Honey and Beehives (made texture), Warthogs now have sound and can be tamed, taming of shaved sheep or milked cow with 8 wheat so it will not despawn, many bug fixes :) +- 0.2 - Cooking bucket of milk into cheese now returns empty bucket +- 0.1 - Initial Release diff --git a/mods/ENTITIES/mcl_mobs/api.old.lua b/mods/ENTITIES/mcl_mobs/api.old.lua index 76c062a40..48233d0b4 100644 --- a/mods/ENTITIES/mcl_mobs/api.old.lua +++ b/mods/ENTITIES/mcl_mobs/api.old.lua @@ -1,4 +1,7 @@ -local disable_physics = function(object, luaentity, ignore_check, reset_movement) +local math = math +local vector = vector + +local function disable_physics(object, luaentity, ignore_check, reset_movement) if luaentity.physical_state == true or ignore_check == true then luaentity.physical_state = false object:set_properties({ @@ -12,7 +15,7 @@ local disable_physics = function(object, luaentity, ignore_check, reset_movement end ----For Water Flowing: -local enable_physics = function(object, luaentity, ignore_check) +local function enable_physics(object, luaentity, ignore_check) if luaentity.physical_state == false or ignore_check == true then luaentity.physical_state = true object:set_properties({ @@ -272,7 +275,7 @@ local falling = function(self, pos) self.object:set_acceleration({ x = 0, - y = -self.fall_speed / (math_max(1, v.y) ^ 2), + y = -self.fall_speed / (math.max(1, v.y) ^ 2), z = 0 }) end @@ -503,9 +506,9 @@ local follow_flop = function(self) if sdef and sdef.walkable then mob_sound(self, "flop") self.object:set_velocity({ - x = math_random(-FLOP_HOR_SPEED, FLOP_HOR_SPEED), + x = math.random(-FLOP_HOR_SPEED, FLOP_HOR_SPEED), y = FLOP_HEIGHT, - z = math_random(-FLOP_HOR_SPEED, FLOP_HOR_SPEED), + z = math.random(-FLOP_HOR_SPEED, FLOP_HOR_SPEED), }) end @@ -987,7 +990,7 @@ local check_for_death = function(self, cause, cmi_cause) item_drop(self, cooked, looting) if mod_experience and ((not self.child) or self.type ~= "animal") and (minetest_get_us_time() - self.xp_timestamp <= 5000000) then - mcl_experience.throw_experience(self.object:get_pos(), math_random(self.xp_min, self.xp_max)) + mcl_experience.throw_experience(self.object:get_pos(), math.random(self.xp_min, self.xp_max)) end end end @@ -1361,7 +1364,7 @@ local do_attack = function(self, player) self.state = "attack" -- TODO: Implement war_cry sound without being annoying - --if math_random(0, 100) < 90 then + --if math.random(0, 100) < 90 then --mob_sound(self, "war_cry", true) --end end @@ -1396,7 +1399,7 @@ local mob_sound = function(self, soundname, is_opinion, fixed_pitch) pitch = base_pitch end -- randomize the pitch a bit - pitch = pitch + math_random(-10, 10) * 0.005 + pitch = pitch + math.random(-10, 10) * 0.005 end minetest_sound_play(sound, { object = self.object, @@ -1699,7 +1702,7 @@ local do_env_damage = function(self) end if drowning then - self.breath = math_max(0, self.breath - 1) + self.breath = math.max(0, self.breath - 1) effect(pos, 2, "bubble.png", nil, nil, 1, nil) if self.breath <= 0 then @@ -2044,7 +2047,7 @@ local breed = function(self) -- Give XP if mod_experience then - mcl_experience.throw_experience(pos, math_random(1, 7)) + mcl_experience.throw_experience(pos, math.random(1, 7)) end -- custom breed function @@ -2061,7 +2064,7 @@ local breed = function(self) -- Use texture of one of the parents - local p = math_random(1, 2) + local p = math.random(1, 2) if p == 1 then ent_c.base_texture = parent1.base_texture else @@ -2091,7 +2094,7 @@ local replace = function(self, pos) or not self.replace_what or self.child == true or self.object:get_velocity().y ~= 0 - or math_random(1, self.replace_rate) > 1 then + or math.random(1, self.replace_rate) > 1 then return end @@ -2099,7 +2102,7 @@ local replace = function(self, pos) if type(self.replace_what[1]) == "table" then - local num = math_random(#self.replace_what) + local num = math.random(#self.replace_what) what = self.replace_what[num][1] or "" with = self.replace_what[num][2] or "" @@ -2163,7 +2166,7 @@ function do_states(self) if self.state == "stand" then - if math_random(1, 4) == 1 then + if math.random(1, 4) == 1 then local lp = nil local s = self.object:get_pos() @@ -2189,7 +2192,7 @@ function do_states(self) if lp.x > s.x then yaw = yaw + math_pi end else - yaw = yaw + math_random(-0.5, 0.5) + yaw = yaw + math.random(-0.5, 0.5) end yaw = set_yaw(self, yaw, 8) @@ -2204,7 +2207,7 @@ function do_states(self) if self.walk_chance ~= 0 and self.facing_fence ~= true - and math_random(1, 100) <= self.walk_chance + and math.random(1, 100) <= self.walk_chance and is_at_cliff_or_danger(self) == false then set_velocity(self, self.walk_velocity) @@ -2254,7 +2257,7 @@ function do_states(self) {x = s.x + 5, y = s.y + 1, z = s.z + 5}, {"group:solid"}) - lp = #lp > 0 and lp[math_random(#lp)] + lp = #lp > 0 and lp[math.random(#lp)] -- did we find land? if lp then @@ -2280,8 +2283,8 @@ function do_states(self) else -- Randomly turn - if math_random(1, 100) <= 30 then - yaw = yaw + math_random(-0.5, 0.5) + if math.random(1, 100) <= 30 then + yaw = yaw + math.random(-0.5, 0.5) yaw = set_yaw(self, yaw, 8) end end @@ -2289,9 +2292,9 @@ function do_states(self) yaw = set_yaw(self, yaw, 8) -- otherwise randomly turn - elseif math_random(1, 100) <= 30 then + elseif math.random(1, 100) <= 30 then - yaw = yaw + math_random(-0.5, 0.5) + yaw = yaw + math.random(-0.5, 0.5) yaw = set_yaw(self, yaw, 8) end @@ -2302,7 +2305,7 @@ function do_states(self) end if self.facing_fence == true or cliff_or_danger - or math_random(1, 100) <= 30 then + or math.random(1, 100) <= 30 then set_velocity(self, 0) self.state = "stand" @@ -2602,7 +2605,7 @@ function do_states(self) self.timer = 0 if self.double_melee_attack - and math_random(1, 2) == 1 then + and math.random(1, 2) == 1 then set_animation(self, "punch2") else set_animation(self, "punch") @@ -2669,7 +2672,7 @@ function do_states(self) if self.shoot_interval and self.timer > self.shoot_interval and not minetest_raycast(p, self.attack:get_pos(), false, false):next() - and math_random(1, 100) <= 60 then + and math.random(1, 100) <= 60 then self.timer = 0 set_animation(self, "shoot") @@ -2759,7 +2762,7 @@ end -- Code to execute before custom on_rightclick handling -local on_rightclick_prefix = function(self, clicker) +local function on_rightclick_prefix(self, clicker) local item = clicker:get_wielded_item() -- Name mob with nametag @@ -2785,17 +2788,17 @@ local on_rightclick_prefix = function(self, clicker) return false end -local create_mob_on_rightclick = function(on_rightclick) +--[[local function create_mob_on_rightclick(on_rightclick) return function(self, clicker) local stop = on_rightclick_prefix(self, clicker) if (not stop) and (on_rightclick) then on_rightclick(self, clicker) end end -end +end]] -- set and return valid yaw -local set_yaw = function(self, yaw, delay, dtime) +local function set_yaw(self, yaw, delay, dtime) if not yaw or yaw ~= yaw then yaw = 0 @@ -2805,7 +2808,7 @@ local set_yaw = function(self, yaw, delay, dtime) if delay == 0 then if self.shaking and dtime then - yaw = yaw + (math_random() * 2 - 1) * 5 * dtime + yaw = yaw + (math.random() * 2 - 1) * 5 * dtime end self.yaw(yaw) update_roll(self) @@ -2825,8 +2828,7 @@ function mobs:yaw(self, yaw, delay, dtime) end -mob_step = function() - +--mob_step = function() --if self.state == "die" then -- print("need custom die stop moving thing") -- return @@ -2901,7 +2903,7 @@ mob_step = function() --end -- mob plays random sound at times - --if math_random(1, 70) == 1 then + --if math.random(1, 70) == 1 then -- mob_sound(self, "random", true) --end @@ -2934,11 +2936,11 @@ mob_step = function() --if is_at_water_danger(self) and self.state ~= "attack" then - -- if math_random(1, 10) <= 6 then + -- if math.random(1, 10) <= 6 then -- set_velocity(self, 0) -- self.state = "stand" -- set_animation(self, "stand") - -- yaw = yaw + math_random(-0.5, 0.5) + -- yaw = yaw + math.random(-0.5, 0.5) -- yaw = set_yaw(self, yaw, 8) -- end --end @@ -2982,7 +2984,7 @@ mob_step = function() mcl_burning.extinguish(self.object) self.object:remove() elseif self.lifetimer <= 10 then - if math_random(10) < 4 then + if math.random(10) < 4 then self.despawn_immediately = true else self.lifetimer = 20 @@ -2991,4 +2993,4 @@ mob_step = function() end ]]-- -end +--end diff --git a/mods/ENTITIES/mcl_mobs/api/flow_lib.lua b/mods/ENTITIES/mcl_mobs/api/flow_lib.lua new file mode 100644 index 000000000..aa64bfb4e --- /dev/null +++ b/mods/ENTITIES/mcl_mobs/api/flow_lib.lua @@ -0,0 +1,78 @@ +--this is from https://github.com/HybridDog/builtin_item/blob/e6dfd9dce86503b3cbd1474257eca5f6f6ca71c2/init.lua#L50 +local +minetest,vector,math,pairs,minetest_get_node,vector_subtract,minetest_registered_nodes += +minetest,vector,math,pairs,minetest.get_node,vector.subtract,minetest.registered_nodes + +local tab +local n +local function get_nodes(pos) + tab,n = {},1 + for i = -1,1,2 do + for _,p in pairs({ + {x=pos.x+i, y=pos.y, z=pos.z}, + {x=pos.x, y=pos.y, z=pos.z+i} + }) do + tab[n] = {p, minetest_get_node(p)} + n = n+1 + end + end + return tab +end + + +local data +local param2 +local nd +local par2 +local name +local tmp +local c_node +function mobs.get_flowing_dir(pos) + c_node = minetest_get_node(pos).name + if c_node ~= "mcl_core:water_flowing" and c_node ~= "mcl_core:water" then + return nil + end + data = get_nodes(pos) + param2 = minetest_get_node(pos).param2 + if param2 > 7 then + return nil + end + if c_node == "mcl_core:water" then + for _,i in pairs(data) do + nd = i[2] + name = nd.name + par2 = nd.param2 + if name == "mcl_core:water_flowing" and par2 == 7 then + return(vector_subtract(i[1],pos)) + end + end + end + for _,i in pairs(data) do + nd = i[2] + name = nd.name + par2 = nd.param2 + if name == "mcl_core:water_flowing" and par2 < param2 then + return(vector_subtract(i[1],pos)) + end + end + for _,i in pairs(data) do + nd = i[2] + name = nd.name + par2 = nd.param2 + if name == "mcl_core:water_flowing" and par2 >= 11 then + return(vector_subtract(i[1],pos)) + end + end + for _,i in pairs(data) do + nd = i[2] + name = nd.name + par2 = nd.param2 + tmp = minetest_registered_nodes[name] + if tmp and not tmp.walkable and name ~= "mcl_core:water_flowing" and name ~= "mcl_core:water" then + return(vector_subtract(i[1],pos)) + end + end + + return nil +end diff --git a/mods/ENTITIES/mcl_mobs/locale/mcl_mobs.pl.tr b/mods/ENTITIES/mcl_mobs/locale/mcl_mobs.pl.tr new file mode 100644 index 000000000..fb21fa34e --- /dev/null +++ b/mods/ENTITIES/mcl_mobs/locale/mcl_mobs.pl.tr @@ -0,0 +1,85 @@ +# textdomain: mcl_mobs +Peaceful mode active! No monsters will spawn.=Tryb pokojowy aktywowany! Potwory nie będą się pojawiać. +This allows you to place a single mob.=To pozwala na przywołanie jednego moba. +Just place it where you want the mob to appear. Animals will spawn tamed, unless you hold down the sneak key while placing. If you place this on a mob spawner, you change the mob it spawns.=Postaw to w miejscu w którym chcesz aby pojawił się mob. Zwierzęta pojawią się jako oswojone chyba, że będziesz się skradał podczas stawiania. Jeśli postawisz to na spawnerze to zmienisz którego moba przywołuje. +You need the “maphack” privilege to change the mob spawner.=Potrzebujesz przywileju "maphack", aby zmienić spawner. +Name Tag=Znacznik +A name tag is an item to name a mob.=Znacznik jest przedmiotem pozwalającym nazwać moba. +Before you use the name tag, you need to set a name at an anvil. Then you can use the name tag to name a mob. This uses up the name tag.=Zanim użyjesz znacznika musisz wybrać imię przy kowadle. Następnie możesz użyć znacznika by nazwać moba. To zużywa znacznik. +Only peaceful mobs allowed!=Tylko pokojowe moby są dozwolone! +Give names to mobs=Nazwij moby +Set name at anvil=Wybierz imię przy kowadle +Totem of Undying=Token nieśmiertelności +A totem of undying is a rare artifact which may safe you from certain death.=Totem nieśmiertelności to rzadki artefakt, który może uchronić cię przed pewną śmiercią. +The totem only works while you hold it in your hand. If you receive fatal damage, you are saved from death and you get a second chance with 1 HP. The totem is destroyed in the process, however.=Totem działa tylko kiedy trzymasz go w dłoni. Jeśli otrzymasz obrażenia od upadku zostaniesz oszczędzony i pozostanie ci 1 HP, jednak totem zostanie wtedy zniszczony. +Iron Horse Armor=Żelazna zbroja dla konia +Iron horse armor can be worn by horses to increase their protection from harm a bit.=Żelazna zbroja dla konia może być noszona przez konie aby nieco zwiększyć ich odporność na obrażenia. +Golden Horse Armor=Złota zbroja dla konia +Golden horse armor can be worn by horses to increase their protection from harm.=Złota zbroja dla konia może być noszona przez konie aby zwiększyć ich odporność na obrażenia. +Diamond Horse Armor=Diamentowa zbroja dla konia +Diamond horse armor can be worn by horses to greatly increase their protection from harm.=Diamentowa zbroja dla konia może być noszona przez konie aby istotnie zwiększyć ich odporność na obrażenia. +Place it on a horse to put on the horse armor. Donkeys and mules can't wear horse armor.=Połóż ją na koniu aby założyć zbroję dla konia. Osły i muły nie mogą nosić zbroi dla konia. +Farmer=Rolnik +Fisherman=Rybak +Fletcher=Łuczarz +Shepherd=Pasterz +Librarian=Bibliotekarz +Cartographer=Kartograf +Armorer=Płatnerz +Leatherworker=Rymarz +Butcher=Rzeźnik +Weapon Smith=Zbrojmistrz +Tool Smith=Narzędziarz +Cleric=Kapłan +Nitwit=Głupiec +Protects you from death while wielding it=Chroni przed śmiercią gdy go trzymasz +Agent=Agent +Bat=Nietoperz +Blaze=Płomyk +Chicken=Kurczak +Cow=Krowa +Mooshroom=Muuuchomor +Creeper=Creeper +Ender Dragon=Smok kresu +Enderman=Enderman +Endermite=Endermit +Ghast=Ghast +Elder Guardian=Prastrażnik +Guardian=Strażnik +Horse=Koń +Skeleton Horse=Koń szkielet +Zombie Horse=Koń zombie +Donkey=Osioł +Mule=Muł +Iron Golem=Żelazny golem +Llama=Lama +Ocelot=Ocelot +Parrot=Papuga +Pig=Świnia +Polar Bear=Niedźwiedź polarny +Rabbit=Królik +Killer Bunny=Królik zabójca +Sheep=Owca +Shulker=Shulker +Silverfish=Rybik cukrowy +Skeleton=Szkielet +Stray=Tułacz +Wither Skeleton=Witherowy szkielet +Magma Cube=Kostka magmy +Slime=Szlam +Snow Golem=Śnieżny golem +Spider=Pająk +Cave Spider=Pająk jaskiniowy +Squid=Kałamarnica +Vex=Dręczyciel +Evoker=Przywoływacz +Illusioner=Iluzjonista +Villager=Osadnik +Vindicator=Obrońca +Zombie Villager=Osadnik zombie +Witch=Wiedźma +Wither=Wither +Wolf=Wilk +Husk=Posuch +Zombie=Zombie +Zombie Pigman=Świniak zombie diff --git a/mods/ENTITIES/mcl_mobs/locale/template.txt b/mods/ENTITIES/mcl_mobs/locale/template.txt index 81cf581d7..b8c26922c 100644 --- a/mods/ENTITIES/mcl_mobs/locale/template.txt +++ b/mods/ENTITIES/mcl_mobs/locale/template.txt @@ -29,6 +29,7 @@ Pig= Polar Bear= Rabbit= Killer Bunny= +The Killer Bunny= Sheep= Shulker= Silverfish= diff --git a/mods/ENTITIES/mcl_mobs/mobs/0_gameconfig.lua b/mods/ENTITIES/mcl_mobs/mobs/0_gameconfig.lua index 9bea74e15..8e946c237 100644 --- a/mods/ENTITIES/mcl_mobs/mobs/0_gameconfig.lua +++ b/mods/ENTITIES/mcl_mobs/mobs/0_gameconfig.lua @@ -388,14 +388,14 @@ end mobs_mc.override.enderman_block_texture_overrides = { ["mcl_core:cactus"] = ctable, -- FIXME: replace colorize colors with colors from palette - ["mcl_core:dirt_with_grass"] = - { - "mcl_core_grass_block_top.png^[colorize:green:90", - "default_dirt.png", - "default_dirt.png^(mcl_core_grass_block_side_overlay.png^[colorize:green:90)", - "default_dirt.png^(mcl_core_grass_block_side_overlay.png^[colorize:green:90)", - "default_dirt.png^(mcl_core_grass_block_side_overlay.png^[colorize:green:90)", - "default_dirt.png^(mcl_core_grass_block_side_overlay.png^[colorize:green:90)"} + ["mcl_core:dirt_with_grass"] = { + "mcl_core_grass_block_top.png^[colorize:green:90", + "default_dirt.png", + "default_dirt.png^(mcl_core_grass_block_side_overlay.png^[colorize:green:90)", + "default_dirt.png^(mcl_core_grass_block_side_overlay.png^[colorize:green:90)", + "default_dirt.png^(mcl_core_grass_block_side_overlay.png^[colorize:green:90)", + "default_dirt.png^(mcl_core_grass_block_side_overlay.png^[colorize:green:90)", + }, } -- List of nodes on which mobs can spawn diff --git a/mods/ENTITIES/mcl_mobs/mobs/2_throwing.lua b/mods/ENTITIES/mcl_mobs/mobs/2_throwing.lua index f72acaf36..1b0b5d032 100644 --- a/mods/ENTITIES/mcl_mobs/mobs/2_throwing.lua +++ b/mods/ENTITIES/mcl_mobs/mobs/2_throwing.lua @@ -6,7 +6,7 @@ -- NOTE: Strings intentionally not marked for translation, other mods already have these items. -- TODO: Remove this file eventually, all items here are already outsourced in other mods. -local S = minetest.get_translator("mobs_mc") +--local S = minetest.get_translator(minetest.get_current_modname()) --maikerumines throwing code --arrow (weapon) @@ -83,7 +83,7 @@ THROWING_ARROW_ENTITY.on_step = function(self, dtime) if self.timer>0.2 then local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 1.5) for k, obj in pairs(objs) do - if obj:get_luaentity() ~= nil then + if obj:get_luaentity() then if obj:get_luaentity().name ~= "mobs_mc:arrow_entity" and obj:get_luaentity().name ~= "__builtin:item" then local damage = 3 minetest.sound_play("damage", {pos = pos}, true) @@ -108,7 +108,7 @@ THROWING_ARROW_ENTITY.on_step = function(self, dtime) if self.lastpos.x~=nil then if node.name ~= "air" then minetest.sound_play("bowhit1", {pos = pos}, true) - minetest.add_item(self.lastpos, 'mobs_mc:arrow') + minetest.add_item(self.lastpos, "mobs_mc:arrow") self.object:remove() end end @@ -155,7 +155,7 @@ end if c("arrow") and c("flint") and c("feather") and c("stick") then minetest.register_craft({ - output = 'mobs_mc:arrow 4', + output = "mobs_mc:arrow 4", recipe = { {mobs_mc.items.flint}, {mobs_mc.items.stick}, @@ -181,11 +181,11 @@ if c("bow") then }) minetest.register_craft({ - output = 'mobs_mc:bow_wood', + output = "mobs_mc:bow_wood", recipe = { - {mobs_mc.items.string, mobs_mc.items.stick, ''}, - {mobs_mc.items.string, '', mobs_mc.items.stick}, - {mobs_mc.items.string, mobs_mc.items.stick, ''}, + {mobs_mc.items.string, mobs_mc.items.stick, ""}, + {mobs_mc.items.string, "", mobs_mc.items.stick}, + {mobs_mc.items.string, mobs_mc.items.stick, ""}, } }) end @@ -259,7 +259,7 @@ if c("egg") then }) -- shoot egg - local mobs_shoot_egg = function (item, player, pointed_thing) + local function mobs_shoot_egg(item, player, pointed_thing) local playerpos = player:get_pos() @@ -349,7 +349,7 @@ mobs:register_arrow("mobs_mc:snowball_entity", { if c("snowball") then -- shoot snowball - local mobs_shoot_snowball = function (item, player, pointed_thing) + local function mobs_shoot_snowball(item, player, pointed_thing) local playerpos = player:get_pos() diff --git a/mods/ENTITIES/mcl_mobs/mobs/bat.lua b/mods/ENTITIES/mcl_mobs/mobs/bat.lua index 3f645a5e5..38c381fe6 100644 --- a/mods/ENTITIES/mcl_mobs/mobs/bat.lua +++ b/mods/ENTITIES/mcl_mobs/mobs/bat.lua @@ -1,5 +1,5 @@ --License for code WTFPL and otherwise stated in readmes -local S = minetest.get_translator("mcl_mobs") +local S = minetest.get_translator(minetest.get_current_modname()) mcl_mobs.register_mob("mcl_mobs:bat", { description = S("Bat"), diff --git a/mods/ENTITIES/mcl_mobs/mobs/blaze.lua b/mods/ENTITIES/mcl_mobs/mobs/blaze.lua index c62fcdfdf..3d47fa1bf 100644 --- a/mods/ENTITIES/mcl_mobs/mobs/blaze.lua +++ b/mods/ENTITIES/mcl_mobs/mobs/blaze.lua @@ -1,8 +1,13 @@ -- daufinsyd -- My work is under the LGPL terms --- Model and mcl_mobs_blaze.png see https://github.com/22i/minecraft-voxel-blender-models -hi 22i ~jordan4ibanez --- blaze.lua partial copy of ghast.lua -local S = minetest.get_translator("mcl_mobs") +-- Model and mobs_blaze.png see https://github.com/22i/minecraft-voxel-blender-models -hi 22i ~jordan4ibanez +-- blaze.lua partial copy of mobs_mc/ghast.lua + +local S = minetest.get_translator(minetest.get_current_modname()) + +--################### +--################### BLAZE +--################### local smokedef = mcl_particles.get_smoke_def({ amount = 0.009, @@ -25,7 +30,7 @@ mcl_mobs.register_mob("mcl_mobs:blaze", { xp_max = 10, tilt_fly = false, hostile = true, - rotate = 270, + --rotate = 270, collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.79, 0.3}, rotate = -180, model = "mcl_mobs_blaze.b3d", diff --git a/mods/ENTITIES/mcl_mobs/mobs/chicken.lua b/mods/ENTITIES/mcl_mobs/mobs/chicken.lua index 9146a012f..ffaebca2b 100644 --- a/mods/ENTITIES/mcl_mobs/mobs/chicken.lua +++ b/mods/ENTITIES/mcl_mobs/mobs/chicken.lua @@ -1,6 +1,6 @@ --License for code WTFPL and otherwise stated in readmes -local S = minetest.get_translator("mobs_mc") +local S = minetest.get_translator(minetest.get_current_modname()) --################### --################### CHICKEN diff --git a/mods/ENTITIES/mcl_mobs/mobs/cow.lua b/mods/ENTITIES/mcl_mobs/mobs/cow.lua index 0d6d31ffe..17c4e1e62 100644 --- a/mods/ENTITIES/mcl_mobs/mobs/cow.lua +++ b/mods/ENTITIES/mcl_mobs/mobs/cow.lua @@ -1,6 +1,6 @@ --License for code WTFPL and otherwise stated in readmes -local S = minetest.get_translator("mobs_mc") +local S = minetest.get_translator(minetest.get_current_modname()) local cow_def = { description = S("Cow"), @@ -89,7 +89,7 @@ local cow_def = { --head code has_head = true, head_bone = "head", - + swap_y_with_x = false, reverse_head_yaw = false, @@ -168,7 +168,7 @@ mooshroom_def.on_rightclick = function(self, clicker) pos.y = pos.y + 0.5 minetest.add_item(pos, {name = mobs_mc.items.mushroom_stew}) end - end + end end mobs:register_mob("mobs_mc:mooshroom", mooshroom_def) diff --git a/mods/ENTITIES/mcl_mobs/mobs/creeper.lua b/mods/ENTITIES/mcl_mobs/mobs/creeper.lua index dc64ce7a6..eaee65c89 100644 --- a/mods/ENTITIES/mcl_mobs/mobs/creeper.lua +++ b/mods/ENTITIES/mcl_mobs/mobs/creeper.lua @@ -1,6 +1,6 @@ --License for code WTFPL and otherwise stated in readmes -local S = minetest.get_translator("mobs_mc") +local S = minetest.get_translator(minetest.get_current_modname()) --################### --################### CREEPER @@ -69,7 +69,7 @@ local creeper = { -- TODO: Make creeper flash after doing this as well. -- TODO: Test and debug this code. on_rightclick = function(self, clicker) - if self._forced_explosion_countdown_timer ~= nil then + if self._forced_explosion_countdown_timer then return end local item = clicker:get_wielded_item() @@ -89,7 +89,7 @@ local creeper = { end end, do_custom = function(self, dtime) - if self._forced_explosion_countdown_timer ~= nil then + if self._forced_explosion_countdown_timer then self._forced_explosion_countdown_timer = self._forced_explosion_countdown_timer - dtime if self._forced_explosion_countdown_timer <= 0 then mobs:boom(self, mcl_util.get_object_center(self.object), self.explosion_strength) @@ -139,8 +139,108 @@ local creeper = { floats = 1, fear_height = 4, view_range = 16, +<<<<<<< HEAD:mods/ENTITIES/mcl_mobs/mobs/creeper.lua } mobs:register_mob("mobs_mc:creeper", creeper) +======= +}) + +mobs:register_mob("mobs_mc:creeper_charged", { + description = S("Charged Creeper"), + type = "monster", + spawn_class = "hostile", + hp_min = 20, + hp_max = 20, + xp_min = 5, + xp_max = 5, + collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.69, 0.3}, + pathfinding = 1, + visual = "mesh", + mesh = "mobs_mc_creeper.b3d", + + --BOOM + + textures = { + {"mobs_mc_creeper.png", + "mobs_mc_creeper_charge.png"}, + }, + visual_size = {x=3, y=3}, + rotate = 270, + sounds = { + attack = "tnt_ignite", + death = "mobs_mc_creeper_death", + damage = "mobs_mc_creeper_hurt", + fuse = "tnt_ignite", + explode = "tnt_explode", + distance = 16, + }, + makes_footstep_sound = false, + walk_velocity = 1.05, + run_velocity = 2.1, + runaway_from = { "mobs_mc:ocelot", "mobs_mc:cat" }, + attack_type = "explode", + + explosion_strength = 6, + --explosion_radius = 3, + --explosion_damage_radius = 6, + --explosiontimer_reset_radius = 3, + reach = 1.5, + defuse_reach = 4, + explosion_timer = 0.3, + allow_fuse_reset = true, + stop_to_explode = true, + + -- Force-ignite creeper with flint and steel and explode after 1.5 seconds. + -- TODO: Make creeper flash after doing this as well. + -- TODO: Test and debug this code. + on_rightclick = function(self, clicker) + if self._forced_explosion_countdown_timer then + return + end + local item = clicker:get_wielded_item() + if item:get_name() == mobs_mc.items.flint_and_steel then + if not minetest.is_creative_enabled(clicker:get_player_name()) then + -- Wear tool + local wdef = item:get_definition() + item:add_wear(1000) + -- Tool break sound + if item:get_count() == 0 and wdef.sound and wdef.sound.breaks then + minetest.sound_play(wdef.sound.breaks, {pos = clicker:get_pos(), gain = 0.5}, true) + end + clicker:set_wielded_item(item) + end + self._forced_explosion_countdown_timer = self.explosion_timer + minetest.sound_play(self.sounds.attack, {pos = self.object:get_pos(), gain = 1, max_hear_distance = 16}, true) + end + end, + do_custom = function(self, dtime) + if self._forced_explosion_countdown_timer then + self._forced_explosion_countdown_timer = self._forced_explosion_countdown_timer - dtime + if self._forced_explosion_countdown_timer <= 0 then + mobs:boom(self, mcl_util.get_object_center(self.object), self.explosion_strength) + end + end + end, + on_die = function(self, pos, cmi_cause) + -- Drop a random music disc when killed by skeleton or stray + if cmi_cause and cmi_cause.type == "punch" then + local luaentity = cmi_cause.puncher and cmi_cause.puncher:get_luaentity() + if luaentity and luaentity.name:find("arrow") then + local shooter_luaentity = luaentity._shooter and luaentity._shooter:get_luaentity() + if shooter_luaentity and (shooter_luaentity.name == "mobs_mc:skeleton" or shooter_luaentity.name == "mobs_mc:stray") then + minetest.add_item({x=pos.x, y=pos.y+1, z=pos.z}, mobs_mc.items.music_discs[math.random(1, #mobs_mc.items.music_discs)]) + end + end + end + end, + maxdrops = 2, + drops = { + {name = mobs_mc.items.gunpowder, + chance = 1, + min = 0, + max = 2, + looting = "common",}, +>>>>>>> master:mods/ENTITIES/mobs_mc/creeper.lua local creeper_charged = table.copy(creeper) creeper_charged.description = S("Charged Creeper") diff --git a/mods/ENTITIES/mcl_mobs/mobs/elder_guardian.lua b/mods/ENTITIES/mcl_mobs/mobs/elder_guardian.lua index 4fb989e2f..2bb0e984a 100644 --- a/mods/ENTITIES/mcl_mobs/mobs/elder_guardian.lua +++ b/mods/ENTITIES/mcl_mobs/mobs/elder_guardian.lua @@ -4,7 +4,7 @@ --################### GUARDIAN --################### -local S = minetest.get_translator("mobs_mc") +local S = minetest.get_translator(minetest.get_current_modname()) mobs:register_mob("mobs_mc:guardian_elder", { description = S("Elder Guardian"), @@ -15,7 +15,7 @@ mobs:register_mob("mobs_mc:guardian_elder", { xp_min = 10, xp_max = 10, breath_max = -1, - passive = false, + passive = false, attack_type = "punch", pathfinding = 1, view_range = 16, @@ -104,7 +104,6 @@ mobs:register_mob("mobs_mc:guardian_elder", { makes_footstep_sound = false, fly_in = { mobs_mc.items.water_source, mobs_mc.items.river_water_source }, jump = false, - view_range = 16, }) -- Spawning disabled due to size issues <- what do you mean? -j4i diff --git a/mods/ENTITIES/mcl_mobs/mobs/ender_dragon.lua b/mods/ENTITIES/mcl_mobs/mobs/ender_dragon.lua index 2111105d3..bafb3f84a 100644 --- a/mods/ENTITIES/mcl_mobs/mobs/ender_dragon.lua +++ b/mods/ENTITIES/mcl_mobs/mobs/ender_dragon.lua @@ -2,7 +2,7 @@ --################### ENDERDRAGON --################### -local S = minetest.get_translator("mobs_mc") +local S = minetest.get_translator(minetest.get_current_modname()) mobs:register_mob("mobs_mc:enderdragon", { description = S("Ender Dragon"), @@ -16,7 +16,7 @@ mobs:register_mob("mobs_mc:enderdragon", { shoot_arrow = function(self, pos, dir) -- 2-4 damage per arrow local dmg = math.random(2,4) - mobs.shoot_projectile_handling("mobs_mc:dragon_fireball", pos, dir, self.object:get_yaw(), self.object, nil, dmg) + mobs.shoot_projectile_handling("mobs_mc:dragon_fireball", pos, dir, self.object:get_yaw(), self.object, nil, dmg) end, hp_max = 200, hp_min = 200, @@ -24,7 +24,6 @@ mobs:register_mob("mobs_mc:enderdragon", { xp_max = 500, collisionbox = {-2, 0, -2, 2, 2, 2}, eye_height = 1, - physical = false, visual = "mesh", mesh = "mobs_mc_dragon.b3d", textures = { @@ -60,8 +59,6 @@ mobs:register_mob("mobs_mc:enderdragon", { arrow = "mobs_mc:dragon_fireball", shoot_interval = 0.5, shoot_offset = -1.0, - xp_min = 500, - xp_max = 500, animation = { fly_speed = 8, stand_speed = 8, stand_start = 0, stand_end = 20, @@ -114,8 +111,8 @@ mobs:register_mob("mobs_mc:enderdragon", { fire_resistant = true, }) - -local mobs_griefing = minetest.settings:get_bool("mobs_griefing") ~= false +--TODO: replace this setting by a proper gamerules system +local mobs_griefing = minetest.settings:get_bool("mobs_griefing", true) -- dragon fireball (projectile) mobs:register_arrow("mobs_mc:dragon_fireball", { @@ -143,7 +140,9 @@ mobs:register_arrow("mobs_mc:dragon_fireball", { -- node hit, explode hit_node = function(self, pos, node) --mobs:boom(self, pos, 2) - mcl_explosions.explode(self.object:get_pos(), 2,{ drop_chance = 1.0 }) + if mobs_griefing then + mcl_explosions.explode(self.object:get_pos(), 2, { drop_chance = 1.0 }) + end end }) diff --git a/mods/ENTITIES/mcl_mobs/mobs/enderman.lua b/mods/ENTITIES/mcl_mobs/mobs/enderman.lua index ebd017f30..c77fc4267 100644 --- a/mods/ENTITIES/mcl_mobs/mobs/enderman.lua +++ b/mods/ENTITIES/mcl_mobs/mobs/enderman.lua @@ -24,9 +24,11 @@ -- added rain damage. -- fixed the grass_with_dirt issue. -local S = minetest.get_translator("mobs_mc") +local S = minetest.get_translator(minetest.get_current_modname()) -local telesound = function(pos, is_source) +local vector = vector + +local function telesound(pos, is_source) local snd if is_source then snd = "mobs_mc_enderman_teleport_src" @@ -302,7 +304,7 @@ mobs:register_mob("mobs_mc:enderman", { if self.attacking then local target = self.attacking local pos = target:get_pos() - if pos ~= nil then + if pos then if vector.distance(self.object:get_pos(), target:get_pos()) > 10 then self:teleport(target) end @@ -318,12 +320,12 @@ mobs:register_mob("mobs_mc:enderman", { for n = 1, #objs do local obj = objs[n] if obj then - if minetest.is_player(obj) then + --if minetest.is_player(obj) then -- Warp from players during day. --if (minetest.get_timeofday() * 24000) > 5001 and (minetest.get_timeofday() * 24000) < 19000 then -- self:teleport(nil) --end - else + if not obj:is_player() then local lua = obj:get_luaentity() if lua then if lua.name == "mcl_bows:arrow_entity" or lua.name == "mcl_throwing:snowball_entity" then @@ -341,8 +343,8 @@ mobs:register_mob("mobs_mc:enderman", { -- self:teleport(nil) -- self.state = "" --else - if self.attack ~= nil and not minetest.settings:get_bool("creative_mode") then - self.state = 'attack' + if self.attack and not minetest.settings:get_bool("creative_mode") then + self.state = "attack" end --end end @@ -459,7 +461,7 @@ mobs:register_mob("mobs_mc:enderman", { end end end - elseif self._taken_node ~= nil and self._taken_node ~= "" and self._take_place_timer >= self._next_take_place_time then + elseif self._taken_node and self._taken_node ~= "" and self._take_place_timer >= self._next_take_place_time then -- Place taken node self._take_place_timer = 0 self._next_take_place_time = math.random(take_frequency_min, take_frequency_max) @@ -485,12 +487,12 @@ mobs:register_mob("mobs_mc:enderman", { end end, do_teleport = function(self, target) - if target ~= nil then + if target then local target_pos = target:get_pos() -- Find all solid nodes below air in a 10×10×10 cuboid centered on the target local nodes = minetest.find_nodes_in_area_under_air(vector.subtract(target_pos, 5), vector.add(target_pos, 5), {"group:solid", "group:cracky", "group:crumbly"}) local telepos - if nodes ~= nil then + if nodes then if #nodes > 0 then -- Up to 64 attempts to teleport for n=1, math.min(64, #nodes) do @@ -525,7 +527,7 @@ mobs:register_mob("mobs_mc:enderman", { -- We need to add (or subtract) different random numbers to each vector component, so it couldn't be done with a nice single vector.add() or .subtract(): local randomCube = vector.new( pos.x + 8*(pr:next(0,16)-8), pos.y + 8*(pr:next(0,16)-8), pos.z + 8*(pr:next(0,16)-8) ) local nodes = minetest.find_nodes_in_area_under_air(vector.subtract(randomCube, 4), vector.add(randomCube, 4), {"group:solid", "group:cracky", "group:crumbly"}) - if nodes ~= nil then + if nodes then if #nodes > 0 then -- Up to 8 low-level (in total up to 8*8 = 64) attempts to teleport for n=1, math.min(8, #nodes) do @@ -557,13 +559,13 @@ mobs:register_mob("mobs_mc:enderman", { end, on_die = function(self, pos) -- Drop carried node on death - if self._taken_node ~= nil and self._taken_node ~= "" then + if self._taken_node and self._taken_node ~= "" then minetest.add_item(pos, self._taken_node) end end, do_punch = function(self, hitter, tflp, tool_caps, dir) -- damage from rain caused by itself so we don't want it to attack itself. - if hitter ~= self.object and hitter ~= nil then + if hitter ~= self.object and hitter then --if (minetest.get_timeofday() * 24000) > 5001 and (minetest.get_timeofday() * 24000) < 19000 then -- self:teleport(nil) --else diff --git a/mods/ENTITIES/mcl_mobs/mobs/endermite.lua b/mods/ENTITIES/mcl_mobs/mobs/endermite.lua index 712086828..29a887c06 100644 --- a/mods/ENTITIES/mcl_mobs/mobs/endermite.lua +++ b/mods/ENTITIES/mcl_mobs/mobs/endermite.lua @@ -2,7 +2,7 @@ --################### ENDERMITE --################### -local S = minetest.get_translator("mobs_mc") +local S = minetest.get_translator(minetest.get_current_modname()) mobs:register_mob("mobs_mc:endermite", { description = S("Endermite"), diff --git a/mods/ENTITIES/mcl_mobs/mobs/evoker.lua b/mods/ENTITIES/mcl_mobs/mobs/evoker.lua index f87483e2b..030da5470 100644 --- a/mods/ENTITIES/mcl_mobs/mobs/evoker.lua +++ b/mods/ENTITIES/mcl_mobs/mobs/evoker.lua @@ -3,7 +3,7 @@ --made for MC like Survival game --License for code WTFPL and otherwise stated in readmes -local S = minetest.get_translator("mobs_mc") +local S = minetest.get_translator(minetest.get_current_modname()) --################### --################### EVOKER diff --git a/mods/ENTITIES/mcl_mobs/mobs/ghast.lua b/mods/ENTITIES/mcl_mobs/mobs/ghast.lua index 74bbe1270..236d0f894 100644 --- a/mods/ENTITIES/mcl_mobs/mobs/ghast.lua +++ b/mods/ENTITIES/mcl_mobs/mobs/ghast.lua @@ -3,7 +3,7 @@ --made for MC like Survival game --License for code WTFPL and otherwise stated in readmes -local S = minetest.get_translator("mobs_mc") +local S = minetest.get_translator(minetest.get_current_modname()) --################### --################### GHAST diff --git a/mods/ENTITIES/mcl_mobs/mobs/guardian.lua b/mods/ENTITIES/mcl_mobs/mobs/guardian.lua index 241ac3444..3e1a4f853 100644 --- a/mods/ENTITIES/mcl_mobs/mobs/guardian.lua +++ b/mods/ENTITIES/mcl_mobs/mobs/guardian.lua @@ -2,7 +2,7 @@ --################### GUARDIAN --################### -local S = minetest.get_translator("mobs_mc") +local S = minetest.get_translator(minetest.get_current_modname()) mobs:register_mob("mobs_mc:guardian", { description = S("Guardian"), @@ -13,7 +13,7 @@ mobs:register_mob("mobs_mc:guardian", { xp_min = 10, xp_max = 10, breath_max = -1, - passive = false, + passive = false, attack_type = "punch", pathfinding = 1, view_range = 16, @@ -94,7 +94,6 @@ mobs:register_mob("mobs_mc:guardian", { makes_footstep_sound = false, fly_in = { mobs_mc.items.water_source, mobs_mc.items.river_water_source }, jump = false, - view_range = 16, }) -- Spawning disabled due to size issues diff --git a/mods/ENTITIES/mcl_mobs/mobs/horse.lua b/mods/ENTITIES/mcl_mobs/mobs/horse.lua index ad50ae4d4..bd8e9dd9f 100644 --- a/mods/ENTITIES/mcl_mobs/mobs/horse.lua +++ b/mods/ENTITIES/mcl_mobs/mobs/horse.lua @@ -3,7 +3,7 @@ --made for MC like Survival game --License for code WTFPL and otherwise stated in readmes -local S = minetest.get_translator("mobs_mc") +local S = minetest.get_translator(minetest.get_current_modname()) --################### --################### HORSE @@ -38,9 +38,9 @@ end local can_equip_horse_armor = function(entity_id) return entity_id == "mobs_mc:horse" or entity_id == "mobs_mc:skeleton_horse" or entity_id == "mobs_mc:zombie_horse" end -local can_equip_chest = function(entity_id) +--[[local can_equip_chest = function(entity_id) return entity_id == "mobs_mc:mule" or entity_id == "mobs_mc:donkey" -end +end]] local can_breed = function(entity_id) return entity_id == "mobs_mc:horse" or "mobs_mc:mule" or entity_id == "mobs_mc:donkey" end @@ -313,7 +313,7 @@ local horse = { -- Make sure tamed horse is mature and being clicked by owner only if self.tamed and not self.child and self.owner == clicker:get_player_name() then - local inv = clicker:get_inventory() + --local inv = clicker:get_inventory() -- detatch player already riding horse if self.driver and clicker == self.driver then diff --git a/mods/ENTITIES/mcl_mobs/mobs/illusioner.lua b/mods/ENTITIES/mcl_mobs/mobs/illusioner.lua index 46b8760a1..bec5762e5 100644 --- a/mods/ENTITIES/mcl_mobs/mobs/illusioner.lua +++ b/mods/ENTITIES/mcl_mobs/mobs/illusioner.lua @@ -3,8 +3,8 @@ --made for MC like Survival game --License for code WTFPL and otherwise stated in readmes -local S = minetest.get_translator("mobs_mc") -local mod_bows = minetest.get_modpath("mcl_bows") ~= nil +local S = minetest.get_translator(minetest.get_current_modname()) +local mod_bows = minetest.get_modpath("mcl_bows") mobs:register_mob("mobs_mc:illusioner", { description = S("Illusioner"), diff --git a/mods/ENTITIES/mcl_mobs/mobs/iron_golem.lua b/mods/ENTITIES/mcl_mobs/mobs/iron_golem.lua index 48e573e13..939412abb 100644 --- a/mods/ENTITIES/mcl_mobs/mobs/iron_golem.lua +++ b/mods/ENTITIES/mcl_mobs/mobs/iron_golem.lua @@ -3,7 +3,7 @@ --made for MC like Survival game --License for code WTFPL and otherwise stated in readmes -local S = minetest.get_translator("mobs_mc") +local S = minetest.get_translator(minetest.get_current_modname()) --################### --################### IRON GOLEM @@ -18,7 +18,7 @@ mobs:register_mob("mobs_mc:iron_golem", { passive = true, rotate = 270, hp_min = 100, - hp_max = 100, + hp_max = 100, protect = true, neutral = true, breath_max = -1, @@ -158,11 +158,11 @@ mobs_mc.tools.check_iron_golem_summon = function(pos) if ok then -- Remove the nodes minetest.remove_node(pos) - core.check_for_falling(pos) + minetest.check_for_falling(pos) for i=1, 4 do local cpos = vector.add(pos, checks[c][i]) minetest.remove_node(cpos) - core.check_for_falling(cpos) + minetest.check_for_falling(cpos) end -- Summon iron golem local place diff --git a/mods/ENTITIES/mcl_mobs/mobs/llama.lua b/mods/ENTITIES/mcl_mobs/mobs/llama.lua index 55d9c2781..ec2f10c31 100644 --- a/mods/ENTITIES/mcl_mobs/mobs/llama.lua +++ b/mods/ENTITIES/mcl_mobs/mobs/llama.lua @@ -1,4 +1,4 @@ -local S = minetest.get_translator("mobs_mc") +local S = minetest.get_translator(minetest.get_current_modname()) --################### --################### LLAMA @@ -306,9 +306,9 @@ mobs:register_arrow("mobs_mc:spit", { tail_distance_divider = 4, hit_player = function(self, player) - if rawget(_G, "armor") and armor.last_damage_types then + --[[if rawget(_G, "armor") and armor.last_damage_types then armor.last_damage_types[player:get_player_name()] = "spit" - end + end]] player:punch(self.object, 1.0, { full_punch_interval = 1.0, damage_groups = {fleshy = self._damage}, @@ -318,7 +318,7 @@ mobs:register_arrow("mobs_mc:spit", { hit_mob = function(self, mob) mob:punch(self.object, 1.0, { full_punch_interval = 1.0, - damage_groups = {fleshy = _damage}, + damage_groups = {fleshy = self._damage}, }, nil) end, diff --git a/mods/ENTITIES/mcl_mobs/mobs/ocelot.lua b/mods/ENTITIES/mcl_mobs/mobs/ocelot.lua index e36abec77..aea543895 100644 --- a/mods/ENTITIES/mcl_mobs/mobs/ocelot.lua +++ b/mods/ENTITIES/mcl_mobs/mobs/ocelot.lua @@ -3,7 +3,7 @@ --made for MC like Survival game --License for code WTFPL and otherwise stated in readmes -local S = minetest.get_translator("mobs_mc") +local S = minetest.get_translator(minetest.get_current_modname()) --################### --################### OCELOT AND CAT @@ -151,7 +151,7 @@ end mobs:register_mob("mobs_mc:cat", cat) -local base_spawn_chance = 5000 +--local base_spawn_chance = 5000 -- Spawn ocelot --they get the same as the llama because I'm trying to rework so much of this code right now -j4i diff --git a/mods/ENTITIES/mcl_mobs/mobs/parrot.lua b/mods/ENTITIES/mcl_mobs/mobs/parrot.lua index ecfb0bfb4..ccc7ee45b 100644 --- a/mods/ENTITIES/mcl_mobs/mobs/parrot.lua +++ b/mods/ENTITIES/mcl_mobs/mobs/parrot.lua @@ -3,7 +3,7 @@ --made for MC like Survival game --License for code WTFPL and otherwise stated in readmes -local S = minetest.get_translator("mobs_mc") +local S = minetest.get_translator(minetest.get_current_modname()) --################### --################### PARROT @@ -44,7 +44,7 @@ mobs:register_mob("mobs_mc:parrot", { max = 2, looting = "common",}, }, - animation = { + animation = { stand_speed = 50, walk_speed = 50, fly_speed = 50, diff --git a/mods/ENTITIES/mcl_mobs/mobs/pig.lua b/mods/ENTITIES/mcl_mobs/mobs/pig.lua index a91f29eb0..8666cdbf4 100644 --- a/mods/ENTITIES/mcl_mobs/mobs/pig.lua +++ b/mods/ENTITIES/mcl_mobs/mobs/pig.lua @@ -1,6 +1,6 @@ --License for code WTFPL and otherwise stated in readmes -local S = minetest.get_translator("mobs_mc") +local S = minetest.get_translator(minetest.get_current_modname()) mobs:register_mob("mobs_mc:pig", { description = S("Pig"), @@ -162,7 +162,7 @@ mobs:register_mob("mobs_mc:pig", { end -- Mount or detach player - local name = clicker:get_player_name() + --local name = clicker:get_player_name() if self.driver and clicker == self.driver then -- Detach if already attached mobs.detach(clicker, {x=1, y=0, z=0}) diff --git a/mods/ENTITIES/mcl_mobs/mobs/polar_bear.lua b/mods/ENTITIES/mcl_mobs/mobs/polar_bear.lua index 0476229b5..0f5296d35 100644 --- a/mods/ENTITIES/mcl_mobs/mobs/polar_bear.lua +++ b/mods/ENTITIES/mcl_mobs/mobs/polar_bear.lua @@ -1,6 +1,6 @@ --License for code WTFPL and otherwise stated in readmes -local S = minetest.get_translator("mobs_mc") +local S = minetest.get_translator(minetest.get_current_modname()) --################### --################### POLARBEAR diff --git a/mods/ENTITIES/mcl_mobs/mobs/rabbit.lua b/mods/ENTITIES/mcl_mobs/mobs/rabbit.lua index d31c70662..0e4d3a085 100644 --- a/mods/ENTITIES/mcl_mobs/mobs/rabbit.lua +++ b/mods/ENTITIES/mcl_mobs/mobs/rabbit.lua @@ -1,6 +1,6 @@ --License for code WTFPL and otherwise stated in readmes -local S = minetest.get_translator("mobs_mc") +local S = minetest.get_translator(minetest.get_current_modname()) local rabbit = { description = S("Rabbit"), @@ -233,4 +233,4 @@ mobs:spawn(spawn_grass) mobs:register_egg("mobs_mc:rabbit", S("Rabbit"), "mobs_mc_spawn_icon_rabbit.png", 0) -- Note: This spawn egg does not exist in Minecraft -mobs:register_egg("mobs_mc:killer_bunny", S("Killer Bunny"), "mobs_mc_spawn_icon_rabbit.png^[colorize:#FF0000:192", 0) -- TODO: Update inventory image +mobs:register_egg("mobs_mc:killer_bunny", S("Killer Bunny"), "mobs_mc_spawn_icon_rabbit_caerbannog.png", 0) diff --git a/mods/ENTITIES/mcl_mobs/mobs/sheep.lua b/mods/ENTITIES/mcl_mobs/mobs/sheep.lua index 046a7f021..132f9bbea 100644 --- a/mods/ENTITIES/mcl_mobs/mobs/sheep.lua +++ b/mods/ENTITIES/mcl_mobs/mobs/sheep.lua @@ -1,6 +1,6 @@ --License for code WTFPL and otherwise stated in readmes -local S = minetest.get_translator("mobs_mc") +local S = minetest.get_translator(minetest.get_current_modname()) --################### --################### SHEEP @@ -142,7 +142,6 @@ mobs:register_mob("mobs_mc:sheep", { do_custom = function(self, dtime) if not self.initial_color_set then local r = math.random(0,100000) - local textures if r <= 81836 then -- 81.836% self.color = "unicolor_white" diff --git a/mods/ENTITIES/mcl_mobs/mobs/shulker.lua b/mods/ENTITIES/mcl_mobs/mobs/shulker.lua index 718d72491..a25888954 100644 --- a/mods/ENTITIES/mcl_mobs/mobs/shulker.lua +++ b/mods/ENTITIES/mcl_mobs/mobs/shulker.lua @@ -3,7 +3,7 @@ --made for MC like Survival game --License for code WTFPL and otherwise stated in readmes -local S = minetest.get_translator("mobs_mc") +local S = minetest.get_translator(minetest.get_current_modname()) --################### --################### SHULKER diff --git a/mods/ENTITIES/mcl_mobs/mobs/silverfish.lua b/mods/ENTITIES/mcl_mobs/mobs/silverfish.lua index 148c4c722..ac3991ad1 100644 --- a/mods/ENTITIES/mcl_mobs/mobs/silverfish.lua +++ b/mods/ENTITIES/mcl_mobs/mobs/silverfish.lua @@ -2,7 +2,7 @@ --################### SILVERFISH --################### -local S = minetest.get_translator("mobs_mc") +local S = minetest.get_translator(minetest.get_current_modname()) mobs:register_mob("mobs_mc:silverfish", { description = S("Silverfish"), @@ -46,7 +46,6 @@ mobs:register_mob("mobs_mc:silverfish", { view_range = 16, attack_type = "punch", damage = 1, - reach = 1, }) mobs:register_egg("mobs_mc:silverfish", S("Silverfish"), "mobs_mc_spawn_icon_silverfish.png", 0) @@ -62,7 +61,7 @@ if minetest.get_modpath("default") and mobs_mc.create_monster_egg_nodes then description = "Stone Monster Egg", tiles = {"default_stone.png"}, groups = {oddly_breakable_by_hand = 2, spawns_silverfish = 1}, - drop = '', + drop = "", is_ground_content = true, sounds = default.node_sound_stone_defaults(), after_dig_node = spawn_silverfish, @@ -73,7 +72,7 @@ if minetest.get_modpath("default") and mobs_mc.create_monster_egg_nodes then tiles = {"default_cobble.png"}, is_ground_content = false, groups = {oddly_breakable_by_hand = 2, spawns_silverfish = 1}, - drop = '', + drop = "", sounds = default.node_sound_stone_defaults(), after_dig_node = spawn_silverfish, }) @@ -83,7 +82,7 @@ if minetest.get_modpath("default") and mobs_mc.create_monster_egg_nodes then tiles = {"default_mossycobble.png"}, is_ground_content = false, groups = {oddly_breakable_by_hand = 2, spawns_silverfish = 1}, - drop = '', + drop = "", sounds = default.node_sound_stone_defaults(), after_dig_node = spawn_silverfish, }) @@ -95,7 +94,7 @@ if minetest.get_modpath("default") and mobs_mc.create_monster_egg_nodes then tiles = {"default_stone_brick.png"}, is_ground_content = false, groups = {oddly_breakable_by_hand = 2, spawns_silverfish = 1}, - drop = '', + drop = "", sounds = default.node_sound_stone_defaults(), after_dig_node = spawn_silverfish, }) @@ -105,7 +104,7 @@ if minetest.get_modpath("default") and mobs_mc.create_monster_egg_nodes then tiles = {"default_stone_block.png"}, is_ground_content = false, groups = {oddly_breakable_by_hand = 2, spawns_silverfish = 1}, - drop = '', + drop = "", sounds = default.node_sound_stone_defaults(), after_dig_node = spawn_silverfish, }) diff --git a/mods/ENTITIES/mcl_mobs/mobs/skeleton.lua b/mods/ENTITIES/mcl_mobs/mobs/skeleton.lua index 69362061b..355910c1e 100644 --- a/mods/ENTITIES/mcl_mobs/mobs/skeleton.lua +++ b/mods/ENTITIES/mcl_mobs/mobs/skeleton.lua @@ -3,8 +3,8 @@ --made for MC like Survival game --License for code WTFPL and otherwise stated in readmes -local S = minetest.get_translator("mobs_mc") -local mod_bows = minetest.get_modpath("mcl_bows") ~= nil +local S = minetest.get_translator(minetest.get_current_modname()) +local mod_bows = minetest.get_modpath("mcl_bows") --################### --################### SKELETON @@ -31,12 +31,8 @@ local skeleton = { group_attack = true, visual = "mesh", mesh = "mobs_mc_skeleton.b3d", - textures = { { - "mcl_bows_bow_0.png", -- bow - "mobs_mc_skeleton.png", -- skeleton - } }, - --head code + --head code has_head = false, head_bone = "head", diff --git a/mods/ENTITIES/mcl_mobs/mobs/slime.lua b/mods/ENTITIES/mcl_mobs/mobs/slime.lua index 3494e1b3f..a938e1000 100644 --- a/mods/ENTITIES/mcl_mobs/mobs/slime.lua +++ b/mods/ENTITIES/mcl_mobs/mobs/slime.lua @@ -1,6 +1,6 @@ --License for code WTFPL and otherwise stated in readmes -local S = minetest.get_translator("mobs_mc") +local S = minetest.get_translator(minetest.get_current_modname()) -- Returns a function that spawns children in a circle around pos. -- To be used as on_die callback. @@ -41,10 +41,10 @@ local spawn_children_on_die = function(child_mob, children_count, spawn_distance -- If mother was murdered, children attack the killer after 1 second if self.state == "attack" then minetest.after(1.0, function(children, enemy) - for c=1, #children do + for c = 1, #children do local child = children[c] local le = child:get_luaentity() - if le ~= nil then + if le then le.state = "attack" le.attack = enemy end diff --git a/mods/ENTITIES/mcl_mobs/mobs/snowman.lua b/mods/ENTITIES/mcl_mobs/mobs/snowman.lua index 93f91c330..0726b8da0 100644 --- a/mods/ENTITIES/mcl_mobs/mobs/snowman.lua +++ b/mods/ENTITIES/mcl_mobs/mobs/snowman.lua @@ -3,12 +3,12 @@ --made for MC like Survival game --License for code WTFPL and otherwise stated in readmes -local S = minetest.get_translator("mobs_mc") +local S = minetest.get_translator(minetest.get_current_modname()) local snow_trail_frequency = 0.5 -- Time in seconds for checking to add a new snow trail local mobs_griefing = minetest.settings:get_bool("mobs_griefing") ~= false -local mod_throwing = minetest.get_modpath("mcl_throwing") ~= nil +local mod_throwing = minetest.get_modpath("mcl_throwing") local gotten_texture = { "mobs_mc_snowman.png", @@ -179,9 +179,9 @@ mobs_mc.tools.check_snow_golem_summon = function(pos) minetest.remove_node(pos) minetest.remove_node(b1) minetest.remove_node(b2) - core.check_for_falling(pos) - core.check_for_falling(b1) - core.check_for_falling(b2) + minetest.check_for_falling(pos) + minetest.check_for_falling(b1) + minetest.check_for_falling(b2) local obj = minetest.add_entity(place, "mobs_mc:snowman") if obj then summon_particles(obj) diff --git a/mods/ENTITIES/mcl_mobs/mobs/spider.lua b/mods/ENTITIES/mcl_mobs/mobs/spider.lua index 6ade915ab..e1be9c3ed 100644 --- a/mods/ENTITIES/mcl_mobs/mobs/spider.lua +++ b/mods/ENTITIES/mcl_mobs/mobs/spider.lua @@ -3,7 +3,7 @@ --made for MC like Survival game --License for code WTFPL and otherwise stated in readmes -local S = minetest.get_translator("mobs_mc") +local S = minetest.get_translator(minetest.get_current_modname()) --################### --################### SPIDER diff --git a/mods/ENTITIES/mcl_mobs/mobs/squid.lua b/mods/ENTITIES/mcl_mobs/mobs/squid.lua index 4fbd4f93b..69f42ffa6 100644 --- a/mods/ENTITIES/mcl_mobs/mobs/squid.lua +++ b/mods/ENTITIES/mcl_mobs/mobs/squid.lua @@ -4,7 +4,7 @@ --################### SQUID --################### -local S = minetest.get_translator("mobs_mc") +local S = minetest.get_translator(minetest.get_current_modname()) mobs:register_mob("mobs_mc:squid", { description = S("Squid"), diff --git a/mods/ENTITIES/mcl_mobs/mobs/vex.lua b/mods/ENTITIES/mcl_mobs/mobs/vex.lua index c23643cda..22f1e70d2 100644 --- a/mods/ENTITIES/mcl_mobs/mobs/vex.lua +++ b/mods/ENTITIES/mcl_mobs/mobs/vex.lua @@ -3,7 +3,7 @@ --made for MC like Survival game --License for code WTFPL and otherwise stated in readmes -local S = minetest.get_translator("mobs_mc") +local S = minetest.get_translator(minetest.get_current_modname()) --################### --################### VEX @@ -15,7 +15,7 @@ mobs:register_mob("mobs_mc:vex", { spawn_class = "hostile", pathfinding = 1, passive = false, - attack_type = "punch", + attack_type = "dogfight", physical = false, hp_min = 14, hp_max = 14, @@ -36,7 +36,6 @@ mobs:register_mob("mobs_mc:vex", { view_range = 16, walk_velocity = 3.2, run_velocity = 5.9, - attack_type = "dogfight", sounds = { -- TODO: random death = "mobs_mc_vex_death", diff --git a/mods/ENTITIES/mcl_mobs/mobs/villager.lua b/mods/ENTITIES/mcl_mobs/mobs/villager.lua index 4e4b40553..06cec9ed6 100644 --- a/mods/ENTITIES/mcl_mobs/mobs/villager.lua +++ b/mods/ENTITIES/mcl_mobs/mobs/villager.lua @@ -19,7 +19,7 @@ -- TODO: Internal inventory, pick up items, trade with other villagers -- TODO: Farm stuff -local S = minetest.get_translator("mobs_mc") +local S = minetest.get_translator(minetest.get_current_modname()) local N = function(s) return s end local F = minetest.formspec_escape diff --git a/mods/ENTITIES/mcl_mobs/mobs/vindicator.lua b/mods/ENTITIES/mcl_mobs/mobs/vindicator.lua index 7df54ef58..6a6999b96 100644 --- a/mods/ENTITIES/mcl_mobs/mobs/vindicator.lua +++ b/mods/ENTITIES/mcl_mobs/mobs/vindicator.lua @@ -3,7 +3,7 @@ --made for MC like Survival game --License for code WTFPL and otherwise stated in readmes -local S = minetest.get_translator("mobs_mc") +local S = minetest.get_translator(minetest.get_current_modname()) --################### --################### VINDICATOR diff --git a/mods/ENTITIES/mcl_mobs/mobs/witch.lua b/mods/ENTITIES/mcl_mobs/mobs/witch.lua index 0c72d0018..34492a1b7 100644 --- a/mods/ENTITIES/mcl_mobs/mobs/witch.lua +++ b/mods/ENTITIES/mcl_mobs/mobs/witch.lua @@ -3,7 +3,7 @@ --made for MC like Survival game --License for code WTFPL and otherwise stated in readmes -local S = minetest.get_translator("mobs_mc") +local S = minetest.get_translator(minetest.get_current_modname()) --################### --################### WITCH diff --git a/mods/ENTITIES/mcl_mobs/mobs/wither.lua b/mods/ENTITIES/mcl_mobs/mobs/wither.lua index 491639149..6489d351c 100644 --- a/mods/ENTITIES/mcl_mobs/mobs/wither.lua +++ b/mods/ENTITIES/mcl_mobs/mobs/wither.lua @@ -3,7 +3,7 @@ --made for MC like Survival game --License for code WTFPL and otherwise stated in readmes -local S = minetest.get_translator("mobs_mc") +local S = minetest.get_translator(minetest.get_current_modname()) --################### --################### WITHER @@ -26,7 +26,6 @@ mobs:register_mob("mobs_mc:wither", { {"mobs_mc_wither.png"}, }, visual_size = {x=4, y=4}, - makes_footstep_sound = true, view_range = 16, fear_height = 4, walk_velocity = 2, @@ -80,7 +79,7 @@ mobs:register_mob("mobs_mc:wither", { end, }) -local mobs_griefing = minetest.settings:get_bool("mobs_griefing") ~= false +--local mobs_griefing = minetest.settings:get_bool("mobs_griefing") ~= false mobs:register_arrow("mobs_mc:wither_skull", { visual = "sprite", diff --git a/mods/ENTITIES/mcl_mobs/mobs/wither_skeleton.lua b/mods/ENTITIES/mcl_mobs/mobs/wither_skeleton.lua index 13e6b678f..25b32788c 100644 --- a/mods/ENTITIES/mcl_mobs/mobs/wither_skeleton.lua +++ b/mods/ENTITIES/mcl_mobs/mobs/wither_skeleton.lua @@ -3,7 +3,7 @@ --made for MC like Survival game --License for code WTFPL and otherwise stated in readmes -local S = minetest.get_translator("mobs_mc") +local S = minetest.get_translator(minetest.get_current_modname()) --################### --################### WITHER SKELETON diff --git a/mods/ENTITIES/mcl_mobs/mobs/wolf.lua b/mods/ENTITIES/mcl_mobs/mobs/wolf.lua index 89a4b4629..0b685d40f 100644 --- a/mods/ENTITIES/mcl_mobs/mobs/wolf.lua +++ b/mods/ENTITIES/mcl_mobs/mobs/wolf.lua @@ -1,6 +1,6 @@ --License for code WTFPL and otherwise stated in readmes -local S = minetest.get_translator("mobs_mc") +local S = minetest.get_translator(minetest.get_current_modname()) local default_walk_chance = 50 @@ -35,7 +35,7 @@ local wolf = { --head code has_head = false, head_bone = "head", - + swap_y_with_x = false, reverse_head_yaw = false, @@ -186,7 +186,7 @@ dog.on_rightclick = function(self, clicker) if is_food(item:get_name()) then -- Feed to increase health local hp = self.health - local hp_add = 0 + local hp_add -- Use eatable group to determine health boost local eatable = minetest.get_item_group(item, "eatable") if eatable > 0 then diff --git a/mods/ENTITIES/mcl_mobs/mobs/zombie.lua b/mods/ENTITIES/mcl_mobs/mobs/zombie.lua index 0ca9df172..2104a06e8 100644 --- a/mods/ENTITIES/mcl_mobs/mobs/zombie.lua +++ b/mods/ENTITIES/mcl_mobs/mobs/zombie.lua @@ -3,7 +3,7 @@ --made for MC like Survival game --License for code WTFPL and otherwise stated in readmes -local S = minetest.get_translator("mobs_mc") +local S = minetest.get_translator(minetest.get_current_modname()) --################### --################### ZOMBIE diff --git a/mods/ENTITIES/mcl_mobs/mobs/zombie_pigman.lua b/mods/ENTITIES/mcl_mobs/mobs/zombie_pigman.lua index 094a647ee..b637eb22e 100644 --- a/mods/ENTITIES/mcl_mobs/mobs/zombie_pigman.lua +++ b/mods/ENTITIES/mcl_mobs/mobs/zombie_pigman.lua @@ -3,7 +3,7 @@ --made for MC like Survival game --License for code WTFPL and otherwise stated in readmes -local S = minetest.get_translator("mobs_mc") +local S = minetest.get_translator(minetest.get_current_modname()) --################### --################### ZOMBIE PIGMAN diff --git a/mods/ENTITIES/mcl_mobs/mobs/zombie_villager.lua b/mods/ENTITIES/mcl_mobs/mobs/zombie_villager.lua index e7200bcdc..d5c5db35a 100644 --- a/mods/ENTITIES/mcl_mobs/mobs/zombie_villager.lua +++ b/mods/ENTITIES/mcl_mobs/mobs/zombie_villager.lua @@ -3,7 +3,7 @@ --made for MC like Survival game --License for code WTFPL and otherwise stated in readmes -local S = minetest.get_translator("mobs_mc") +local S = minetest.get_translator(minetest.get_current_modname()) --################### --################### ZOMBIE VILLAGER diff --git a/mods/ENTITIES/mcl_mobs/textures/mcl_mobs_spawn_icon_rabbit_caerbannog.png b/mods/ENTITIES/mcl_mobs/textures/mcl_mobs_spawn_icon_rabbit_caerbannog.png new file mode 100644 index 000000000..4244a83c6 Binary files /dev/null and b/mods/ENTITIES/mcl_mobs/textures/mcl_mobs_spawn_icon_rabbit_caerbannog.png differ diff --git a/mods/ENTITIES/mcl_mount/init.lua b/mods/ENTITIES/mcl_mount/init.lua index 35ee34af4..5f049238d 100644 --- a/mods/ENTITIES/mcl_mount/init.lua +++ b/mods/ENTITIES/mcl_mount/init.lua @@ -34,7 +34,7 @@ function mcl_mount.mount(obj, parent, animation) obj:set_look_horizontal(parent:get_yaw()) mcl_mount.mounted[obj] = true mcl_player.player_set_animation(obj, animation or "sit", 30) - mcl_tmp_message.message(obj, S("Sneak to dismount")) + mcl_title.set(obj, "actionbar", {text = S("Sneak to dismount"), color = "white", stay = 60}) end mcl_mount.update_visual_size(obj) diff --git a/mods/ENTITIES/mcl_paintings/init.lua b/mods/ENTITIES/mcl_paintings/init.lua index cb85ee5f8..26bd2c61b 100644 --- a/mods/ENTITIES/mcl_paintings/init.lua +++ b/mods/ENTITIES/mcl_paintings/init.lua @@ -1,12 +1,15 @@ mcl_paintings = {} -dofile(minetest.get_modpath(minetest.get_current_modname()).."/paintings.lua") +local modname = minetest.get_current_modname() +dofile(minetest.get_modpath(modname).."/paintings.lua") -local S = minetest.get_translator("mcl_paintings") +local S = minetest.get_translator(modname) + +local math = math local wood = "[combine:16x16:-192,0=mcl_paintings_paintings.png" -local is_protected = function(pos, name) +local function is_protected(pos, name) if minetest.is_protected(pos, name) then minetest.record_protection_violation(pos, name) return true @@ -17,7 +20,7 @@ end -- Check if there's a painting for provided painting size. -- If yes, returns the arguments. -- If not, returns the next smaller available painting. -local shrink_painting = function(x, y) +local function shrink_painting(x, y) if x > 4 or y > 4 then return nil end @@ -43,7 +46,7 @@ local shrink_painting = function(x, y) end end -local get_painting = function(x, y, motive) +local function get_painting(x, y, motive) local painting = mcl_paintings.paintings[y] and mcl_paintings.paintings[y][x] and mcl_paintings.paintings[y][x][motive] if not painting then return nil @@ -53,7 +56,7 @@ local get_painting = function(x, y, motive) return "[combine:"..sx.."x"..sy..":"..px..","..py.."=mcl_paintings_paintings.png" end -local get_random_painting = function(x, y) +local function get_random_painting(x, y) if not mcl_paintings.paintings[y] or not mcl_paintings.paintings[y][x] then return nil end @@ -65,7 +68,7 @@ local get_random_painting = function(x, y) return get_painting(x, y, r), r end -local size_to_minmax = function(size) +--[[local function size_to_minmax(size) local min, max if size == 2 then min = -0.5 @@ -81,13 +84,13 @@ local size_to_minmax = function(size) max = 0.5 end return min, max -end +end]] -local size_to_minmax_entity = function(size) +local function size_to_minmax_entity(size) return -size/2, size/2 end -local set_entity = function(object) +local function set_entity(object) local ent = object:get_luaentity() local wallm = ent._facing local xsize = ent._xsize @@ -169,7 +172,7 @@ minetest.register_entity("mcl_paintings:painting", { on_punch = function(self, puncher, time_from_last_punch, tool_capabilities, dir, damage) -- Drop as item on punch if puncher and puncher:is_player() then - kname = puncher:get_player_name() + local kname = puncher:get_player_name() local pos = self._pos if not pos then pos = self.object:get_pos() diff --git a/mods/ENTITIES/mcl_paintings/locale/mcl_paintings.pl.tr b/mods/ENTITIES/mcl_paintings/locale/mcl_paintings.pl.tr new file mode 100644 index 000000000..473540dda --- /dev/null +++ b/mods/ENTITIES/mcl_paintings/locale/mcl_paintings.pl.tr @@ -0,0 +1,2 @@ +# textdomain:mcl_paintings +Painting=Obraz diff --git a/mods/ENTITIES/mcl_paintings/paintings.lua b/mods/ENTITIES/mcl_paintings/paintings.lua index d606306c2..ccf584364 100644 --- a/mods/ENTITIES/mcl_paintings/paintings.lua +++ b/mods/ENTITIES/mcl_paintings/paintings.lua @@ -3,7 +3,7 @@ local TS = 16 -- texture size mcl_paintings.paintings = { [1] = { [1] = { - { cx = 0, cy = 0 }, + { cx = 0, cy = 0 }, { cx = TS, cy = 0 }, { cx = 2*TS, cy = 0 }, { cx = 3*TS, cy = 0 }, @@ -26,7 +26,7 @@ mcl_paintings.paintings = { { cx = 0, cy = 4*TS }, { cx = TS, cy = 4*TS }, }, - [2] = { + [2] = { { cx = 0, cy = 8*TS }, { cx = 2*TS, cy = 8*TS }, { cx = 4*TS, cy = 8*TS }, @@ -35,7 +35,7 @@ mcl_paintings.paintings = { { cx = 10*TS, cy = 8*TS }, }, [3] = 2, - [4] = { + [4] = { { cx = 0, cy = 6*TS }, }, }, diff --git a/mods/ENVIRONMENT/lightning/API.md b/mods/ENVIRONMENT/lightning/API.md new file mode 100644 index 000000000..ad4f0a3b4 --- /dev/null +++ b/mods/ENVIRONMENT/lightning/API.md @@ -0,0 +1,31 @@ +# lightning +Lightning mod for MineClone2 with the following API: + +## lightning.register_on_strike(function(pos, pos2, objects)) +Custom function called when a lightning strikes. + +* `pos`: impact position +* `pos2`: rounded node position where fire is placed +* `objects`: table with ObjectRefs of all objects within a radius of 3.5 around pos2 + +## lightning.strike(pos) +Let a lightning strike. + +* `pos`: optional, if not given a random pos will be chosen +* `returns`: bool - success if a strike happened + + +### Examples: + +``` +lightning.register_on_strike(function(pos, pos2, objects) + for _, obj in pairs(objects) do + obj:remove() + end + minetest.add_entity(pos, "mobs_mc:sheep") +end) + +minetest.register_on_respawnplayer(function(player) + lightning.strike(player:get_pos()) +end) +``` \ No newline at end of file diff --git a/mods/ENVIRONMENT/lightning/init.lua b/mods/ENVIRONMENT/lightning/init.lua index 5d37a8168..abfab2487 100644 --- a/mods/ENVIRONMENT/lightning/init.lua +++ b/mods/ENVIRONMENT/lightning/init.lua @@ -1,6 +1,7 @@ --[[ Copyright (C) 2016 - Auke Kok +Adapted by MineClone2 contributors "lightning" is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -9,7 +10,7 @@ of the license, or (at your option) any later version. --]] -local S = minetest.get_translator("lightning") +local S = minetest.get_translator(minetest.get_current_modname()) local get_connected_players = minetest.get_connected_players local line_of_sight = minetest.line_of_sight @@ -22,22 +23,23 @@ local add_entity = minetest.add_entity local get_objects_inside_radius = minetest.get_objects_inside_radius local get_item_group = minetest.get_item_group -lightning = {} - -lightning.interval_low = 17 -lightning.interval_high = 503 -lightning.range_h = 100 -lightning.range_v = 50 -lightning.size = 100 --- disable this to stop lightning mod from striking -lightning.auto = true +lightning = { + interval_low = 17, + interval_high = 503, + range_h = 100, + range_v = 50, + size = 100, + -- disable this to stop lightning mod from striking + auto = true, + on_strike_functions = {}, +} local rng = PcgRandom(32321123312123) local ps = {} local ttl = -1 -local revertsky = function(dtime) +local function revertsky(dtime) if ttl == 0 then return end @@ -53,6 +55,18 @@ end minetest.register_globalstep(revertsky) +-- lightning strike API + +-- See API.md +--[[ + lightning.register_on_strike(function(pos, pos2, objects) + -- code + end) +]] +function lightning.register_on_strike(func) + table.insert(lightning.on_strike_functions, func) +end + -- select a random strike point, midpoint local function choose_pos(pos) if not pos then @@ -78,14 +92,14 @@ local function choose_pos(pos) pos.z = math.floor(pos.z - (lightning.range_h / 2) + rng:next(1, lightning.range_h)) end - local b, pos2 = line_of_sight(pos, {x = pos.x, y = pos.y - lightning.range_v, z = pos.z}, 1) + local b, pos2 = line_of_sight(pos, { x = pos.x, y = pos.y - lightning.range_v, z = pos.z }, 1) -- nothing but air found if b then return nil, nil end - local n = get_node({x = pos2.x, y = pos2.y - 1/2, z = pos2.z}) + local n = get_node({ x = pos2.x, y = pos2.y - 1/2, z = pos2.z }) if n.name == "air" or n.name == "ignore" then return nil, nil end @@ -93,10 +107,9 @@ local function choose_pos(pos) return pos, pos2 end --- lightning strike API -- * pos: optional, if not given a random pos will be chosen -- * returns: bool - success if a strike happened -lightning.strike = function(pos) +function lightning.strike(pos) if lightning.auto then after(rng:next(lightning.interval_low, lightning.interval_high), lightning.strike) end @@ -107,21 +120,28 @@ lightning.strike = function(pos) if not pos then return false end + local objects = get_objects_inside_radius(pos2, 3.5) + if lightning.on_strike_functions then + for _, func in pairs(lightning.on_strike_functions) do + func(pos, pos2, objects) + end + end +end +lightning.register_on_strike(function(pos, pos2, objects) + local particle_pos = vector.offset(pos2, 0, (lightning.size / 2) + 0.5, 0) + local particle_size = lightning.size * 10 + local time = 0.2 add_particlespawner({ amount = 1, - time = 0.2, + time = time, -- make it hit the top of a block exactly with the bottom - minpos = {x = pos2.x, y = pos2.y + (lightning.size / 2) + 1/2, z = pos2.z }, - maxpos = {x = pos2.x, y = pos2.y + (lightning.size / 2) + 1/2, z = pos2.z }, - minvel = {x = 0, y = 0, z = 0}, - maxvel = {x = 0, y = 0, z = 0}, - minacc = {x = 0, y = 0, z = 0}, - maxacc = {x = 0, y = 0, z = 0}, - minexptime = 0.2, - maxexptime = 0.2, - minsize = lightning.size * 10, - maxsize = lightning.size * 10, + minpos = particle_pos, + maxpos = particle_pos, + minexptime = time, + maxexptime = time, + minsize = particle_size, + maxsize = particle_size, collisiondetection = true, vertical = true, -- to make it appear hitting the node that will get set on fire, make sure @@ -134,43 +154,27 @@ lightning.strike = function(pos) sound_play({ name = "lightning_thunder", gain = 10 }, { pos = pos, max_hear_distance = 500 }, true) -- damage nearby objects, transform mobs - local objs = get_objects_inside_radius(pos2, 3.5) - for o=1, #objs do - local obj = objs[o] + for _, obj in pairs(objects) do local lua = obj:get_luaentity() - -- pig → zombie pigman (no damage) + if lua and lua._on_strike then + lua._on_strike(lua, pos, pos2, objects) + end + -- remove this when mob API is done if lua and lua.name == "mcl_mobs:pig" then - local rot = obj:get_yaw() - obj:remove() - obj = add_entity(pos2, "mcl_mobs:pigman") - obj:set_yaw(rot) - -- mooshroom: toggle color red/brown (no damage) + mcl_util.replace_mob(obj, "mobs_mc:pigman") elseif lua and lua.name == "mcl_mobs:mooshroom" then if lua.base_texture[1] == "mcl_mobs_mooshroom.png" then lua.base_texture = { "mcl_mobs_mooshroom_brown.png", "mcl_mobs_mushroom_brown.png" } else lua.base_texture = { "mcl_mobs_mooshroom.png", "mcl_mobs_mushroom_red.png" } end - obj:set_properties({textures = lua.base_texture}) - -- villager → witch (no damage) + obj:set_properties({ textures = lua.base_texture }) elseif lua and lua.name == "mcl_mobs:villager" then - -- Witches are incomplete, this code is unused - -- TODO: Enable this code when witches are working. - --[[ - local rot = obj:get_yaw() - obj:remove() - obj = minetest.add_entity(pos2, "mcl_mobs:witch") - obj:set_yaw(rot) - ]] - -- charged creeper + mcl_util.replace_mob(obj, "mcl_mobs:witch") elseif lua and lua.name == "mcl_mobs:creeper" then - local rot = obj:get_yaw() - obj:remove() - obj = add_entity(pos2, "mcl_mobs:creeper_charged") - obj:set_yaw(rot) - -- Other objects: Just damage + mcl_util.replace_mob(obj, "mcl_mobs:creeper_charged") else - mcl_util.deal_damage(obj, 5, {type = "lightning_bolt"}) + mcl_util.deal_damage(obj, 5, { type = "lightning_bolt" }) end end @@ -184,7 +188,7 @@ lightning.strike = function(pos) local name = player:get_player_name() if ps[name] == nil then ps[name] = {p = player, sky = sky} - mcl_weather.skycolor.add_layer("lightning", {{r=255,g=255,b=255}}, true) + mcl_weather.skycolor.add_layer("lightning", { { r = 255, g = 255, b = 255 } }, true) mcl_weather.skycolor.active = true end end @@ -199,7 +203,7 @@ lightning.strike = function(pos) if rng:next(1,100) <= 3 then skeleton_lightning = true end - if get_item_group(get_node({x = pos2.x, y = pos2.y - 1, z = pos2.z}).name, "liquid") < 1 then + if get_item_group(get_node({ x = pos2.x, y = pos2.y - 1, z = pos2.z }).name, "liquid") < 1 then if get_node(pos2).name == "air" then -- Low chance for a lightning to spawn skeleton horse + skeletons if skeleton_lightning then @@ -208,7 +212,7 @@ lightning.strike = function(pos) local angle, posadd angle = math.random(0, math.pi*2) for i=1,3 do - posadd = {x=math.cos(angle),y=0,z=math.sin(angle)} + posadd = { x=math.cos(angle),y=0,z=math.sin(angle) } posadd = vector.normalize(posadd) local mob = add_entity(vector.add(pos2, posadd), "mcl_mobs:skeleton") mob:set_yaw(angle-math.pi/2) @@ -217,12 +221,11 @@ lightning.strike = function(pos) -- Cause a fire else - set_node(pos2, {name = "mcl_fire:fire"}) + set_node(pos2, { name = "mcl_fire:fire" }) end end end - -end +end) -- if other mods disable auto lightning during initialization, don't trigger the first lightning. after(5, function(dtime) diff --git a/mods/ENVIRONMENT/lightning/locale/lightning.pl.tr b/mods/ENVIRONMENT/lightning/locale/lightning.pl.tr new file mode 100644 index 000000000..1b0edbd1f --- /dev/null +++ b/mods/ENVIRONMENT/lightning/locale/lightning.pl.tr @@ -0,0 +1,4 @@ +# textdomain: lightning +@1 was struck by lightning.=@1 została trafiona przez piorun. +Let lightning strike at the specified position or yourself=Pozwala by piorun uderzył we wskazaną pozycję lub ciebie +No position specified and unknown player=Nie wskazano pozycji i nieznany gracz diff --git a/mods/ENVIRONMENT/mcl_moon/init.lua b/mods/ENVIRONMENT/mcl_moon/init.lua index 4ee2623a6..200c6ca41 100644 --- a/mods/ENVIRONMENT/mcl_moon/init.lua +++ b/mods/ENVIRONMENT/mcl_moon/init.lua @@ -4,18 +4,16 @@ local SHEET_W = 4 local SHEET_H = 2 -- Randomize initial moon phase, based on map seed -local phase_offset local mg_seed = minetest.get_mapgen_setting("seed") local rand = PseudoRandom(mg_seed) local phase_offset = rand:next(0, MOON_PHASES - 1) -rand = nil minetest.log("info", "[mcl_moon] Moon phase offset of this world: "..phase_offset) mcl_moon = {} mcl_moon.MOON_PHASES = MOON_PHASES -mcl_moon.get_moon_phase = function() +function mcl_moon.get_moon_phase() local after_midday = 0 -- Moon phase changes after midday local tod = minetest.get_timeofday() @@ -25,7 +23,7 @@ mcl_moon.get_moon_phase = function() return (minetest.get_day_count() + phase_offset + after_midday) % MOON_PHASES end -local get_moon_texture = function() +local function get_moon_texture() local phase = mcl_moon.get_moon_phase() local x = phase % MOON_PHASES_HALF local y diff --git a/mods/ENVIRONMENT/mcl_void_damage/init.lua b/mods/ENVIRONMENT/mcl_void_damage/init.lua index 24f7d0e4b..084028dd1 100644 --- a/mods/ENVIRONMENT/mcl_void_damage/init.lua +++ b/mods/ENVIRONMENT/mcl_void_damage/init.lua @@ -1,5 +1,5 @@ -local S = minetest.get_translator("mcl_void_damage") -local enable_damage = minetest.settings:get_bool("enable_damage") +local S = minetest.get_translator(minetest.get_current_modname()) +--local enable_damage = minetest.settings:get_bool("enable_damage") local pos_to_dim = mcl_worlds.pos_to_dimension local dim_change = mcl_worlds.dimension_change @@ -39,9 +39,9 @@ minetest.register_on_mods_loaded(function() end self._void_timer = 0 - local void, void_deadly = is_in_void(pos) + local _, void_deadly = is_in_void(pos) if void_deadly then - local ent = obj:get_luaentity() + --local ent = obj:get_luaentity() obj:remove() return end @@ -61,7 +61,7 @@ minetest.register_globalstep(function(dtime) for p=1, #players do local player = players[p] local pos = player:get_pos() - local void, void_deadly = is_in_void(pos) + local _, void_deadly = is_in_void(pos) if void_deadly then local immortal_val = player:get_armor_groups().immortal local is_immortal = false diff --git a/mods/ENVIRONMENT/mcl_void_damage/locale/mcl_void_damage.pl.tr b/mods/ENVIRONMENT/mcl_void_damage/locale/mcl_void_damage.pl.tr new file mode 100644 index 000000000..c943d3e67 --- /dev/null +++ b/mods/ENVIRONMENT/mcl_void_damage/locale/mcl_void_damage.pl.tr @@ -0,0 +1,3 @@ +# textdomain: mcl_void_damage +The void is off-limits to you!=Otchłań jest poza twoim zasięgiem! +@1 fell into the endless void.=@1 spadła w bezkresną otchłań. diff --git a/mods/ENVIRONMENT/mcl_weather/init.lua b/mods/ENVIRONMENT/mcl_weather/init.lua index e4ebfb2dc..e13242996 100644 --- a/mods/ENVIRONMENT/mcl_weather/init.lua +++ b/mods/ENVIRONMENT/mcl_weather/init.lua @@ -1,4 +1,4 @@ -local modpath = minetest.get_modpath("mcl_weather") +local modpath = minetest.get_modpath(minetest.get_current_modname()) mcl_weather = {} @@ -12,6 +12,6 @@ dofile(modpath.."/snow.lua") dofile(modpath.."/rain.lua") dofile(modpath.."/nether_dust.lua") -if minetest.get_modpath("lightning") ~= nil then +if minetest.get_modpath("lightning") then dofile(modpath.."/thunder.lua") end diff --git a/mods/ENVIRONMENT/mcl_weather/locale/mcl_weather.pl.tr b/mods/ENVIRONMENT/mcl_weather/locale/mcl_weather.pl.tr new file mode 100644 index 000000000..fc4c72a31 --- /dev/null +++ b/mods/ENVIRONMENT/mcl_weather/locale/mcl_weather.pl.tr @@ -0,0 +1,8 @@ +# textdomain: mcl_weather +Gives ability to control weather=Daje możliwość kontrolowania pogody +Changes the weather to the specified parameter.=Zmienia pogodę na wskazany parametr +Error: No weather specified.=Błąd: nie wskazano pogody. +Error: Invalid parameters.=Błąd: nieprawidłowy parametr. +Error: Duration can't be less than 1 second.=Błąd: Czas trwania nie może być mniejszy niż 1 sekunda. +Error: Invalid weather specified. Use “clear”, “rain”, “snow” or “thunder”.=Błąd: wskazano nieprawidłową pogodę. Użyj "clear", "rain", "snow" lub "thunder". +Toggles between clear weather and weather with downfall (randomly rain, thunderstorm or snow)=Zmienia pomiędzy czystą pogodą i pogodą z opadami (losowo deszcz, burza lub śnieg) diff --git a/mods/ENVIRONMENT/mcl_weather/nether_dust.lua b/mods/ENVIRONMENT/mcl_weather/nether_dust.lua index 16cdc9487..d328dae21 100644 --- a/mods/ENVIRONMENT/mcl_weather/nether_dust.lua +++ b/mods/ENVIRONMENT/mcl_weather/nether_dust.lua @@ -2,7 +2,7 @@ mcl_weather.nether_dust = {} mcl_weather.nether_dust.particles_count = 99 -- calculates coordinates and draw particles for Nether dust -mcl_weather.nether_dust.add_dust_particles = function(player) +function mcl_weather.nether_dust.add_dust_particles(player) for i=mcl_weather.nether_dust.particles_count, 1,-1 do local rpx, rpy, rpz = mcl_weather.get_random_pos_by_player_look_dir(player) minetest.add_particle({ diff --git a/mods/ENVIRONMENT/mcl_weather/rain.lua b/mods/ENVIRONMENT/mcl_weather/rain.lua index d8425784a..220b61006 100644 --- a/mods/ENVIRONMENT/mcl_weather/rain.lua +++ b/mods/ENVIRONMENT/mcl_weather/rain.lua @@ -20,7 +20,7 @@ mcl_weather.rain = { init_done = false, } -mcl_weather.rain.sound_handler = function(player) +function mcl_weather.rain.sound_handler(player) return minetest.sound_play("weather_rain", { to_player = player:get_player_name(), loop = true, @@ -28,7 +28,7 @@ mcl_weather.rain.sound_handler = function(player) end -- set skybox based on time (uses skycolor api) -mcl_weather.rain.set_sky_box = function() +function mcl_weather.rain.set_sky_box() if mcl_weather.state == "rain" then mcl_weather.skycolor.add_layer( "weather-pack-rain-sky", @@ -46,8 +46,7 @@ end -- creating manually parctiles instead of particles spawner because of easier to control -- spawn position. -mcl_weather.rain.add_rain_particles = function(player) - +function mcl_weather.rain.add_rain_particles(player) mcl_weather.rain.last_rp_count = 0 for i=mcl_weather.rain.particles_count, 1,-1 do local random_pos_x, random_pos_y, random_pos_z = mcl_weather.get_random_pos_by_player_look_dir(player) @@ -70,7 +69,7 @@ mcl_weather.rain.add_rain_particles = function(player) end -- Simple random texture getter -mcl_weather.rain.get_texture = function() +function mcl_weather.rain.get_texture() local texture_name local random_number = math.random() if random_number > 0.33 then @@ -85,7 +84,7 @@ end -- register player for rain weather. -- basically needs for origin sky reference and rain sound controls. -mcl_weather.rain.add_player = function(player) +function mcl_weather.rain.add_player(player) if mcl_weather.players[player:get_player_name()] == nil then local player_meta = {} player_meta.origin_sky = {player:get_sky()} @@ -95,9 +94,9 @@ end -- remove player from player list effected by rain. -- be sure to remove sound before removing player otherwise soundhandler reference will be lost. -mcl_weather.rain.remove_player = function(player) +function mcl_weather.rain.remove_player(player) local player_meta = mcl_weather.players[player:get_player_name()] - if player_meta ~= nil and player_meta.origin_sky ~= nil then + if player_meta and player_meta.origin_sky then player:set_clouds({color="#FFF0F0E5"}) mcl_weather.players[player:get_player_name()] = nil end @@ -119,14 +118,14 @@ end) -- adds and removes rain sound depending how much rain particles around player currently exist. -- have few seconds delay before each check to avoid on/off sound too often -- when player stay on 'edge' where sound should play and stop depending from random raindrop appearance. -mcl_weather.rain.update_sound = function(player) +function mcl_weather.rain.update_sound(player) local player_meta = mcl_weather.players[player:get_player_name()] - if player_meta ~= nil then - if player_meta.sound_updated ~= nil and player_meta.sound_updated + 5 > minetest.get_gametime() then + if player_meta then + if player_meta.sound_updated and player_meta.sound_updated + 5 > minetest.get_gametime() then return false end - if player_meta.sound_handler ~= nil then + if player_meta.sound_handler then if mcl_weather.rain.last_rp_count == 0 then minetest.sound_fade(player_meta.sound_handler, -0.5, 0.0) player_meta.sound_handler = nil @@ -140,9 +139,9 @@ mcl_weather.rain.update_sound = function(player) end -- rain sound removed from player. -mcl_weather.rain.remove_sound = function(player) +function mcl_weather.rain.remove_sound(player) local player_meta = mcl_weather.players[player:get_player_name()] - if player_meta ~= nil and player_meta.sound_handler ~= nil then + if player_meta and player_meta.sound_handler then minetest.sound_fade(player_meta.sound_handler, -0.5, 0.0) player_meta.sound_handler = nil player_meta.sound_updated = nil @@ -150,7 +149,7 @@ mcl_weather.rain.remove_sound = function(player) end -- callback function for removing rain -mcl_weather.rain.clear = function() +function mcl_weather.rain.clear() mcl_weather.rain.raining = false mcl_weather.rain.sky_last_update = -1 mcl_weather.rain.init_done = false @@ -166,11 +165,10 @@ minetest.register_globalstep(function(dtime) if mcl_weather.state ~= "rain" then return false end - mcl_weather.rain.make_weather() end) -mcl_weather.rain.make_weather = function() +function mcl_weather.rain.make_weather() if mcl_weather.rain.init_done == false then mcl_weather.rain.raining = true mcl_weather.rain.set_sky_box() @@ -190,7 +188,7 @@ mcl_weather.rain.make_weather = function() end -- Switch the number of raindrops: "thunder" for many raindrops, otherwise for normal raindrops -mcl_weather.rain.set_particles_mode = function(mode) +function mcl_weather.rain.set_particles_mode(mode) if mode == "thunder" then mcl_weather.rain.particles_count = PARTICLES_COUNT_THUNDER else @@ -249,7 +247,7 @@ if mcl_weather.allow_abm then end end end - }) + }) -- Wetten the soil minetest.register_abm({ @@ -264,7 +262,7 @@ if mcl_weather.allow_abm then end end end - }) + }) end if mcl_weather.reg_weathers.rain == nil then diff --git a/mods/ENVIRONMENT/mcl_weather/skycolor.lua b/mods/ENVIRONMENT/mcl_weather/skycolor.lua index 061634fcb..6b89c33be 100644 --- a/mods/ENVIRONMENT/mcl_weather/skycolor.lua +++ b/mods/ENVIRONMENT/mcl_weather/skycolor.lua @@ -11,7 +11,7 @@ mcl_weather.skycolor = { -- Update interval. update_interval = 15, - -- Main sky colors: starts from midnight to midnight. + -- Main sky colors: starts from midnight to midnight. -- Please do not set directly. Use add_layer instead. colors = {}, @@ -205,8 +205,8 @@ mcl_weather.skycolor = { -- Returns first player sky color. I assume that all players are in same color layout. get_current_bg_color = function() local players = mcl_weather.skycolor.utils.get_players(nil) - for _, player in ipairs(players) do - return player:get_sky() + if players[1] then + return players[1]:get_sky() end return nil end @@ -235,7 +235,7 @@ minetest.register_globalstep(function(dtime) end) -local initsky = function(player) +local function initsky(player) if (mcl_weather.skycolor.active) then mcl_weather.skycolor.force_update = true end diff --git a/mods/ENVIRONMENT/mcl_weather/snow.lua b/mods/ENVIRONMENT/mcl_weather/snow.lua index 3a0c539e3..9f89a3a0a 100644 --- a/mods/ENVIRONMENT/mcl_weather/snow.lua +++ b/mods/ENVIRONMENT/mcl_weather/snow.lua @@ -5,80 +5,80 @@ mcl_weather.snow = {} mcl_weather.snow.particles_count = 15 mcl_weather.snow.init_done = false --- calculates coordinates and draw particles for snow weather -mcl_weather.snow.add_snow_particles = function(player) - mcl_weather.rain.last_rp_count = 0 - for i=mcl_weather.snow.particles_count, 1,-1 do - local random_pos_x, random_pos_y, random_pos_z = mcl_weather.get_random_pos_by_player_look_dir(player) - random_pos_y = math.random() + math.random(player:get_pos().y - 1, player:get_pos().y + 7) - if minetest.get_node_light({x=random_pos_x, y=random_pos_y, z=random_pos_z}, 0.5) == 15 then - mcl_weather.rain.last_rp_count = mcl_weather.rain.last_rp_count + 1 - minetest.add_particle({ - pos = {x=random_pos_x, y=random_pos_y, z=random_pos_z}, - velocity = {x = math.random(-100,100)*0.001, y = math.random(-300,-100)*0.004, z = math.random(-100,100)*0.001}, - acceleration = {x = 0, y=0, z = 0}, - expirationtime = 8.0, - size = 1, - collisiondetection = true, - collision_removal = true, - object_collision = false, - vertical = false, - texture = mcl_weather.snow.get_texture(), - playername = player:get_player_name() - }) - end - end +-- calculates coordinates and draw particles for snow weather +function mcl_weather.snow.add_snow_particles(player) + mcl_weather.rain.last_rp_count = 0 + for i=mcl_weather.snow.particles_count, 1,-1 do + local random_pos_x, _, random_pos_z = mcl_weather.get_random_pos_by_player_look_dir(player) + local random_pos_y = math.random() + math.random(player:get_pos().y - 1, player:get_pos().y + 7) + if minetest.get_node_light({x=random_pos_x, y=random_pos_y, z=random_pos_z}, 0.5) == 15 then + mcl_weather.rain.last_rp_count = mcl_weather.rain.last_rp_count + 1 + minetest.add_particle({ + pos = {x=random_pos_x, y=random_pos_y, z=random_pos_z}, + velocity = {x = math.random(-100,100)*0.001, y = math.random(-300,-100)*0.004, z = math.random(-100,100)*0.001}, + acceleration = {x = 0, y=0, z = 0}, + expirationtime = 8.0, + size = 1, + collisiondetection = true, + collision_removal = true, + object_collision = false, + vertical = false, + texture = mcl_weather.snow.get_texture(), + playername = player:get_player_name() + }) + end + end end -mcl_weather.snow.set_sky_box = function() - mcl_weather.skycolor.add_layer( - "weather-pack-snow-sky", - {{r=0, g=0, b=0}, - {r=85, g=86, b=86}, - {r=135, g=135, b=135}, - {r=85, g=86, b=86}, - {r=0, g=0, b=0}}) - mcl_weather.skycolor.active = true - for _, player in pairs(get_connected_players()) do - player:set_clouds({color="#ADADADE8"}) - end - mcl_weather.skycolor.active = true +function mcl_weather.snow.set_sky_box() + mcl_weather.skycolor.add_layer( + "weather-pack-snow-sky", + {{r=0, g=0, b=0}, + {r=85, g=86, b=86}, + {r=135, g=135, b=135}, + {r=85, g=86, b=86}, + {r=0, g=0, b=0}}) + mcl_weather.skycolor.active = true + for _, player in pairs(get_connected_players()) do + player:set_clouds({color="#ADADADE8"}) + end + mcl_weather.skycolor.active = true end -mcl_weather.snow.clear = function() - mcl_weather.skycolor.remove_layer("weather-pack-snow-sky") - mcl_weather.snow.init_done = false +function mcl_weather.snow.clear() + mcl_weather.skycolor.remove_layer("weather-pack-snow-sky") + mcl_weather.snow.init_done = false end -- Simple random texture getter -mcl_weather.snow.get_texture = function() - return "weather_pack_snow_snowflake"..math.random(1,2)..".png" +function mcl_weather.snow.get_texture() + return "weather_pack_snow_snowflake"..math.random(1,2)..".png" end local timer = 0 minetest.register_globalstep(function(dtime) - if mcl_weather.state ~= "snow" then - return false - end - - timer = timer + dtime; - if timer >= 0.5 then - timer = 0 - else - return - end + if mcl_weather.state ~= "snow" then + return false + end - if mcl_weather.snow.init_done == false then - mcl_weather.snow.set_sky_box() - mcl_weather.snow.init_done = true - end + timer = timer + dtime; + if timer >= 0.5 then + timer = 0 + else + return + end - for _, player in pairs(get_connected_players()) do - if (mcl_weather.is_underwater(player) or not mcl_worlds.has_weather(player:get_pos())) then - return false - end - mcl_weather.snow.add_snow_particles(player) - end + if mcl_weather.snow.init_done == false then + mcl_weather.snow.set_sky_box() + mcl_weather.snow.init_done = true + end + + for _, player in pairs(get_connected_players()) do + if (mcl_weather.is_underwater(player) or not mcl_worlds.has_weather(player:get_pos())) then + return false + end + mcl_weather.snow.add_snow_particles(player) + end end) -- register snow weather diff --git a/mods/ENVIRONMENT/mcl_weather/thunder.lua b/mods/ENVIRONMENT/mcl_weather/thunder.lua index ece673170..f8e5a0371 100644 --- a/mods/ENVIRONMENT/mcl_weather/thunder.lua +++ b/mods/ENVIRONMENT/mcl_weather/thunder.lua @@ -4,60 +4,58 @@ local get_connected_players = minetest.get_connected_players lightning.auto = false mcl_weather.thunder = { - next_strike = 0, - min_delay = 3, - max_delay = 12, - init_done = false, + next_strike = 0, + min_delay = 3, + max_delay = 12, + init_done = false, } minetest.register_globalstep(function(dtime) - if mcl_weather.get_weather() ~= "thunder" then - return false - end - - mcl_weather.rain.set_particles_mode("thunder") - mcl_weather.rain.make_weather() + if mcl_weather.get_weather() ~= "thunder" then + return false + end - if mcl_weather.thunder.init_done == false then - mcl_weather.skycolor.add_layer( - "weather-pack-thunder-sky", - {{r=0, g=0, b=0}, - {r=40, g=40, b=40}, - {r=85, g=86, b=86}, - {r=40, g=40, b=40}, - {r=0, g=0, b=0}}) - mcl_weather.skycolor.active = true - for _, player in pairs(get_connected_players()) do - player:set_clouds({color="#3D3D3FE8"}) - end - mcl_weather.thunder.init_done = true - end - - if (mcl_weather.thunder.next_strike <= minetest.get_gametime()) then - lightning.strike() - local delay = math.random(mcl_weather.thunder.min_delay, mcl_weather.thunder.max_delay) - mcl_weather.thunder.next_strike = minetest.get_gametime() + delay - end + mcl_weather.rain.set_particles_mode("thunder") + mcl_weather.rain.make_weather() + if mcl_weather.thunder.init_done == false then + mcl_weather.skycolor.add_layer("weather-pack-thunder-sky", { + {r=0, g=0, b=0}, + {r=40, g=40, b=40}, + {r=85, g=86, b=86}, + {r=40, g=40, b=40}, + {r=0, g=0, b=0}, + }) + mcl_weather.skycolor.active = true + for _, player in pairs(get_connected_players()) do + player:set_clouds({color="#3D3D3FE8"}) + end + mcl_weather.thunder.init_done = true + end + if (mcl_weather.thunder.next_strike <= minetest.get_gametime()) then + lightning.strike() + local delay = math.random(mcl_weather.thunder.min_delay, mcl_weather.thunder.max_delay) + mcl_weather.thunder.next_strike = minetest.get_gametime() + delay + end end) -mcl_weather.thunder.clear = function() - mcl_weather.rain.clear() - mcl_weather.skycolor.remove_layer("weather-pack-thunder-sky") - mcl_weather.skycolor.remove_layer("lightning") - mcl_weather.thunder.init_done = false +function mcl_weather.thunder.clear() + mcl_weather.rain.clear() + mcl_weather.skycolor.remove_layer("weather-pack-thunder-sky") + mcl_weather.skycolor.remove_layer("lightning") + mcl_weather.thunder.init_done = false end -- register thunderstorm weather if mcl_weather.reg_weathers.thunder == nil then - mcl_weather.reg_weathers.thunder = { - clear = mcl_weather.thunder.clear, - light_factor = 0.33333, - -- 10min - 20min - min_duration = 600, - max_duration = 1200, - transitions = { - [100] = "rain", - } - } + mcl_weather.reg_weathers.thunder = { + clear = mcl_weather.thunder.clear, + light_factor = 0.33333, + -- 10min - 20min + min_duration = 600, + max_duration = 1200, + transitions = { + [100] = "rain", + }, + } end diff --git a/mods/ENVIRONMENT/mcl_weather/weather_core.lua b/mods/ENVIRONMENT/mcl_weather/weather_core.lua index d3772dc7e..34f69406d 100644 --- a/mods/ENVIRONMENT/mcl_weather/weather_core.lua +++ b/mods/ENVIRONMENT/mcl_weather/weather_core.lua @@ -1,27 +1,29 @@ -local S = minetest.get_translator("mcl_weather") +local S = minetest.get_translator(minetest.get_current_modname()) + +local math = math -- weather states, 'none' is default, other states depends from active mods mcl_weather.state = "none" - + -- player list for saving player meta info mcl_weather.players = {} - + -- default weather check interval for global step mcl_weather.check_interval = 5 - + -- weather min duration mcl_weather.min_duration = 600 - + -- weather max duration mcl_weather.max_duration = 9000 -- weather calculated end time mcl_weather.end_time = nil - + -- registered weathers mcl_weather.reg_weathers = {} --- global flag to disable/enable ABM logic. +-- global flag to disable/enable ABM logic. mcl_weather.allow_abm = true mcl_weather.reg_weathers["none"] = { @@ -37,7 +39,7 @@ mcl_weather.reg_weathers["none"] = { local storage = minetest.get_mod_storage() -- Save weather into mod storage, so it can be loaded after restarting the server -local save_weather = function() +local function save_weather() if not mcl_weather.end_time then return end storage:set_string("mcl_weather_state", mcl_weather.state) storage:set_int("mcl_weather_end_time", mcl_weather.end_time) @@ -45,17 +47,17 @@ local save_weather = function() end minetest.register_on_shutdown(save_weather) -mcl_weather.get_rand_end_time = function(min_duration, max_duration) +function mcl_weather.get_rand_end_time(min_duration, max_duration) local r - if min_duration ~= nil and max_duration ~= nil then + if min_duration and max_duration then r = math.random(min_duration, max_duration) else r = math.random(mcl_weather.min_duration, mcl_weather.max_duration) - end + end return minetest.get_gametime() + r end -mcl_weather.get_current_light_factor = function() +function mcl_weather.get_current_light_factor() if mcl_weather.state == "none" then return nil else @@ -66,7 +68,7 @@ end -- Returns true if pos is outdoor. -- Outdoor is defined as any node in the Overworld under open sky. -- FIXME: Nodes below glass also count as “outdoor”, this should not be the case. -mcl_weather.is_outdoor = function(pos) +function mcl_weather.is_outdoor(pos) local cpos = {x=pos.x, y=pos.y+1, z=pos.z} local dim = mcl_worlds.pos_to_dimension(cpos) if minetest.get_node_light(cpos, 0.5) == 15 and dim == "overworld" then @@ -77,11 +79,11 @@ end -- checks if player is undewater. This is needed in order to -- turn off weather particles generation. -mcl_weather.is_underwater = function(player) +function mcl_weather.is_underwater(player) local ppos = player:get_pos() local offset = player:get_eye_offset() - local player_eye_pos = {x = ppos.x + offset.x, - y = ppos.y + offset.y + 1.5, + local player_eye_pos = {x = ppos.x + offset.x, + y = ppos.y + offset.y + 1.5, z = ppos.z + offset.z} local node_level = minetest.get_node_level(player_eye_pos) if node_level == 8 or node_level == 7 then @@ -91,14 +93,12 @@ mcl_weather.is_underwater = function(player) end -- trying to locate position for particles by player look direction for performance reason. --- it is costly to generate many particles around player so goal is focus mainly on front view. -mcl_weather.get_random_pos_by_player_look_dir = function(player) +-- it is costly to generate many particles around player so goal is focus mainly on front view. +function mcl_weather.get_random_pos_by_player_look_dir(player) local look_dir = player:get_look_dir() local player_pos = player:get_pos() - local random_pos_x = 0 - local random_pos_y = 0 - local random_pos_z = 0 + local random_pos_x, random_pos_y, random_pos_z if look_dir.x > 0 then if look_dir.z > 0 then @@ -123,6 +123,7 @@ mcl_weather.get_random_pos_by_player_look_dir = function(player) end local t, wci = 0, mcl_weather.check_interval + minetest.register_globalstep(function(dtime) t = t + dtime if t < wci then return end @@ -146,7 +147,7 @@ minetest.register_globalstep(function(dtime) end) -- Sets random weather (which could be 'none' (no weather)). -mcl_weather.set_random_weather = function(weather_name, weather_meta) +function mcl_weather.set_random_weather(weather_name, weather_meta) if weather_meta == nil then return end local transitions = weather_meta.transitions local random_roll = math.random(0,100) @@ -166,11 +167,11 @@ end -- * explicit_end_time is OPTIONAL. If specified, explicitly set the -- gametime (minetest.get_gametime) in which the weather ends. -- * changer is OPTIONAL, for logging purposes. -mcl_weather.change_weather = function(new_weather, explicit_end_time, changer_name) +function mcl_weather.change_weather(new_weather, explicit_end_time, changer_name) local changer_name = changer_name or debug.getinfo(2).name.."()" - if (mcl_weather.reg_weathers ~= nil and mcl_weather.reg_weathers[new_weather] ~= nil) then - if (mcl_weather.state ~= nil and mcl_weather.reg_weathers[mcl_weather.state] ~= nil) then + if (mcl_weather.reg_weathers and mcl_weather.reg_weathers[new_weather]) then + if (mcl_weather.state and mcl_weather.reg_weathers[mcl_weather.state]) then mcl_weather.reg_weathers[mcl_weather.state].clear() end @@ -199,7 +200,7 @@ mcl_weather.change_weather = function(new_weather, explicit_end_time, changer_na return false end -mcl_weather.get_weather = function() +function mcl_weather.get_weather() return mcl_weather.state end @@ -208,7 +209,7 @@ minetest.register_privilege("weather_manager", { give_to_singleplayer = false }) --- Weather command definition. Set +-- Weather command definition. Set minetest.register_chatcommand("weather", { params = "(clear | rain | snow | thunder) []", description = S("Changes the weather to the specified parameter."), @@ -268,12 +269,12 @@ minetest.register_chatcommand("toggledownfall", { -- Configuration setting which allows user to disable ABM for weathers (if they use it). -- Weather mods expected to be use this flag before registering ABM. local weather_allow_abm = minetest.settings:get_bool("weather_allow_abm") -if weather_allow_abm ~= nil and weather_allow_abm == false then +if weather_allow_abm == false then mcl_weather.allow_abm = false -end +end -local load_weather = function() +local function load_weather() local weather = storage:get_string("mcl_weather_state") if weather and weather ~= "" then mcl_weather.state = weather diff --git a/mods/HELP/doc/doc/init.lua b/mods/HELP/doc/doc/init.lua index 029914a53..304900753 100644 --- a/mods/HELP/doc/doc/init.lua +++ b/mods/HELP/doc/doc/init.lua @@ -1,6 +1,10 @@ -local S = minetest.get_translator("doc") +local S = minetest.get_translator(minetest.get_current_modname()) local F = function(f) return minetest.formspec_escape(S(f)) end +local mod_central_messages = minetest.get_modpath("central_message") +local mod_inventory_plus = minetest.get_modpath("inventory_plus") + +local math = math local colorize = minetest.colorize doc = {} @@ -63,7 +67,7 @@ local set_category_order_was_called = false local function get_entry(category_id, entry_id) local category = doc.data.categories[category_id] local entry - if category ~= nil then + if category then entry = category.entries[entry_id] end if category == nil or entry == nil then @@ -93,7 +97,7 @@ end -- Add a new category function doc.add_category(id, def) - if doc.data.categories[id] == nil and id ~= nil then + if doc.data.categories[id] == nil and id then doc.data.categories[id] = {} doc.data.categories[id].entries = {} doc.data.categories[id].entry_count = 0 @@ -123,7 +127,7 @@ end -- Add a new entry function doc.add_entry(category_id, entry_id, def) local cat = doc.data.categories[category_id] - if cat ~= nil then + if cat then local hidden = def.hidden or (def.hidden == nil and cat.def.hide_entries_by_default) if hidden then cat.hidden_count = cat.hidden_count + 1 @@ -177,7 +181,7 @@ function doc.mark_entry_as_revealed(playername, category_id, entry_id) doc.data.players[playername].entry_textlist_needs_updating = true -- Notify player of entry revelation if doc.data.players[playername].stored_data.notify_on_reveal == true then - if minetest.get_modpath("central_message") ~= nil then + if mod_central_messages then local cat = doc.data.categories[category_id] cmsg.push_message_player(minetest.get_player_by_name(playername), S("New help entry unlocked: @1 > @2", cat.def.name, entry.name)) end @@ -224,7 +228,7 @@ function doc.mark_all_entries_as_revealed(playername) msg = S("All help entries are already revealed.") end -- Notify - if minetest.get_modpath("central_message") ~= nil then + if mod_central_messages then cmsg.push_message_player(minetest.get_player_by_name(playername), msg) else minetest.chat_send_player(playername, msg) @@ -233,7 +237,7 @@ end -- Returns true if the specified entry has been viewed by the player function doc.entry_viewed(playername, category_id, entry_id) - local entry, category_id, entry_id = get_entry(category_id, entry_id) + local _, category_id, entry_id = get_entry(category_id, entry_id) if doc.data.players[playername].stored_data.viewed[category_id] == nil then return false else @@ -243,7 +247,7 @@ end -- Returns true if the specified entry is hidden from the player function doc.entry_revealed(playername, category_id, entry_id) - local entry, category_id, entry_id = get_entry(category_id, entry_id) + local _, category_id, entry_id = get_entry(category_id, entry_id) local hidden = doc.data.categories[category_id].entries[entry_id].hidden if doc.data.players[playername].stored_data.revealed[category_id] == nil then return not hidden @@ -302,7 +306,7 @@ function doc.show_entry(playername, category_id, entry_id, ignore_hidden) minetest.show_formspec(playername, "doc:error_no_categories", doc.formspec_error_no_categories()) return end - local entry, category_id, entry_id = get_entry(category_id, entry_id) + local _, category_id, entry_id = get_entry(category_id, entry_id) if ignore_hidden or doc.entry_revealed(playername, category_id, entry_id) then local playerdata = doc.data.players[playername] playerdata.category = category_id @@ -427,7 +431,7 @@ end -- Returns the currently viewed entry and/or category of the player function doc.get_selection(playername) local playerdata = doc.data.players[playername] - if playerdata ~= nil then + if playerdata then local cat = playerdata.category if cat then local entry = playerdata.entry @@ -448,18 +452,18 @@ end doc.entry_builders = {} -- Scrollable freeform text -doc.entry_builders.text = function(data) +function doc.entry_builders.text(data) local formstring = doc.widgets.text(data, doc.FORMSPEC.ENTRY_START_X, doc.FORMSPEC.ENTRY_START_Y, doc.FORMSPEC.ENTRY_WIDTH - 0.4, doc.FORMSPEC.ENTRY_HEIGHT) return formstring end -- Scrollable freeform text with an optional standard gallery (3 rows, 3:2 aspect ratio) -doc.entry_builders.text_and_gallery = function(data, playername) +function doc.entry_builders.text_and_gallery(data, playername) -- How much height the image gallery “steals” from the text widget local stolen_height = 0 local formstring = "" -- Only add the gallery if images are in the data, otherwise, the text widget gets all of the space - if data.images ~= nil then + if data.images then local gallery gallery, stolen_height = doc.widgets.gallery(data.images, playername, nil, doc.FORMSPEC.ENTRY_END_Y + 0.2, nil, nil, nil, nil, false) formstring = formstring .. gallery @@ -476,7 +480,7 @@ end doc.widgets = {} -- Scrollable freeform text -doc.widgets.text = function(data, x, y, width, height) +function doc.widgets.text(data, x, y, width, height) if x == nil then x = doc.FORMSPEC.ENTRY_START_X end @@ -502,7 +506,7 @@ end -- Image gallery -- Currently, only one gallery per entry is supported. TODO: Add support for multiple galleries in an entry (low priority) -doc.widgets.gallery = function(imagedata, playername, x, y, aspect_ratio, width, rows, align_left, align_top) +function doc.widgets.gallery(imagedata, playername, x, y, aspect_ratio, width, rows, align_left, align_top) if playername == nil then return nil end -- emergency exit local formstring = "" @@ -587,13 +591,11 @@ doc.widgets.gallery = function(imagedata, playername, x, y, aspect_ratio, width, formstring = formstring .. "label["..nx..","..ny..";"..i.."]" pos = pos + 1 end - local bw, bh - return formstring, ih end -- Direct formspec -doc.entry_builders.formspec = function(data) +function doc.entry_builders.formspec(data) return data end @@ -607,7 +609,7 @@ do minetest.log("action", "[doc] doc.mt opened.") local string = file:read() io.close(file) - if(string ~= nil) then + if string then local savetable = minetest.deserialize(string) for name, players_stored_data in pairs(savetable.players_stored_data) do doc.data.players[name] = {} @@ -674,13 +676,13 @@ function doc.formspec_main(playername) local data = doc.data.categories[id] local bw = doc.FORMSPEC.WIDTH / math.floor(((doc.data.category_count-1) / CATEGORYFIELDSIZE.HEIGHT)+1) -- Skip categories which do not exist - if data ~= nil then + if data then -- Category buton local button = "button["..((x-1)*bw)..","..y..";"..bw..",1;doc_button_category_"..id..";"..minetest.formspec_escape(data.def.name).."]" local tooltip = "" -- Optional description - if data.def.description ~= nil then - tooltip = "tooltip[doc_button_category_"..id..";"..minetest.formspec_escape(data.def.description).."]" + if data.def.description then + tooltip = "tooltip[doc_button_category_"..id..";"..minetest.formspec_escape(data.def.description).."]" end formstring = formstring .. button .. tooltip y = y + 1 @@ -703,7 +705,7 @@ function doc.formspec_main(playername) end end local sel = doc.data.categories[doc.data.players[playername].category] - if sel ~= nil then + if sel then formstring = formstring .. ";" formstring = formstring .. doc.data.categories[doc.data.players[playername].category].order_position end @@ -713,7 +715,7 @@ function doc.formspec_main(playername) notify_checkbox_y = doc.FORMSPEC.HEIGHT-1 end local text - if minetest.get_modpath("central_message") then + if mod_central_messages then text = F("Notify me when new help is available") else text = F("Play notification sound when new help is available") @@ -804,7 +806,7 @@ function doc.get_sorted_entry_names(cid) local cat = doc.data.categories[cid] local used_eids = {} -- Helper function to extract the entry ID out of the output table - local extract = function(entry_table) + local function extract(entry_table) local eids = {} for k,v in pairs(entry_table) do local eid = v.eid @@ -946,7 +948,7 @@ function doc.process_form(player,formname,fields) local playername = player:get_player_name() --[[ process clicks on the tab header ]] if(formname == "doc:main" or formname == "doc:category" or formname == "doc:entry") then - if fields.doc_header ~= nil then + if fields.doc_header then local tab = tonumber(fields.doc_header) local formspec, subformname, contents local cid, eid @@ -961,7 +963,7 @@ function doc.process_form(player,formname,fields) elseif(tab==3) then doc.data.players[playername].galidx = 1 contents = doc.formspec_entry(cid, eid, playername) - if cid ~= nil and eid ~= nil then + if cid and eid then doc.mark_entry_as_viewed(playername, cid, eid) end subformname = "entry" @@ -986,7 +988,7 @@ function doc.process_form(player,formname,fields) if fields["doc_mainlist"] then local event = minetest.explode_textlist_event(fields["doc_mainlist"]) local cid = doc.data.category_order[event.index] - if cid ~= nil then + if cid then if event.type == "CHG" then doc.data.players[playername].catsel = nil doc.data.players[playername].category = cid @@ -1016,10 +1018,10 @@ function doc.process_form(player,formname,fields) elseif(formname == "doc:category") then if fields["doc_button_goto_entry"] then local cid = doc.data.players[playername].category - if cid ~= nil then + if cid then local eid = nil local eids, catsel = doc.data.players[playername].entry_ids, doc.data.players[playername].catsel - if eids ~= nil and catsel ~= nil then + if eids and catsel then eid = eids[catsel] end doc.data.players[playername].galidx = 1 @@ -1042,7 +1044,7 @@ function doc.process_form(player,formname,fields) local cid = doc.data.players[playername].category local eid = nil local eids, catsel = doc.data.players[playername].entry_ids, event.index - if eids ~= nil and catsel ~= nil then + if eids and catsel then eid = eids[catsel] end doc.mark_entry_as_viewed(playername, cid, eid) @@ -1103,7 +1105,7 @@ function doc.process_form(player,formname,fields) minetest.show_formspec(playername, "doc:entry", formspec) end else - if fields["doc_inventory_plus"] and minetest.get_modpath("inventory_plus") then + if fields["doc_inventory_plus"] and mod_inventory_plus then doc.show_doc(playername) return end @@ -1171,18 +1173,18 @@ minetest.register_on_joinplayer(function(player) end -- Add button for Inventory++ - if minetest.get_modpath("inventory_plus") ~= nil then + if mod_inventory_plus then inventory_plus.register_button(player, "doc_inventory_plus", S("Help")) end end) ---[[ Add buttons for inventory mods ]] -local button_action = function(player) +local function button_action(player) doc.show_doc(player:get_player_name()) end -- Unified Inventory -if minetest.get_modpath("unified_inventory") ~= nil then +if minetest.get_modpath("unified_inventory") then unified_inventory.register_button("doc", { type = "image", image = "doc_button_icon_hires.png", @@ -1192,7 +1194,7 @@ if minetest.get_modpath("unified_inventory") ~= nil then end -- sfinv_buttons -if minetest.get_modpath("sfinv_buttons") ~= nil then +if minetest.get_modpath("sfinv_buttons") then sfinv_buttons.register_button("doc", { image = "doc_button_icon_lores.png", tooltip = S("Collection of help texts"), diff --git a/mods/HELP/doc/doc/locale/doc.pl.tr b/mods/HELP/doc/doc/locale/doc.pl.tr new file mode 100644 index 000000000..bd0f3dbaa --- /dev/null +++ b/mods/HELP/doc/doc/locale/doc.pl.tr @@ -0,0 +1,52 @@ +# textdomain:doc +<=< +>=> +Access to the requested entry has been denied; this entry is secret. You may unlock access by progressing in the game. Figure out on your own how to unlock this entry.=Brak dostępu do zażądanego wpisu; ten wpis jest tajemnicą. Możesz odblokować do niego dostęp przez robienie postępów w grze. Wymyśl jak go odblokować. +All entries read.=Wszystkie wpisy przeczytane. +All help entries revealed!=Wszystkie wpisy pomocnicze odkryte! +All help entries are already revealed.=Wszystkie wpisy pomocnicze są już odkryte. +Allows you to reveal all hidden help entries with /help_reveal=Pozwala odkryć wszystkie wpisy pomocnicze przy użyciu /help_reveal +Category list=Lista kategorii +Currently all entries in this category are hidden from you.=Aktualnie wszystkie wpisy w tej kategorii są przed tobą ukryte. +Unlock new entries by progressing in the game.=Odblokuj nowe wpisy przez robienie postępów w grze. +Help=Pomoc +Entry=Wpis +Entry list=Lista wpisów +Error: Access denied.=Błąd: Odmowa dostępu. +Error: No help available.=Błąd: Brak dostępnej pomocy. +Go to category list=Idź do listy kategorii +Go to entry list=Idź do listy wpisów +Help > @1=Pomoc > @1 +Help > @1 > @2=Pomoc > @1 > @2 +Help > @1 > (No Entry)=Pomoc > @1 > (Brak wpisu) +Help > (No Category)=Pomoc > (Brak kategorii) +Hidden entries: @1=Ukryte wpisy: @1 +Nameless entry (@1)=Nienazwany wpis (@1) +New entries: @1=Nowe wpisy: @1 +New help entry unlocked: @1 > @2=Nowy wpis pomocniczy odblokowany: @1 > @2 +No categories have been registered, but they are required to provide help.=Nie zarejestrowano żadnych kategorii, ale są one wymagane do uzyskania pomocy. +The Documentation System [doc] does not come with help contents on its own, it needs additional mods to add help content. Please make sure such mods are enabled on for this world, and try again.=System dokumentacji [doc] nie ma sam z siebie żadnej zawartości, potrzebuje dodatkowych modów, które dodadzą zawartość. +Number of entries: @1=Liczba wpisów: @1 +OK=OK +Open a window providing help entries about Minetest and more=Otwórz okno aby zobaczyć wpisy pomocnicze na temat Minetest i innych rzeczy +Please select a category you wish to learn more about:=Wybierz kategorię o której chciałbyś się więcej dowiedzieć: +Recommended mods: doc_basics, doc_items, doc_identifier, doc_encyclopedia.=Rekomendowane mody: doc_basics, doc_items, doc_identifier, doc_encyclopedia. +Reveal all hidden help entries to you=Odkryj wszystkie ukryte wpisy pomocnicze +Show entry=Pokaż wpis +Show category=Pokaż kategorię +Show next entry=Pokaż następny wpis +Show previous entry=Pokaż poprzedni wpis +This category does not have any entries.=W tej kategorii nie ma żadnych wpisów. +This category has the following entries:=W tej kategorii są następujące wpisy: +This category is empty.=Ta kategoria jest pusta. +This is the help.=To jest pomoc. +You haven't chosen a category yet. Please choose one in the category list first.=Nie wybrano żadnej kategorii. Proszę wybrać jedną z listy kategorii. +You haven't chosen an entry yet. Please choose one in the entry list first.=Nie wybrano wpisu. Proszę wybrać jeden z listy wpisów. +Collection of help texts=Kolekcja tekstów pomocniczych. +Notify me when new help is available=Powiadom mnie gdy nowa pomoc jest dostępna. +Play notification sound when new help is available=Odegraj dźwięk powiadomienia gdy nowa pomoc jest dostępna +Show previous image=Pokaż poprzedni obrazek +Show previous gallery page=Pokaż poprzednią stronę galerii +Show next image=Pokaż następny obrazek +Show next gallery page=Pokaż następną stronę galerii + diff --git a/mods/HELP/doc/doc_identifier/init.lua b/mods/HELP/doc/doc_identifier/init.lua index a3a35e2fa..c1c2043d3 100644 --- a/mods/HELP/doc/doc_identifier/init.lua +++ b/mods/HELP/doc/doc_identifier/init.lua @@ -1,4 +1,6 @@ -local S = minetest.get_translator("doc_identifier") +local S = minetest.get_translator(minetest.get_current_modname()) + +local mod_doc_basics = minetest.get_modpath("doc_basics") local doc_identifier = {} @@ -6,15 +8,16 @@ doc_identifier.registered_objects = {} -- API doc.sub.identifier = {} -doc.sub.identifier.register_object = function(object_name, category_id, entry_id) + +function doc.sub.identifier.register_object(object_name, category_id, entry_id) doc_identifier.registered_objects[object_name] = { category = category_id, entry = entry_id } end -- END OF API -doc_identifier.identify = function(itemstack, user, pointed_thing) +function doc_identifier.identify(itemstack, user, pointed_thing) local username = user:get_player_name() - local show_message = function(username, itype, param) + local function show_message(username, itype, param) local vsize = 2 local message if itype == "error_item" then @@ -24,9 +27,9 @@ doc_identifier.identify = function(itemstack, user, pointed_thing) elseif itype == "error_unknown" then vsize = vsize + 2 local mod - if param ~= nil then + if param then local colon = string.find(param, ":") - if colon ~= nil and colon > 1 then + if colon and colon > 1 then mod = string.sub(param,1,colon-1) end end @@ -36,8 +39,8 @@ doc_identifier.identify = function(itemstack, user, pointed_thing) S("• The author of the game or a mod has made a mistake") message = message .. "\n\n" - if mod ~= nil then - if minetest.get_modpath(mod) ~= nil then + if mod then + if minetest.get_modpath(mod) then message = message .. S("It appears to originate from the mod “@1”, which is enabled.", mod) message = message .. "\n" else @@ -45,7 +48,7 @@ doc_identifier.identify = function(itemstack, user, pointed_thing) message = message .. "\n" end end - if param ~= nil then + if param then message = message .. S("Its identifier is “@1”.", param) end elseif itype == "error_ignore" then @@ -66,7 +69,7 @@ doc_identifier.identify = function(itemstack, user, pointed_thing) if pointed_thing.type == "node" then local pos = pointed_thing.under local node = minetest.get_node(pos) - if minetest.registered_nodes[node.name] ~= nil then + if minetest.registered_nodes[node.name] then --local nodedef = minetest.registered_nodes[node.name] if(node.name == "ignore") then show_message(username, "error_ignore") @@ -82,14 +85,14 @@ doc_identifier.identify = function(itemstack, user, pointed_thing) local object = pointed_thing.ref local le = object:get_luaentity() if object:is_player() then - if minetest.get_modpath("doc_basics") ~= nil and doc.entry_exists("basics", "players") then + if mod_doc_basics and doc.entry_exists("basics", "players") then doc.show_entry(username, "basics", "players", true) else -- Fallback message show_message(username, "player") end -- luaentity exists - elseif le ~= nil then + elseif le then local ro = doc_identifier.registered_objects[le.name] -- Dropped items if le.name == "__builtin:item" then @@ -112,7 +115,7 @@ doc_identifier.identify = function(itemstack, user, pointed_thing) doc.show_entry(username, "nodes", itemstring, true) end -- A known registered object - elseif ro ~= nil then + elseif ro then doc.show_entry(username, ro.category, ro.entry, true) -- Undefined object (error) elseif minetest.registered_entities[le.name] == nil then @@ -195,7 +198,7 @@ minetest.register_craft({ {"group:stick", ""} } }) -if minetest.get_modpath("mcl_core") ~= nil then +if minetest.get_modpath("mcl_core") then minetest.register_craft({ output = "doc_identifier:identifier_solid", recipe = { { "mcl_core:glass" }, diff --git a/mods/HELP/doc/doc_identifier/locale/doc_identifier.pl.tr b/mods/HELP/doc/doc_identifier/locale/doc_identifier.pl.tr new file mode 100644 index 000000000..3af2c377d --- /dev/null +++ b/mods/HELP/doc/doc_identifier/locale/doc_identifier.pl.tr @@ -0,0 +1,18 @@ +# textdomain:doc_identifier +Error: This node, item or object is undefined. This is always an error.=Błąd: Ten węzeł, przedmiot lub obiekt nie jest zdefiniowany. To zawsze jest błąd. +This can happen for the following reasons:=To może się zdarzyć z następujących powodów: +• The mod which is required for it is not enabled=• Mod który jest do tego potrzebny nie jest włączony +• The author of the game or a mod has made a mistake=• Autor gry lub moda popełnił błąd +It appears to originate from the mod “@1”, which is enabled.=Wygląda na to, że powodem jest mod "@1", który jest włączony. +It appears to originate from the mod “@1”, which is not enabled!=Wygląda na to, że powodem jest mod "@1", który nie jest włączony! +Its identifier is “@1”.=Identyfikator to "@1". +Lookup Tool=Narzędzie rozpoznające +No help entry for this block could be found.=Nie znaleziono wpisu pomocniczego dla tego bloku. +No help entry for this item could be found.=Nie znaleziono wpisu pomocniczego dla tego przedmiotu. +No help entry for this object could be found.=Nie znaleziono wpisu pomocniczego dla tego obiektu. +OK=OK +Punch any block, item or other thing about you wish to learn more about. This will open up the appropriate help entry. The tool comes in two modes which are changed by using. In liquid mode, this tool points to liquids as well while in solid mode this is not the case.=Uderz dowolny blok, przedmiot lub inną rzecz aby dowiedzieć się o niej czegoś. To otworzy odpowiedni wpis pomocniczy. Narzędzie jest dostępne w dwóch trybach które można zmienić przez kliknięcie Użyj. W trybie płynów narzędzie to wskazuje również na płyny, podczas gdy w trybie stałym tak nie jest. +This block cannot be identified because the world has not materialized at this point yet. Try again in a few seconds.=Ten blok nie może być zidentyfikowany, ponieważ świat jeszcze się nie zmaterializował. Spróbuj ponownie za kilka sekund. +This is a player.=To jest gracz. +This useful little helper can be used to quickly learn more about about one's closer environment. It identifies and analyzes blocks, items and other things and it shows extensive information about the thing on which it is used.=To jest małe pomocnicze narzędzie, które może być użyte by szybko dowiedzieć się więcej na temat bliskiego otoczenia. Identyfikuje ono oraz analizuje bloki, przedmioty i inne rzeczy oraz pokazuje dokładne informacje na temat tego na czym zostanie użyte. +Show help for pointed thing=Pokaż pomoc dla wskazywanej rzeczy diff --git a/mods/HELP/doc/doc_items/init.lua b/mods/HELP/doc/doc_items/init.lua index ec4da620e..325ad9abb 100644 --- a/mods/HELP/doc/doc_items/init.lua +++ b/mods/HELP/doc/doc_items/init.lua @@ -1,6 +1,12 @@ -local S = minetest.get_translator("doc_items") +local S = minetest.get_translator(minetest.get_current_modname()) local N = function(s) return s end +local math = math +local string = string + +local tostring = tostring +local pairs = pairs + doc.sub.items = {} -- Template texts @@ -34,13 +40,17 @@ local suppressed = { local forbidden_core_factoids = {} -- Helper functions -local yesno = function(bool) - if bool==true then return S("Yes") - elseif bool==false then return S("No") - else return "N/A" end +local function yesno(bool) + if bool == true then + return S("Yes") + elseif bool == false then + return S("No") + else + return "N/A" + end end -local groups_to_string = function(grouptable, filter) +local function groups_to_string(grouptable, filter) local gstring = "" local groups_count = 0 for id, value in pairs(grouptable) do @@ -50,7 +60,7 @@ local groups_to_string = function(grouptable, filter) -- List seperator gstring = gstring .. S(", ") end - if groupdefs[id] ~= nil and doc.sub.items.settings.friendly_group_names == true then + if groupdefs[id] and doc.sub.items.settings.friendly_group_names == true then gstring = gstring .. groupdefs[id] else gstring = gstring .. id @@ -66,7 +76,7 @@ local groups_to_string = function(grouptable, filter) end -- Removes all text after the first newline (including the newline) -local scrub_newlines = function(text) +local function scrub_newlines(text) local spl = string.split(text, "\n") if spl and #spl > 0 then return spl[1] @@ -76,7 +86,7 @@ local scrub_newlines = function(text) end --[[ Append a newline to text, unless it already ends with a newline. ]] -local newline = function(text) +local function newline(text) if string.sub(text, #text, #text) == "\n" or text == "" then return text else @@ -85,7 +95,7 @@ local newline = function(text) end --[[ Make sure the text ends with two newlines by appending any missing newlines at the end, if neccessary. ]] -local newline2 = function(text) +local function newline2(text) if string.sub(text, #text-1, #text) == "\n\n" or text == "" then return text elseif string.sub(text, #text, #text) == "\n" then @@ -97,7 +107,7 @@ end -- Extract suitable item description for formspec -local description_for_formspec = function(itemstring) +local function description_for_formspec(itemstring) if minetest.registered_items[itemstring] == nil then -- Huh? The item doesn't exist for some reason. Better give a dummy string minetest.log("warning", "[doc] Unknown item detected: "..tostring(itemstring)) @@ -111,26 +121,26 @@ local description_for_formspec = function(itemstring) end end -local get_entry_name = function(itemstring) +local function get_entry_name(itemstring) local def = minetest.registered_items[itemstring] - if def._doc_items_entry_name ~= nil then + if def._doc_items_entry_name then return def._doc_items_entry_name - elseif item_name_overrides[itemstring] ~= nil then + elseif item_name_overrides[itemstring] then return item_name_overrides[itemstring] else return def.description end end -doc.sub.items.get_group_name = function(groupname) - if groupdefs[groupname] ~= nil and doc.sub.items.settings.friendly_group_names == true then +function doc.sub.items.get_group_name(groupname) + if groupdefs[groupname] and doc.sub.items.settings.friendly_group_names == true then return groupdefs[groupname] else return groupname end end -local burntime_to_text = function(burntime) +local function burntime_to_text(burntime) if burntime == nil then return S("unknown") elseif burntime == 1 then @@ -146,16 +156,16 @@ end * Full punch interval * Damage groups ]] -local factoid_toolcaps = function(tool_capabilities, check_uses) +local function factoid_toolcaps(tool_capabilities, check_uses) if forbidden_core_factoids.tool_capabilities then return "" end local formstring = "" if check_uses == nil then check_uses = false end - if tool_capabilities ~= nil and tool_capabilities ~= {} then + if tool_capabilities and tool_capabilities ~= {} then local groupcaps = tool_capabilities.groupcaps - if groupcaps ~= nil then + if groupcaps then local miningcapstr = "" local miningtimesstr = "" local miningusesstr = "" @@ -164,7 +174,7 @@ local factoid_toolcaps = function(tool_capabilities, check_uses) local useslines = 0 for k,v in pairs(groupcaps) do -- Mining capabilities - local minrating, maxrating + --[[local minrating, maxrating if v.times then for rating, time in pairs(v.times) do if minrating == nil then minrating = rating else @@ -177,7 +187,7 @@ local factoid_toolcaps = function(tool_capabilities, check_uses) else minrating = 1 maxrating = 1 - end + end]] local maxlevel = v.maxlevel if not maxlevel then -- Default from tool.h @@ -188,7 +198,7 @@ local factoid_toolcaps = function(tool_capabilities, check_uses) caplines = caplines + 1 for rating=3, 1, -1 do - if v.times ~= nil and v.times[rating] ~= nil then + if v.times and v.times[rating] then local maxtime = v.times[rating] local mintime local mintimestr, maxtimestr @@ -255,7 +265,7 @@ local factoid_toolcaps = function(tool_capabilities, check_uses) -- Weapon data local damage_groups = tool_capabilities.damage_groups - if damage_groups ~= nil then + if damage_groups then formstring = formstring .. S("This is a melee weapon which deals damage by punching.") .. "\n" -- Damage groups formstring = formstring .. S("Maximum damage per hit:") .. "\n" @@ -266,7 +276,7 @@ local factoid_toolcaps = function(tool_capabilities, check_uses) -- Full punch interval local punch = 1.0 - if tool_capabilities.full_punch_interval ~= nil then + if tool_capabilities.full_punch_interval then punch = tool_capabilities.full_punch_interval end formstring = formstring .. S("Full punch interval: @1 s", string.format("%.1f", punch)) @@ -282,7 +292,7 @@ end - Digging times/groups - level group ]] -local factoid_mining_node = function(data) +local function factoid_mining_node(data) if forbidden_core_factoids.node_mining then return "" end @@ -292,7 +302,7 @@ local factoid_mining_node = function(data) -- Check if there are no mining groups at all local nogroups = true for groupname,_ in pairs(mininggroups) do - if data.def.groups[groupname] ~= nil or groupname == "dig_immediate" then + if data.def.groups[groupname] or groupname == "dig_immediate" then nogroups = false break end @@ -324,7 +334,7 @@ local factoid_mining_node = function(data) local minegroupcount = 0 for group,_ in pairs(mininggroups) do local rating = data.def.groups[group] - if rating ~= nil then + if rating then mstring = mstring .. S("• @1: @2", doc.sub.items.get_group_name(group), rating).."\n" minegroupcount = minegroupcount + 1 end @@ -344,18 +354,18 @@ local factoid_mining_node = function(data) end -- Pointing range of itmes -local range_factoid = function(itemstring, def) +local function range_factoid(itemstring, def) local handrange = minetest.registered_items[""].range local itemrange = def.range if itemstring == "" then - if handrange ~= nil then + if handrange then return S("Range: @1", itemrange) else return S("Range: 4") end else if handrange == nil then handrange = 4 end - if itemrange ~= nil then + if itemrange then return S("Range: @1", itemrange) else return S("Range: @1 (@2)", get_entry_name(""), handrange) @@ -364,14 +374,14 @@ local range_factoid = function(itemstring, def) end -- Smelting fuel factoid -local factoid_fuel = function(itemstring, ctype) +local function factoid_fuel(itemstring, ctype) if forbidden_core_factoids.fuel then return "" end local formstring = "" local result, decremented = minetest.get_craft_result({method = "fuel", items = {itemstring}}) - if result ~= nil and result.time > 0 then + if result and result.time > 0 then local base local burntext = burntime_to_text(result.time) if ctype == "tools" then @@ -392,7 +402,7 @@ local factoid_fuel = function(itemstring, ctype) end -- Shows the itemstring of an item -local factoid_itemstring = function(itemstring, playername) +local function factoid_itemstring(itemstring, playername) if forbidden_core_factoids.itemstring then return "" end @@ -405,7 +415,7 @@ local factoid_itemstring = function(itemstring, playername) end end -local entry_image = function(data) +local function entry_image(data) local formstring = "" -- No image for air if data.itemstring ~= "air" then @@ -414,7 +424,7 @@ local entry_image = function(data) formstring = formstring .. "image["..(doc.FORMSPEC.ENTRY_END_X-1)..","..doc.FORMSPEC.ENTRY_START_Y..";1,1;".. minetest.registered_items[""].wield_image.."]" -- Other items - elseif data.image ~= nil then + elseif data.image then formstring = formstring .. "image["..(doc.FORMSPEC.ENTRY_END_X-1)..","..doc.FORMSPEC.ENTRY_START_Y..";1,1;"..data.image.."]" else formstring = formstring .. "item_image["..(doc.FORMSPEC.ENTRY_END_X-1)..","..doc.FORMSPEC.ENTRY_START_Y..";1,1;"..data.itemstring.."]" @@ -432,9 +442,9 @@ factoid_generators.craftitems = {} --[[ Returns a list of all registered factoids for the specified category and type * category_id: Identifier of the Documentation System category in which the factoid appears * factoid_type: If set, oly returns factoid with a matching factoid_type. - If nil, all factoids for this category will be generated + If nil, all factoids for this category will be generated * data: Entry data to parse ]] -local factoid_custom = function(category_id, factoid_type, data) +local function factoid_custom(category_id, factoid_type, data) local ftable = factoid_generators[category_id] local datastring = "" -- Custom factoids are inserted here @@ -450,17 +460,17 @@ local factoid_custom = function(category_id, factoid_type, data) end -- Shows core information shared by all items, to be inserted at the top -local factoids_header = function(data, ctype) +local function factoids_header(data, ctype) local datastring = "" if not forbidden_core_factoids.basics then local longdesc = data.longdesc local usagehelp = data.usagehelp - if longdesc ~= nil then + if longdesc then datastring = datastring .. S("Description: @1", longdesc) datastring = newline2(datastring) end - if usagehelp ~= nil then + if usagehelp then datastring = datastring .. S("Usage help: @1", usagehelp) datastring = newline2(datastring) end @@ -484,7 +494,7 @@ local factoids_header = function(data, ctype) datastring = datastring .. S("This item points to liquids.").."\n" end end - if data.def.on_use ~= nil then + if data.def.on_use then if ctype == "nodes" then datastring = datastring .. S("Punches with this block don't work as usual; melee combat and mining are either not possible or work differently.").."\n" elseif ctype == "tools" then @@ -510,7 +520,7 @@ local factoids_header = function(data, ctype) end -- Shows less important information shared by all items, to be inserted at the bottom -local factoids_footer = function(data, playername, ctype) +local function factoids_footer(data, playername, ctype) local datastring = "" datastring = datastring .. factoid_custom(ctype, "groups", data) datastring = newline2(datastring) @@ -518,7 +528,7 @@ local factoids_footer = function(data, playername, ctype) -- Show other “exposable” groups if not forbidden_core_factoids.groups then local gstring, gcount = groups_to_string(data.def.groups, miscgroups) - if gstring ~= nil then + if gstring then if gcount == 1 then if ctype == "nodes" then datastring = datastring .. S("This block belongs to the @1 group.", gstring) .. "\n" @@ -577,11 +587,8 @@ doc.add_category("nodes", { description = S("Item reference of blocks and other things which are capable of occupying space"), build_formspec = function(data, playername) if data then - local formstring = "" - local datastring = "" - - formstring = entry_image(data) - datastring = factoids_header(data, "nodes") + local formstring = entry_image(data) + local datastring = factoids_header(data, "nodes") local liquid = data.def.liquidtype ~= "none" and minetest.get_item_group(data.itemstring, "fake_liquid") == 0 if not forbidden_core_factoids.basics then @@ -600,7 +607,7 @@ doc.add_category("nodes", { datastring = datastring .. S("This block is a liquid with these properties:") .. "\n" local range, renew, viscos if data.def.liquid_range then range = data.def.liquid_range else range = 8 end - if data.def.liquid_renewable ~= nil then renew = data.def.liquid_renewable else renew = true end + if data.def.liquid_renewable then renew = data.def.liquid_renewable else renew = true end if data.def.liquid_viscosity then viscos = data.def.liquid_viscosity else viscos = 0 end if renew then datastring = datastring .. S("• Renewable") .. "\n" @@ -620,7 +627,7 @@ doc.add_category("nodes", { --- Direct interaction with the player ---- Damage (very important) if not forbidden_core_factoids.node_damage then - if data.def.damage_per_second ~= nil and data.def.damage_per_second > 1 then + if data.def.damage_per_second and data.def.damage_per_second > 1 then datastring = datastring .. S("This block causes a damage of @1 hit points per second.", data.def.damage_per_second) .. "\n" elseif data.def.damage_per_second == 1 then datastring = datastring .. S("This block causes a damage of @1 hit point per second.", data.def.damage_per_second) .. "\n" @@ -633,7 +640,7 @@ doc.add_category("nodes", { end end local fdap = data.def.groups.fall_damage_add_percent - if fdap ~= nil and fdap ~= 0 then + if fdap and fdap ~= 0 then if fdap > 0 then datastring = datastring .. S("The fall damage on this block is increased by @1%.", fdap) .. "\n" elseif fdap <= -100 then @@ -655,11 +662,11 @@ doc.add_category("nodes", { datastring = datastring .. S("This block can be climbed.").."\n" end local bouncy = data.def.groups.bouncy - if bouncy ~= nil and bouncy ~= 0 then + if bouncy and bouncy ~= 0 then datastring = datastring .. S("This block will make you bounce off with an elasticity of @1%.", bouncy).."\n" end local slippery = data.def.groups.slippery - if slippery ~= nil and slippery ~= 0 then + if slippery and slippery ~= 0 then datastring = datastring .. S("This block is slippery.") .. "\n" end datastring = datastring .. factoid_custom("nodes", "movement", data) @@ -759,7 +766,7 @@ doc.add_category("nodes", { datastring = newline2(datastring) --- List nodes/groups to which this node connects to - if not forbidden_core_factoids.connects_to and data.def.connects_to ~= nil then + if not forbidden_core_factoids.connects_to and data.def.connects_to then local nodes = {} local groups = {} for c=1,#data.def.connects_to do @@ -774,7 +781,7 @@ doc.add_category("nodes", { local nstring = "" for n=1,#nodes do local name - if item_name_overrides[nodes[n]] ~= nil then + if item_name_overrides[nodes[n]] then name = item_name_overrides[nodes[n]] else name = description_for_formspec(nodes[n]) @@ -782,7 +789,7 @@ doc.add_category("nodes", { if n > 1 then nstring = nstring .. S(", ") end - if name ~= nil then + if name then nstring = nstring .. name else nstring = nstring .. S("Unknown Node") @@ -813,9 +820,9 @@ doc.add_category("nodes", { datastring = newline2(datastring) -- Non-default drops - if not forbidden_core_factoids.drops and data.def.drop ~= nil and data.def.drop ~= data.itemstring and data.itemstring ~= "air" then + if not forbidden_core_factoids.drops and data.def.drop and data.def.drop ~= data.itemstring and data.itemstring ~= "air" then -- TODO: Calculate drop probabilities of max > 1 like for max == 1 - local get_desc = function(stack) + local function get_desc(stack) return description_for_formspec(stack:get_name()) end if data.def.drop == "" then @@ -831,10 +838,10 @@ doc.add_category("nodes", { datastring = datastring .. S("This block will drop the following when mined: @1.", desc).."\n" end end - elseif type(data.def.drop) == "table" and data.def.drop.items ~= nil then + elseif type(data.def.drop) == "table" and data.def.drop.items then local max = data.def.drop.max_items local dropstring = "" - local dropstring_base = "" + local dropstring_base if max == nil then dropstring_base = N("This block will drop the following items when mined: @1.") elseif max == 1 then @@ -852,7 +859,7 @@ doc.add_category("nodes", { local rarity_history = {} for i=1,#data.def.drop.items do local local_rarity = data.def.drop.items[i].rarity - local chance = 1 + local chance local rarity = 1 if local_rarity == nil then local_rarity = 1 @@ -885,7 +892,7 @@ doc.add_category("nodes", { if chance > 0 then probtable = {} probtable.items = {} - for j=1,#data.def.drop.items[i].items do + for j = 1, #data.def.drop.items[i].items do local dropstack = ItemStack(data.def.drop.items[i].items[j]) local itemstring = dropstack:get_name() local desc = get_desc(dropstack) @@ -907,7 +914,7 @@ doc.add_category("nodes", { -- Do some cleanup of the probability table if max == 1 or max == nil then -- Sort by rarity - local comp = function(p1, p2) + local function comp(p1, p2) return p1.rarity < p2.rarity end table.sort(probtables, comp) @@ -937,7 +944,6 @@ doc.add_category("nodes", { end local rarity = probtable.rarity - local raritystring = "" -- No percentage if there's only one possible guaranteed drop if not(rarity == 1 and #data.def.drop.items == 1) then local chance = (1/rarity)*100 @@ -957,7 +963,7 @@ doc.add_category("nodes", { dropstring = dropstring .. dropstring_this pcount = pcount + 1 end - if max ~= nil and max > 1 then + if max and max > 1 then datastring = datastring .. S(dropstring_base, max, dropstring) else datastring = datastring .. S(dropstring_base, dropstring) @@ -992,15 +998,15 @@ doc.add_category("tools", { if entries[2].eid == "" then return false end local comp = {} - for e=1, 2 do + for e = 1, 2 do comp[e] = {} end -- No tool capabilities: Instant loser - if entries[1].data.def.tool_capabilities == nil and entries[2].data.def.tool_capabilities ~= nil then return false end - if entries[2].data.def.tool_capabilities == nil and entries[1].data.def.tool_capabilities ~= nil then return true end + if entries[1].data.def.tool_capabilities == nil and entries[2].data.def.tool_capabilities then return false end + if entries[2].data.def.tool_capabilities == nil and entries[1].data.def.tool_capabilities then return true end -- No tool capabilities for both: Compare by uses if entries[1].data.def.tool_capabilities == nil and entries[2].data.def.tool_capabilities == nil then - for e=1, 2 do + for e = 1, 2 do if type(entries[e].data.def._doc_items_durability) == "number" then comp[e].uses = entries[e].data.def._doc_items_durability else @@ -1055,7 +1061,7 @@ doc.add_category("tools", { comp[e].count = groupcount comp[e].group = group comp[e].mintime = mintime - if realuses ~= nil then + if realuses then comp[e].uses = realuses elseif type(entries[e].data.def._doc_items_durability) == "number" then comp[e].uses = entries[e].data.def._doc_items_durability @@ -1086,11 +1092,8 @@ doc.add_category("tools", { end, build_formspec = function(data, playername) if data then - local formstring = "" - local datastring = "" - - formstring = entry_image(data) - datastring = factoids_header(data, "tools") + local formstring = entry_image(data) + local datastring = factoids_header(data, "tools") -- Overwritten durability info if type(data.def._doc_items_durability) == "number" then @@ -1120,11 +1123,8 @@ doc.add_category("craftitems", { description = S("Item reference of items which are neither blocks, tools or weapons (esp. crafting items)"), build_formspec = function(data, playername) if data then - local formstring = "" - local datastring = "" - - formstring = entry_image(data) - datastring = factoids_header(data, "craftitems") + local formstring = entry_image(data) + local datastring = factoids_header(data, "craftitems") datastring = datastring .. factoids_footer(data, playername, "craftitems") formstring = formstring .. doc.widgets.text(datastring, nil, nil, doc.FORMSPEC.ENTRY_WIDTH - 1.2) @@ -1166,9 +1166,9 @@ local function gather_descs() -- 1st pass: Gather groups of interest for id, def in pairs(minetest.registered_items) do -- Gather all groups used for mining - if def.tool_capabilities ~= nil then + if def.tool_capabilities then local groupcaps = def.tool_capabilities.groupcaps - if groupcaps ~= nil then + if groupcaps then for k,v in pairs(groupcaps) do if mininggroups[k] ~= true then mininggroups[k] = true @@ -1179,7 +1179,7 @@ local function gather_descs() -- ... and gather all groups which appear in crafting recipes local crafts = minetest.get_all_craft_recipes(id) - if crafts ~= nil then + if crafts then for c=1,#crafts do for k,v in pairs(crafts[c].items) do if string.sub(v,1,6) == "group:" then @@ -1194,7 +1194,7 @@ local function gather_descs() end -- ... and gather all groups used in connects_to - if def.connects_to ~= nil then + if def.connects_to then for c=1, #def.connects_to do if string.sub(def.connects_to[c],1,6) == "group:" then local group = string.sub(def.connects_to[c],7,-1) @@ -1213,7 +1213,7 @@ local function gather_descs() else help.longdesc["air"] = S("A transparent block, basically empty space. It is usually left behind after digging something.") end - if minetest.registered_items["ignore"]._doc_items_create_entry ~= nil then + if minetest.registered_items["ignore"]._doc_items_create_entry then suppressed["ignore"] = minetest.registered_items["ignore"]._doc_items_create_entry == true end @@ -1242,23 +1242,23 @@ local function gather_descs() }) end - local add_entries = function(deftable, category_id) + local function add_entries(deftable, category_id) for id, def in pairs(deftable) do local name, ld, uh, im local forced = false - if def._doc_items_create_entry == true and def ~= nil then forced = true end + if def._doc_items_create_entry == true and def then forced = true end name = get_entry_name(id) if not (((def.description == nil or def.description == "") and def._doc_items_entry_name == nil) or (def._doc_items_create_entry == false) or (suppressed[id] == true)) or forced then if def._doc_items_longdesc then ld = def._doc_items_longdesc end - if help.longdesc[id] ~= nil then + if help.longdesc[id] then ld = help.longdesc[id] end if def._doc_items_usagehelp then uh = def._doc_items_usagehelp end - if help.usagehelp[id] ~= nil then + if help.usagehelp[id] then uh = help.usagehelp[id] end if def._doc_items_image then @@ -1307,13 +1307,13 @@ local function reveal_item(playername, itemstring) if itemstring == nil or itemstring == "" or playername == nil or playername == "" then return false end - if minetest.registered_nodes[itemstring] ~= nil then + if minetest.registered_nodes[itemstring] then category_id = "nodes" - elseif minetest.registered_tools[itemstring] ~= nil then + elseif minetest.registered_tools[itemstring] then category_id = "tools" - elseif minetest.registered_craftitems[itemstring] ~= nil then + elseif minetest.registered_craftitems[itemstring] then category_id = "craftitems" - elseif minetest.registered_items[itemstring] ~= nil then + elseif minetest.registered_items[itemstring] then category_id = "craftitems" else return false @@ -1333,7 +1333,7 @@ end minetest.register_on_dignode(function(pos, oldnode, digger) if digger == nil then return end local playername = digger:get_player_name() - if playername ~= nil and playername ~= "" and oldnode ~= nil then + if playername and playername ~= "" and oldnode then reveal_item(playername, oldnode.name) reveal_items_in_inventory(digger) end @@ -1342,7 +1342,7 @@ end) minetest.register_on_punchnode(function(pos, node, puncher, pointed_thing) if puncher == nil then return end local playername = puncher:get_player_name() - if playername ~= nil and playername ~= "" and node ~= nil then + if playername and playername ~= "" and node then reveal_item(playername, node.name) end end) @@ -1350,7 +1350,7 @@ end) minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack, pointed_thing) if placer == nil then return end local playername = placer:get_player_name() - if playername ~= nil and playername ~= "" and itemstack ~= nil and not itemstack:is_empty() then + if playername and playername ~= "" and itemstack and not itemstack:is_empty() then reveal_item(playername, itemstack:get_name()) end end) @@ -1358,7 +1358,7 @@ end) minetest.register_on_craft(function(itemstack, player, old_craft_grid, craft_inv) if player == nil then return end local playername = player:get_player_name() - if playername ~= nil and playername ~= "" and itemstack ~= nil and not itemstack:is_empty() then + if playername and playername ~= "" and itemstack and not itemstack:is_empty() then reveal_item(playername, itemstack:get_name()) end end) @@ -1370,7 +1370,7 @@ minetest.register_on_player_inventory_action(function(player, action, inventory, if action == "take" or action == "put" then itemstack = inventory_info.stack end - if itemstack ~= nil and playername ~= nil and playername ~= "" and (not itemstack:is_empty()) then + if itemstack and playername and playername ~= "" and (not itemstack:is_empty()) then reveal_item(playername, itemstack:get_name()) end end) @@ -1378,9 +1378,9 @@ end) minetest.register_on_item_eat(function(hp_change, replace_with_item, itemstack, user, pointed_thing) if user == nil then return end local playername = user:get_player_name() - if playername ~= nil and playername ~= "" and itemstack ~= nil and not itemstack:is_empty() then + if playername and playername ~= "" and itemstack and not itemstack:is_empty() then reveal_item(playername, itemstack:get_name()) - if replace_with_item ~= nil then + if replace_with_item then reveal_item(playername, replace_with_item) end end @@ -1390,10 +1390,12 @@ minetest.register_on_joinplayer(function(player) reveal_items_in_inventory(player) end) ---[[ Periodically check all items in player inventory and reveal them all. +--[[ +Periodically check all items in player inventory and reveal them all. TODO: Check whether there's a serious performance impact on servers with many players. -TODO: If possible, try to replace this functionality by updating the revealed items as - soon the player obtained a new item (probably needs new Minetest callbacks). ]] +TODO: If possible, try to replace this functionality by updating the revealed items as soon the player obtained a new item (probably needs new Minetest callbacks). +]] + local checktime = 8 local timer = 0 minetest.register_globalstep(function(dtime) diff --git a/mods/HELP/doc/doc_items/locale/doc_items.fr.tr b/mods/HELP/doc/doc_items/locale/doc_items.fr.tr index 5d655404d..824ceeeba 100644 --- a/mods/HELP/doc/doc_items/locale/doc_items.fr.tr +++ b/mods/HELP/doc/doc_items/locale/doc_items.fr.tr @@ -2,7 +2,7 @@ Using it as fuel turns it into: @1.=L'utiliser comme combustible le transforme en : @1. @1 seconds=@1 secondes # Item count times item name -%@1×@2=%@1×@ +@1×@2=@1×@ # Itemname (25%) @1 (@2%)=@1 (@2%) # Itemname (<0.5%) diff --git a/mods/HELP/doc/doc_items/locale/doc_items.pl.tr b/mods/HELP/doc/doc_items/locale/doc_items.pl.tr new file mode 100644 index 000000000..8ff945368 --- /dev/null +++ b/mods/HELP/doc/doc_items/locale/doc_items.pl.tr @@ -0,0 +1,144 @@ +# textdomain:doc_items +Using it as fuel turns it into: @1.=Używanie tego jako paliwa zamienia to w: @1. +@1 seconds=@1 sekund(y) +# Item count times item name +@1×@2=@1×@2 +# Itemname (25%) +@1 (@2%)=@1 (@2%) +# Itemname (<0.5%) +@1 (<0.5%)=@1 (<0.5%) +# Itemname (ca. 25%) +@1 (ca. @2%)=@1 (ca. @2%) +# List separator (e.g. “one, two, three”) +, =, +# Final list separator (e.g. “One, two and three”) + and = oraz +1 second=1 sekunda +A transparent block, basically empty space. It is usually left behind after digging something.=Przezroczysty blok, praktycznie puste miejsce. Jest zwykle pozostawiany po wykopaniu czegoś. +Air=Powietrze +Blocks=Bloki +Building another block at this block will place it inside and replace it.=Postawienie innego bloku w tym bloku postawi ich wewnątrz i zastąpi go. +Building this block is completely silent.=Budowanie tego bloku jest bezgłośne. +Collidable: @1=Zderzalne: @1 +Description: @1=Opis: @1 +Falling blocks can go through this block; they destroy it when doing so.=Spadające bloki mogą przelecieć przez ten blok; niszczą go gdy tak robią. +Full punch interval: @1 s=Pełny okres uderzenia: @1 s +Hand=Ręka +Hold it in your hand, then leftclick to eat it.=Weź to do ręki, następnie kliknij lewy przycisk by je zjeść. +Hold it in your hand, then leftclick to eat it. But why would you want to do this?=Weź to do ręki, następnie kliknij lewy przycisk by je zjeść. Ale dlaczego chciałabyś to zrobić? +Item reference of all wieldable tools and weapons=Informacje na temat wszystkich narzędzi i broni możliwych do trzymania. +Item reference of blocks and other things which are capable of occupying space=Informacje na temat wszystkich bloków i innych obiektów, które są w stanie zajmować miejsce +Item reference of items which are neither blocks, tools or weapons (esp. crafting items)=Informacje na temat wszystkich rzeczy, które nie są blokami, narzędziami i broniami (głównie materiały do wytwarzania) +Liquids can flow into this block and destroy it.=Płyny mogą wpłynąć na ten blok i go zniszczyć. +Maximum stack size: @1=Maksymalny rozmiar grupy: @1 +Mining level: @1=Poziom kopania: @1 +Mining ratings:=Klasyfikacja kopania +• @1, rating @2: @3 s - @4 s=• @1, klasyfikacja @2: @3 s - @4 s +• @1, rating @2: @3 s=• @1, klasyfikacja @2: @3 s +Mining times:=Czas wykopania: +Mining this block is completely silent.=Wykopanie tego bloku jet bezgłośne. +Miscellaneous items=Różne rzeczy +No=Nie +Pointable: No=Wskazywalne: Nie +Pointable: Only by special items=Wskazywalne: Tylko przez specjalne przedmioty +Pointable: Yes=Wskazywalne: Tak +Punches with this block don't work as usual; melee combat and mining are either not possible or work differently.=Uderzanie tym blokiem nie działa tak jak zwykle; walka wręcz i kopanie są niemożliwe lub działają inaczej. +Punches with this item don't work as usual; melee combat and mining are either not possible or work differently.=Uderzanie tym przedmiotem nie działa tak jak zwykle; walka wręcz i kopanie są niemożliwe lub działają inaczej. +Punches with this tool don't work as usual; melee combat and mining are either not possible or work differently.=Uderzanie tym narzędziem nie działa tak jak zwykle; walka wręcz i kopanie są niemożliwe lub działają inaczej. +Range: @1=Zasięg: @1 +# Range: () +Range: @1 (@2)=Zasięg @1 (@2) +Range: 4=Zasięg: 4 +# Rating used for digging times +Rating @1=Klasyfikacja @1 +# @1 is minimal rating, @2 is maximum rating +Rating @1-@2=Klasyfikacja od @1 do @2 +The fall damage on this block is increased by @1%.=Obrażenia od upadku na tym bloku są zwiększone o @1%. +The fall damage on this block is reduced by @1%.=Obrażenia od upadku na tym bloku są zmniejszone o @1%. +This block allows light to propagate with a small loss of brightness, and sunlight can even go through losslessly.=Ten blok przepuszcza światło z niewielką stratą jasności, a światło słoneczne przepuszcza bezstratnie. +This block allows light to propagate with a small loss of brightness.=Ten blok przepuszcza światło z niewielką stratą jasności. +This block allows sunlight to propagate without loss in brightness.=Ten blok przepuszcza światło słoneczne bez straty jasności. +This block belongs to the @1 group.=Ten blok należy do grupy @1. +This block belongs to these groups: @1.=Ten blok należy do tych grup: @1. +This block can be climbed.=Na ten blok można się wspiąć. +This block can be destroyed by any mining tool immediately.=Ten blok może być zniszczony przez dowolne narzędzie do kopania natychmiastowo. +This block can be destroyed by any mining tool in half a second.=Ten blok może być zniszczony przez dowolne narzędzie do kopania w pół sekundy. +This block can be mined by any mining tool immediately.=Ten blok może być wykopany przez dowolne narzędzie do kopania natychmiastowo. +This block can be mined by any mining tool in half a second.=Ten blok może być wykopany przez dowolne narzędzie do kopania w pół sekundy. +This block can be mined by mining tools which match any of the following mining ratings and its toughness level.=Ten blok może zostać wykopany przez narzędzia do kopania, które pasują do którychkolwiek klasyfikacji kopania i poziomu twardości. +This block can not be destroyed by ordinary mining tools.=Ten blok nie może być zniszczony przez typowe narzędzia do kopania. +This block can not be mined by ordinary mining tools.=Ten blok nie może być wykopany przez typowe narzędzia do kopania. +This block can serve as a smelting fuel with a burning time of @1.=Ten blok może być wykorzystany jako paliwo do przetapiania z czasem palenia @1. +This block causes a damage of @1 hit point per second.=Ten blok zadaje @1 obrażenie na sekundę. +This block causes a damage of @1 hit points per second.=Ten blok zadaje @1 obrażeń na sekundę. +This block connects to blocks of the @1 group.=Ten blok łączy się do bloków z grupy @1. +This block connects to blocks of the following groups: @1.=Ten blok łączy się z blokami z następujących grup: @1. +This block connects to these blocks: @1.=Ten blok łączy się z tymi blokami: @1. +This block connects to this block: @1.=Ten blok łączy się z tym blokiem: @1. +This block decreases your breath and causes a drowning damage of @1 hit point every 2 seconds.=Ten blok zmniejsza twój tlen i zadaje @1 obrażenie co 2 sekundy. +This block decreases your breath and causes a drowning damage of @1 hit points every 2 seconds.=Ten blok zmniejsza twój tlen i zadaje @1 obrażeń co 2 sekundy. +This block is a light source with a light level of @1.=Ten blok jest źródłem światła z poziomem oświetlenia @1. +This block glows faintly with a light level of @1.=Ten blok ma poświatę o poziomie oświetlenia @1. +This block is a building block for creating various buildings.=Ten blok jest blokiem budowlanym do tworzenia różnych budowli. +This block is a liquid with these properties:=Ten blok jest płynem z tymi własnościami: +This block is affected by gravity and can fall.=Na ten blok wpływa grawitacja i może upaść. +This block is completely silent when mined or built.=Ten blok jest bezgłośny przy kopaniu i budowaniu. +This block is completely silent when walked on, mined or built.=Ten blok jest bezgłośny gdy się po nim chodzi, kopie lub buduje. +This block is destroyed when a falling block ends up inside it.=Ten blok jest zniszczony gdy upadający blok upadnie w niego. +This block negates all fall damage.=Ten blok neguje wszystkie obrażenia od upadku. +This block points to liquids.=Ten blok wskazuje na płyny. +This block will drop as an item when a falling block ends up inside it.=Ten blok wypadnie jako przedmiot gdy blok upadnie na niego. +This block will drop as an item when it is not attached to a surrounding block.=Ten blok wypadnie jako przedmiot gdy nie jest połączony z sąsiadującym blokiem. +This block will drop as an item when no collidable block is below it.=Ten blok wypadnie jako przedmiot gdy nie będzie pod nim zderzalnego bloku. +This block will drop the following items when mined: @1.=Z tego bloku wypadną następujące przedmioty po wykopaniu: @1. +This block will drop the following when mined: @1×@2.=Z tego bloku wypadną następujące rzeczy po wykopaniu: @1×@2. +This block will drop the following when mined: @1.=Z tego bloku wypadną następujące rzeczy po wykopaniu: @1. +This block will drop the following when mined: @1.=Z tego bloku wypadną następujące rzeczy po wykopaniu: @1. +This block will make you bounce off with an elasticity of @1%.=Od tego bloku odbijesz się z elastycznością @1%. +This block will randomly drop one of the following when mined: @1.=Z tego bloku wypadnie losowo jedna z następujących rzeczy po wykopaniu: @1. +This block will randomly drop up to @1 drops of the following possible drops when mined: @2.=Z tego bloku losowo wypadnie maksymalnie @1 rzeczy spośród tego zbioru: @2. +This block won't drop anything when mined.=Z tego bloku nic nie wypadnie po wykopaniu. +This is a decorational block.=Ten blok jest dekoracyjny. +This is a melee weapon which deals damage by punching.=To jest broń do walki wręcz, która zadaje obrażenia przy uderzaniu. +Maximum damage per hit:=Maksymalne obrażenia przy uderzeniu: +This item belongs to the @1 group.=Ten przedmiot należy do grupy @1. +This item belongs to these groups: @1.=Ten przedmiot należy do tych grup: @1. +This item can serve as a smelting fuel with a burning time of @1.=Ten przedmiot może być wykorzystany jako paliwo do przetapiania z czasem palenia @1. +This item is primarily used for crafting other items.=Ten przedmiot jest głównie wykorzystywany do wytwarzania innych przedmiotów. +This item points to liquids.=Ten przedmiot wskazuje na płyny. +This tool belongs to the @1 group.=To narzędzie należy do grupy @1. +This tool belongs to these groups: @1.=To narzędzie należy do tych grup: @1. +This tool can serve as a smelting fuel with a burning time of @1.=To narzędzie może być wykorzystany jako paliwo do przetapiania z czasem palenia @1. +This tool is capable of mining.=Tym narzędziem można kopać. +Maximum toughness levels:=Maksymalna poziom twardości: +This tool points to liquids.=To narzędzie wskazuje na płyny. +Tools and weapons=Narzędzia i bronie +Unknown Node=Nieznany węzeł +Usage help: @1=Sposób użycia: @1 +Walking on this block is completely silent.=Chodzenie po tym bloku jest bezgłośne. +Whenever you are not wielding any item, you use the hand which acts as a tool with its own capabilities. When you are wielding an item which is not a mining tool or a weapon it will behave as if it would be the hand.=Gdy nie trzymasz żadnego przedmiotu używasz swojej ręki która działa jak narzędzie ze swoimi własnościami. Gdy trzymasz przedmiot, który nie jest narzędziem do kopania lub bronią, będzie się ono zachowywało jakby było ręką. +Yes=Tak +You can not jump while standing on this block.=Nie możesz skakać gdy stoisz na tym bloku. +any level=dowolny poziom +level 0=poziom 0 +level 0-@1=poziom 0-@1 +unknown=nieznane +Unknown item (@1)=Nieznany przedmiot (@1) +• @1: @2=• @1: @2 +• @1: @2 HP=• @1: @2 HP +• @1: @2, @3=• @1: @2, @3 +• Flowing range: @1=• Zasięg płynięcia: @1 +• No flowing=• Brak płynięcia +• Not renewable=• Nieodnawialne +• Renewable=• Odnawialne +• Viscosity: @1=• Lepkość: @1 +Itemstring: "@1"=Id przedmiotu: "@1" +Durability: @1 uses=Wytrzymałość: @1 użyć +Durability: @1=Wytrzymałość: @1 +Mining durability:=Wytrzymałość kopania: +• @1, level @2: @3 uses=• @1, poziom @2: @3 użyć +• @1, level @2: Unlimited=• @1, poziom @2: Nielimitowane +This block's rotation is affected by the way you place it: Place it on the floor or ceiling for a vertical orientation; place it at the side for a horizontal orientation. Sneaking while placing it leads to a perpendicular orientation instead.=Na rotację tego bloku wpływa sposób postawienia: Postaw go na podłodze lub suficie aby uzyskać pionową orientację; postaw go na boku by uzyskać poziomą orientację. Skradanie się podczas postawiania sprawia, że zostanie postawiony prostopadle. +Toughness level: @1=Poziom twardości: @1 +This block is slippery.=Ten blok jest śliski. + diff --git a/mods/HELP/mcl_craftguide/init.lua b/mods/HELP/mcl_craftguide/init.lua index d05d8b3d0..3bc7b705a 100644 --- a/mods/HELP/mcl_craftguide/init.lua +++ b/mods/HELP/mcl_craftguide/init.lua @@ -155,7 +155,7 @@ end local custom_crafts, craft_types = {}, {} function mcl_craftguide.register_craft_type(name, def) - local func = "mcl_craftguide.register_craft_guide(): " + local func = "mcl_craftguide.register_craft_type(): " assert(name, func .. "'name' field missing") assert(def.description, func .. "'description' field missing") assert(def.icon, func .. "'icon' field missing") @@ -417,9 +417,9 @@ local function get_tooltip(item, groups, cooktime, burntime) -- and just print the normal item name without special formatting if groups[1] == "compass" or groups[1] == "clock" then groupstr = reg_items[item].description - elseif group_names[groups[1]] then + elseif g then -- Use the special group name string - groupstr = minetest.colorize(gcol, group_names[groups[1]]) + groupstr = minetest.colorize(gcol, g) else --[[ Fallback: Generic group explanation: This always works, but the internally used group name (which @@ -545,7 +545,7 @@ local function get_recipe_fs(data, iY) if custom_recipe or shapeless or recipe.type == "cooking" then local icon = custom_recipe and custom_recipe.icon or - shapeless and "shapeless" or "furnace" + shapeless and "shapeless" or "furnace" if recipe.type == "cooking" then icon = "default_furnace_front_active.png" @@ -638,7 +638,7 @@ local function make_formspec(name) fs[#fs + 1] = "background9[1,1;1,1;mcl_base_textures_background9.png;true;7]" fs[#fs + 1] = fmt([[ tooltip[size_inc;%s] - tooltip[size_dec;%s] ]], + tooltip[size_dec;%s] ]], ESC(S("Increase window size")), ESC(S("Decrease window size"))) @@ -656,9 +656,9 @@ local function make_formspec(name) ]] fs[#fs + 1] = fmt([[ tooltip[search;%s] - tooltip[clear;%s] - tooltip[prev;%s] - tooltip[next;%s] ]], + tooltip[clear;%s] + tooltip[prev;%s] + tooltip[next;%s] ]], ESC(S("Search")), ESC(S("Reset")), ESC(S("Previous page")), @@ -726,7 +726,7 @@ local function make_formspec(name) return concat(fs) end -local show_fs = function(player, name) +local function show_fs(player, name) if sfinv_only then sfinv.set_player_inventory_formspec(player) else diff --git a/mods/HELP/mcl_craftguide/locale/mcl_craftguide.pl.tr b/mods/HELP/mcl_craftguide/locale/mcl_craftguide.pl.tr new file mode 100644 index 000000000..064fd90d3 --- /dev/null +++ b/mods/HELP/mcl_craftguide/locale/mcl_craftguide.pl.tr @@ -0,0 +1,38 @@ +# textdomain: mcl_craftguide +Any shulker box=Dowolna skrzynia shulkerowa +Any wool=Dowolna wełna +Any wood planks=Dowolne deski +Any wood=Dowolne drewno +Any sand=Dowolny piasek +Any normal sandstone=Dowolny zwykły piaskowiec +Any red sandstone=Dowolny czerwony piaskowiec +Any carpet=Dowolny dywan +Any dye=Dowolna farba +Any water bucket=Dowolne wiadro wody +Any flower=Dowolny kwiat +Any mushroom=Dowolny grzyb +Any wooden slab=Dowolny drewniana płyta +Any wooden stairs=Dowolne drewniane schody +Any coal=Dowolny węgiel +Any kind of quartz block=Dowolny typ bloku kwarcu +Any kind of purpur block=Dowolny typ bloku purpury +Any stone bricks=Dowolne kamienne cegły +Any stick=Dowolny patyk +Any item belonging to the @1 group=Dowolny przedmiot z grupy @1 +Any item belonging to the groups: @1=Dowolny przedmiot należący do grup: @1 +Search=Wyszukaj +Reset=Zresetuj +Previous page=Poprzednia strona +Next page=Następna strona +Usage @1 of @2=Użycie @1 z @2 +Recipe @1 of @2=Receptura @1 z @2 +Burning time: @1=Czas wypalenia: @1 +Cooking time: @1=Czas pieczenia: @1 +Recipe is too big to be displayed (@1×@2)=Receptura jest zbyt długa do wyświetlenia (@1×@2) +Shapeless=Bezkształtne +Cooking=Pieczenie +Increase window size=Zwiększ rozmiar okna +Decrease window size=Zmniejsz rozmiar okna +No item to show=Brak przedmiotów do pokazania +Collect items to reveal more recipes=Zbierz przedmioty by odkryć więcej receptur + diff --git a/mods/HELP/mcl_doc/init.lua b/mods/HELP/mcl_doc/init.lua index d926550f8..9be688ec2 100644 --- a/mods/HELP/mcl_doc/init.lua +++ b/mods/HELP/mcl_doc/init.lua @@ -1,4 +1,4 @@ -local S = minetest.get_translator("mcl_doc") +local S = minetest.get_translator(minetest.get_current_modname()) -- Disable built-in factoids; it is planned to add custom ones as replacements doc.sub.items.disable_core_factoid("node_mining") @@ -50,8 +50,8 @@ end) doc.sub.items.register_factoid("nodes", "groups", function(itemstring, def) local formstring = "" - if def.groups.leafdecay ~= nil then - if def.drop ~= "" and def.drop ~= nil and def.drop ~= itemstring then + if def.groups.leafdecay then + if def.drop ~= "" and def.drop and def.drop ~= itemstring then formstring = S("This block quickly decays when there is no wood block of any species within a distance of @1. When decaying, it disappears and may drop one of its regular drops. The block does not decay when the block has been placed by a player.", def.groups.leafdecay) else formstring = S("This block quickly decays and disappears when there is no wood block of any species within a distance of @1. The block does not decay when the block has been placed by a player.", def.groups.leafdecay) @@ -154,7 +154,7 @@ doc.sub.items.register_factoid(nil, "use", function(itemstring, def) return s end) doc.sub.items.register_factoid(nil, "groups", function(itemstring, def) - local def = minetest.registered_items[itemstring] + --local def = minetest.registered_items[itemstring] local s = "" local use = minetest.get_item_group(itemstring, "mcl_armor_uses") local pts = minetest.get_item_group(itemstring, "mcl_armor_points") @@ -289,7 +289,7 @@ doc.sub.items.register_factoid("nodes", "drops", function(itemstring, def) local itemname = item:get_name() local itemcount = item:get_count() local idef = minetest.registered_items[itemname] - local text = "" + local text if idef.description and idef.description ~= "" then text = idef.description else @@ -399,7 +399,7 @@ doc.sub.items.register_factoid("tools", "misc", function(itemstring, def) local formstring = "" -- Weapon data local damage_groups = tool_capabilities.damage_groups - if damage_groups ~= nil and damage_groups.fleshy ~= nil then + if damage_groups and damage_groups.fleshy then formstring = formstring .. S("This is a melee weapon which deals damage by punching.") .. "\n" -- Damage groups @@ -408,7 +408,7 @@ doc.sub.items.register_factoid("tools", "misc", function(itemstring, def) -- Full punch interval local punch = 1.0 - if tool_capabilities.full_punch_interval ~= nil then + if tool_capabilities.full_punch_interval then punch = tool_capabilities.full_punch_interval end formstring = formstring .. S("Full punch interval: @1 s", string.format("%.1f", punch)) diff --git a/mods/HELP/mcl_doc/locale/mcl_doc.pl.tr b/mods/HELP/mcl_doc/locale/mcl_doc.pl.tr new file mode 100644 index 000000000..c451c8c39 --- /dev/null +++ b/mods/HELP/mcl_doc/locale/mcl_doc.pl.tr @@ -0,0 +1,80 @@ +# textdomain: mcl_doc +Water can flow into this block and cause it to drop as an item.=Woda może wpłynąć na ten blok i sprawić, że on wypadnie. +This block can be turned into dirt with a hoe.=Ten blok może być zamieniony w ziemię za pomocą motyki. +This block can be turned into farmland with a hoe.=Ten blok może być zamieniony w ziemię uprawną za pomocą motyki. +This block acts as a soil for all saplings.=Ten blok może być glebą dla wszystkich sadzonek. +This block acts as a soil for some saplings.=Ten blok może być glebą dla niektórych sadzonek. +Sugar canes will grow on this block.=Trzcina cukrowa będzie rosnąć na tym bloku. +Nether wart will grow on this block.=Netherowa brodawka będzie rosnąć na tym bloku. +This block quickly decays when there is no wood block of any species within a distance of @1. When decaying, it disappears and may drop one of its regular drops. The block does not decay when the block has been placed by a player.=Ten blok szybko zanika gdy w odległości @1 nie ma żadnego bloku drewna dowolnego rodzaju. Gdy zanika może wyrzucić z siebie jeden z przedmiotów typowo wyrzucanych. +This block quickly decays and disappears when there is no wood block of any species within a distance of @1. The block does not decay when the block has been placed by a player.=Ten blok szybko zanika gdy w odległości @1 nie ma żadnego bloku drewna dowolnego rodzaju. Ten blok nie zanika gdy został postawiony przez gracza. +This plant can only grow on grass blocks and dirt. To survive, it needs to have an unobstructed view to the sky above or be exposed to a light level of 8 or higher.=Ta roślina może rosnąć tylko na blokach trawy i ziemi. Aby przetrwać musi mieć nieblokowany dostęp do nieba powyżej lub być oświetlana światłem o poziomie 8 lub wyższym. +This plant can grow on grass blocks, podzol, dirt and coarse dirt. To survive, it needs to have an unobstructed view to the sky above or be exposed to a light level of 8 or higher.=Ta roślina może rosnąć na blokach trawy, bielicy, ziemi i twardej ziemi. Aby przetrwać musi mieć nieblokowany dostęp do nieba powyżej lub być oświetlana światłem o poziomie 8 lub wyższym. +This block is flammable.=Ten blok jest łatwopalny. +This block destroys any item it touches.=Ten blok niszczy się gdy dowolny przedmiot go dotyka. +To eat it, wield it, then rightclick.=Aby to zjeść, weź to, następnie kliknij prawy przycisk myszy. +You can eat this even when your hunger bar is full.=Możesz to zjeść nawet gdy twój pasek nasycenia jest pełny. +You cannot eat this when your hunger bar is full.=Nie możesz tego jeść gdy twój pasek nasycenia jest pełny. +To drink it, wield it, then rightclick.=Aby to wypić, weź to, następnie kliknij prawy przycisk myszy. +You cannot drink this when your hunger bar is full.=Nie możesz tego pić gdy twój pasek nasycenia jest pełny. +To consume it, wield it, then rightclick.=Aby to skonsumować, weź to, następnie kliknij prawy przycisk myszy. +You cannot consume this when your hunger bar is full.=Nie możesz tego skonsumować gdy twój pasek nasycenia jest pełny. +You have to wait for about 2 seconds before you can eat or drink again.=Musisz poczekać przez 2 sekundy zanim znów będziesz mogła jeść lub pić. +Hunger points restored: @1=Przywrócone punkty głodu: @1 +Saturation points restored: @1%.1f=Przywrócone punkty nasycenia: @1%.1f +This item can be repaired at an anvil with: @1.=Ten przedmiot może być naprawiony przy kowadle przy użyciu: @1. +This item can be repaired at an anvil with any wooden planks.=Ten przedmiot może być naprawiony przy kowadle przy użyciu desek. +This item can be repaired at an anvil with any item in the “@1” group.=Ten przedmiot może być naprawiony przy kowadle przy użyciu dowolnego przedmiotu z grupy "@1". +This item cannot be renamed at an anvil.=Ten przedmiot nie może być przemianowany przy kowadle. +This block crushes any block it falls into.=Ten blok rozbija dowolny blok na który spadnie. +When this block falls deeper than 1 block, it causes damage to any player it hits. The damage dealt is B×2−2 hit points with B @= number of blocks fallen. The damage can never be more than 40 HP.=Gdy ten blok spada więcej niż o 1 blok, zadaje on obrażenia dowolnemu graczowi którego uderzy. Zadaje on B×2−2 punktów obrażeń, gdzie B @= liczba bloków o który spadł. +Diamond Pickaxe=Diamentowy kilof +Iron Pickaxe=Żelazny kilof +Stone Pickaxe=Kamienny kilof +Golden Pickaxe=Złoty kilof +Wooden Pickaxe=Drewniany kilof +Diamond Axe=Diamentowa siekiera +Iron Axe=Żelazna siekiera +Stone Axe=Kamienna siekiera +Golden Axe=Złota siekiera +Wooden Axe=Drewniana siekiera +Diamond Shovel=Diamentowa łopata +Iron Shovel=Żelazna łopata +Stone Shovel=Kamienna łopata +Golden Shovel=Złota łopata +Wooden Shovel=Drewniana łopata +This block can be mined by any tool instantly.=Ten blok może zostać wykopany dowolnym narzędziem natychmiastowo. +This block can be mined by:=Ten blok może być wykopany przy użyciu: +Hardness: ∞=Twardość: ∞ +Hardness: @1=Twardość: @1 +This block will not be destroyed by TNT explosions.=Ten blok nie będzie zniszczony przez eksplozję trotylu. +This block drops itself when mined by shears.=Ten blok wyrzuca siebie gdy wykopany nożycami. +@1×@2=@1×@2 +This blocks drops the following when mined by shears: @1=Ten blok wyrzuca siebie gdy wykopany nożycami. +, =, +• Shears=• Nożyce +• Sword=• Miecz +• Hand=• Ręka +This is a melee weapon which deals damage by punching.=To jest broń ręczna która zadaje obrażenia przy uderzenia. +Maximum damage: @1 HP=Maksymalne obrażenia: @1 HP +Full punch interval: @1 s=Pełny okres uderzenia: @1 s +This tool is capable of mining.=To narzędzie jest w stanie kopać. +Mining speed: @1=Szybkość kopania: @1 +Painfully slow=Boleśnie powolne +Very slow=Bardzo wolne +Slow=Wolne +Fast=Szybkie +Very fast=Bardzo szybkie +Extremely fast=Ekstremalnie szybkie +Instantaneous=Natychmiastowe +@1 uses=@1 użyć +Unlimited uses=Nielimitowane użycia +Block breaking strength: @1=Siła niszczenia bloku: @1 +Mining durability: @1=Wytrzymałość kopania: @1 +Armor points: @1=Punkty zbroi: @1 +Armor durability: @1=Wytrzymałość zbroi: @1 +It can be worn on the head.=Może być noszony na głowie. +It can be worn on the torso.=Może być noszone na piersi. +It can be worn on the legs.=Może być noszony na nogach. +It can be worn on the feet.=Może być noszony na stopach. + diff --git a/mods/HELP/mcl_doc_basics/init.lua b/mods/HELP/mcl_doc_basics/init.lua index e700e82bd..45ce75877 100644 --- a/mods/HELP/mcl_doc_basics/init.lua +++ b/mods/HELP/mcl_doc_basics/init.lua @@ -2,7 +2,7 @@ Basic help for MCL2. Fork of doc_basics ]] -local S = minetest.get_translator("mcl_doc_basics") +local S = minetest.get_translator(minetest.get_current_modname()) doc.add_category("basics", { diff --git a/mods/HELP/mcl_doc_basics/locale/mcl_doc_basics.pl.tr b/mods/HELP/mcl_doc_basics/locale/mcl_doc_basics.pl.tr new file mode 100644 index 000000000..37fe955ca --- /dev/null +++ b/mods/HELP/mcl_doc_basics/locale/mcl_doc_basics.pl.tr @@ -0,0 +1,512 @@ +# textdomain: mcl_doc_basics +Basics=Podstawy +Everything you need to know to get started with playing=Wszystko co musisz wiedzieć by zacząć grać +Advanced usage=Zaawansowane użycie +Advanced information which may be nice to know, but is not crucial to gameplay=Zaawansowane informacje które mogą być przydatne, ale nie są niezbędne podczas grania +Quick start=Szybki start +This is a very brief introduction to the basic gameplay:=Jest to bardzo krótki wstęp do podstawowej rozgrywki: +Basic controls:=Podstawowe sterowanie: +• Move mouse to look=• Porusz myszą by się rozglądać +• [W], [A], [S] and [D] to move=• Użyj [W], [A], [S] i [D] aby się poruszać +• [E] to sprint=• Użyj [E] aby biegać +• [Space] to jump or move upwards=• Użyj [Spacja] aby skakać lub poruszać się w górę +• [Shift] to sneak or move downwards=• Użyj [Shift] aby się skradać lub poruszać w dół +• Mouse wheel or [1]-[9] to select item=• Użyj kółka myszy lub klawiszy [1]-[9] aby wybrać przedmiot +• Left-click to mine blocks or attack=• Kliknij lewym przyciskiem by kopać bloki lub atakować +• Recover from swings to deal full damage=• Poczekaj aż ochłoniesz po zamachu, aby zadać pełne obrażenia +• Right-click to build blocks and use things=• Kliknij prawym przyciskiem aby kłaść bloki lub używać rzeczy +• [I] for the inventory=• Użyj [I] aby otworzyć ekwipunek +• First items in inventory appear in hotbar below=• Pierwsze przedmioty w ekwipunku pojawią się w pasku szybkiego dostępu +• Lowest row in inventory appears in hotbar below=• Najniższy wiersz ekwipunku pojawi się w pasku szybkiego dostępu +• [Esc] to close this window=• Użyj [Esc] aby zamknąć okno +How to play:=Jak grać: +• Punch a tree trunk until it breaks and collect wood=• Uderzaj pień drzewa aż się zniszczy i zbierz drewno +• Place the wood into the 2×2 grid (your “crafting grid”) in your inventory menu and craft 4 wood planks=• Umieść drewno w siatce 2×2 (twojej "siatce do wytwarzania") w twoim ekwipunku i wytwórz 4 deski +• Place them in a 2×2 shape in the crafting grid to craft a crafting table=• Umieść je w kształt 2×2 w twojej siatce do wytwarzania i wytwórz stół rzemieślniczy +• Place the crafting table on the ground=• Umieść stół rzemieślniczy na ziemi +• Rightclick it for a 3×3 crafting grid=• Kliknij go prawym przyciskiem aby zyskać dostęp do siatki 3×3 +• Use the crafting guide (book icon) to learn all the possible crafting recipes=• Użyj przewodnika do wytwarzania (ikona książki) aby poznać wszystkie możliwe receptury do wytwarzania +• Craft a wooden pickaxe so you can dig stone=• Wytwórz drewniany kilof aby wykopać kamień +• Different tools break different kinds of blocks. Try them out!=• Różne narzędzia są w stanie zniszczyć różne typy bloków. Wypróbuj je! +• Read entries in this help to learn the rest=• Przeczytaj inne wpisy aby dowiedzieć się resztę +• Continue playing as you wish. There's no goal. Have fun!=• Graj tak jak chcesz. Nie ma żadnego celu. Miłej zabawy! +Minetest=Minetest +Minetest is a free software game engine for games based on voxel gameplay, inspired by InfiniMiner, Minecraft, and the like. Minetest was originally created by Perttu Ahola (alias “celeron55”).=Minetest jest wolnym oprogramowaniem i silnikiem do gier opartych o rozgrywkę na voxelach, inspirowanym przez InfiniMinera, Minecrafta i podobnym. Minetest był oryginalnie stworzony przez Perttu Ahola (alias “celeron55”). +The player is thrown into a huge world made out of cubes or blocks. These cubes usually make the landscape they blocks can be removed and placed almost entirely freely. Using the collected items, new tools and other items can be crafted. Games in Minetest can, however, be much more complex than this.=Gracz jest wrzucony do ogromnego świata stworzonego z sześcianów lub bloków. Te sześciany zwykle tworzą widoczny krajobraz i mogą być usuwane oraz stawiane niemal całkowicie dowolnie. Korzystając z zebranych przedmiotów nowe narzędzia i inne rzeczy mogą zostać utworzone. Gry w Minetest mogą jednak być dużo bardziej skomplikowane niż to. +A core feature of Minetest is the built-in modding capability. Mods modify existing gameplay. They can be as simple as adding a few decorational blocks or be very complex by e.g. introducing completely new gameplay concepts, generating a completely different kind of world, and many other things.=Główną cechą Minetesta jest wbudowana możliwość budowania. Mody modyfikują istniejącą rozgrywkę. Mogą być tak proste jak dodanie kilku bloków dekoracyjnych, lub bardzo skomplikowane np. wprowadzając zupełnie nowe sposoby rozgrywki, generując zupełnie inny rodzaj świata i wiele innych rzeczy. +Minetest can be played alone or online together with multiple players. Online play will work out of the box with any mods, with no need for additional software as they are entirely provided by the server.=W Minetest można grać samotnie lub online z kilkoma graczami. Gra online będzie działać od razu z modami, bez potrzeby dodatkowych programów jako, że są one całkowicie dostarczane przez serwer. +Minetest is usually bundled with a simple default game, named “Minetest Game” (shown in images 1 and 2). You probably already have it. Other games for Minetest can be downloaded from the official Minetest forums .=Minetest jest zwykle dystrybuowany wraz z prostą domyślną grą, nazwaną "Gra Minetest" (pokazana na obrazka 1 i 2). Prawdopodobnie już ją masz. Inne gry dla Minetesta mogą być pobrane z oficjalnych forum Minetesta . +Minetest as well as Minetest Game are both unfinished at the moment, so please forgive us when not everything works out perfectly.=Zarówno Minetest jak i Gra Minetest są aktualnie niedokończone, więc prosimy o wybaczenie jeśli nie wszystkie rzeczy działają idealnie. +Sneaking=Skradanie +Sneaking makes you walk slower and prevents you from falling off the edge of a block.=Skradanie sprawia, że chodzisz wolniej i zapobiega spadaniu z bloków. +To sneak, hold down the sneak key (default: [Shift]). When you release it, you stop sneaking. Careful: When you release the sneak key at a ledge, you might fall!=Aby się skradać przytrzymaj przycisk skradania (domyślnie: [Shift]). Gdy go puścisz, przestaniesz się skradać. Ostrożnie: Jeśli puścisz przycisk skradania na krawędzi możesz spaść! +• Sneak: [Shift]=• Skradanie: [Shift] +Sneaking only works when you stand on solid ground, are not in a liquid and don't climb.=Skradanie działa tylko gdy stoisz na stałym gruncie, nie w wodzie oraz nie podczas wspinania. +If you jump while holding the sneak key, you also jump slightly higher than usual.=Jeśli skoczysz podczas skradania, skoczysz nieco wyżej niż zwykle. +Sneaking might be disabled by mods. In this case, you still walk slower by sneaking, but you will no longer be stopped at ledges.=Skradanie może być wyłączone przez mody. W takim przypadku wciąż będziesz chodziła wolniej przy skradaniu, ale wciąż będziesz mogła spaść z bloków. +Controls=Sterowanie +These are the default controls:=To jest domyślne sterowanie: +Basic movement:=Podstawy poruszania: +• Moving the mouse around: Look around=• Poruszanie myszką: Rozglądnij się +• W: Move forwards=• W: Idź naprzód +• A: Move to the left=• A: Idź w lewo +• D: Move to the right=• D: Idź w prawo +• S: Move backwards=• S: Idź w tył +• E: Sprint=• E: Biegnij +While standing on solid ground:=Podczas stania na stałym gruncie: +• Space: Jump=• Spacja: Skok +• Shift: Sneak=• Shift: Skradanie +While on a ladder, swimming in a liquid or fly mode is active=Podczas wspinania, pływania w płynie lub aktywnego trybu latania: +• Space: Move up=• Spacja: W górę +• Shift: Move down=• Shift: W dół +Extended movement (requires privileges):=Rozszerzone poruszanie: +• J: Toggle fast mode, makes you run or fly fast (requires “fast” privilege)=• J: Przełącz tryb szybki, co umożliwia szybkie bieganie i latanie (wymaga przywileju "fast") +• K: Toggle fly mode, makes you move freely in all directions (requires “fly” privilege)=• K: Przełącz tryb latania, co umożliwia swobodne poruszanie w dowolnym kierunku (wymaga przywileju "fly") +• H: Toggle noclip mode, makes you go through walls in fly mode (requires “noclip” privilege)=• H: Przełącz tryb noclip, co umożliwia przechodzenie przez ściany w trybie latania (wymaga przywileju "noclip") +• E: Move even faster when in fast mode=• E: Poruszaj się jeszcze szybciej w trybie szybkim +• E: Walk fast in fast mode=• Poruszaj się szybciej w trybie szybkim +World interaction:=Interakcja ze światem: +• Left mouse button: Punch / mine blocks / take items=• Lewy przycisk myszy: Uderz / kop bloki / weź przedmiot +• Left mouse button: Punch / mine blocks=• Lewy przycisk myszy: Uderz / kop bloki +• Right mouse button: Build or use pointed block=• Prawy przycisk myszy: Zbuduj lub użyj wskazywany blok +• Shift+Right mouse button: Build=• Shift+Prawy przycisk myszy: Zbuduj +• Roll mouse wheel: Select next/previous item in hotbar=• Kręć kółkiem myszy: Wybierz następny/poprzedni przedmiot w pasku szybkiego dostępu +• Roll mouse wheel / B / N: Select next/previous item in hotbar=• Kręć kółkiem myszy / B / N: Wybierz następny/poprzedni przedmiot w pasku szybkiego dostępu +• 1-9: Select item in hotbar directly=• 1-9: Wybierz przedmiot z pasku szybkiego dostępu +• Q: Drop item stack=• Q: Wyrzuć grupę przedmiotów +• Shift+Q: Drop 1 item=• Shift+Q: Wyrzuć jeden przedmiot +• I: Show/hide inventory menu=• I: Pokaż/schowaj menu ekwipunku +Inventory interaction:=Interakcja z ekwipunkiem: +See the entry “Basics > Inventory”.=Zobacz wpis "Podstawy > Ekwipunek". +Camera:=Kamera: +• Z: Zoom=• Z: Przybliż +• F7: Toggle camera mode=• F7: Zmień tryb kamery +• F8: Toggle cinematic mode=• F8: Zmień na tryb kinowy +Interface:=Interfejs: +• Esc: Open menu window (pauses in single-player mode) or close window=• Esc: Otwórz okno menu (zatrzymuje grę w trybie pojedynczego gracza) lub zamknij okno +• F1: Show/hide HUD=• F1: Pokaż/ukryj interfejs +• F2: Show/hide chat=• F2: Pokaż/ukryj czat +• F9: Toggle minimap=• F9: Przełącz minimapę +• Shift+F9: Toggle minimap rotation mode=• Shift+F9: Przełącz tryb rotacji minimapy +• F10: Open/close console/chat log=• F10: Otwórz/zamknij konsolę/okno czatu +• F12: Take a screenshot=• F12: Zrób zrzut ekranu +Server interaction:=Interakcja z serwerem: +• T: Open chat window (chat requires the “shout” privilege)=• T: Otwórz okno czatu (chat wymaga przywileju "shout") +• /: Start issuing a server command=• /: Rozpocznij wpisywanie komendy serwera +Technical:=Techniczne: +• R: Toggle far view (disables all fog and allows viewing far away, can make game very slow)=• R: Przełącz tryb dalekiego widzenia (wyłącza mgłę i pozwala widzieć odległe obiekty, może znacząco spowolnić grę) +• +: Increase minimal viewing distance=• +: Zwiększ minimalny zasięg widzenia +• -: Decrease minimal viewing distance=• -: Zmniejsz minimalny zasięg widzenia +• F3: Enable/disable fog=• F3: Włącz/wyłącz mgłę +• F5: Enable/disable debug screen which also shows your coordinates=• F5: Włącz/wyłącz ekran debug'u, który pokazuje również twoje położenie +• F6: Only useful for developers. Enables/disables profiler=• F6: Przydatne tylko dla deweloperów. Włącza/wyłącza profiler +• P: Only useful for developers. Writes current stack traces=• P: Przydatne tylko dla deweloperów. Zapisuje aktualny zrzut stosu +Players=Gracze +Players (actually: “player characters”) are the characters which users control.=Gracze (właściwie "postacie graczy") są postaciami kontrolowanymi przez użytkowników. +Players are living beings. They start with a number of health points (HP) and a number of breath points (BP).=Gracze są żywymi stworzeniami. Zaczynają z pewną liczbą punktów życia (HP) oraz punktów oddechu (BP). +Players are capable of walking, sneaking, jumping, climbing, swimming, diving, mining, building, fighting and using tools and blocks.=Gracze są w stanie chodzić, skradać się, skakać, wspinać, pływać, nurkować, kopać, budować walczyć oraz korzystać z narzędzi i bloków. +Players can take damage for a variety of reasons, here are some:=Gracze mogą otrzymać obrażenia z wielu powodów, oto niektóre: +• Taking fall damage=• Obrażenia od upadku +• Touching a block which causes direct damage=• Dotknięcie bloku który zadaje obrażenia +• Drowning=• Tonięcie +• Being attacked by another player=• Zaatakowanie przez innego gracza +• Being attacked by a computer enemy=• Zaatakowanie przez przeciwnika sterowanego przez komputer +At a health of 0, the player dies. The player can just respawn in the world.=Gdy zdrowie osiągnie poziom 0, gracz umiera. Gracz może wtedy odrodzić się w świecie. +Other consequences of death depend on the game. The player could lose all items, or lose the round in a competitive game.=Inne konsekwencje śmierci zależą od gry. Gracz może stracić wszystkie przedmioty, lub stracić punkty w grze konkurencyjnej. +Some blocks reduce breath. While being with the head in a block which causes drowning, the breath points are reduced by 1 for every 2 seconds. When all breath is gone, the player starts to suffer drowning damage. Breath is quickly restored in any other block.=Niektóre bloki zmniejszają oddech. Podczas przebywania w bloku powodującym topienie się, punkty oddechu są zmniejszane o 1 co 2 sekundy. Gdy punkty oddechu się skończą, gracz zacznie otrzymywać obrażenia od tonięcia. Oddech szybko odnawia się w dowolnym innym bloku. +Damage can be disabled on any world. Without damage, players are immortal and health and breath are unimportant.=Obrażenia mogą zostać wyłączone w dowolnym świecie. Bez obrażeń gracze są nieśmiertelni, a ich życie i oddech są nieistotne. +In multi-player mode, the name of other players is written above their head.=W trybie wieloosobowym imię innych graczy jest napisane powyżej ich głów. +Items=Przedmioty +Items are things you can carry along and store in inventories. They can be used for crafting, smelting, building, mining, and more. Types of items include blocks, tools, weapons and items only used for crafting.=Przedmioty są rzeczami które możesz przenosić i przechowywać w ekwipunku. Mogą być wykorzystane do wytwarzania, przetapiania, budowania, kopania i w innych celach. Typy przedmiotów to m.in. bloki, narzędzia bronie oraz przedmioty użyteczne tylko w wytwarzaniu. +An item stack is a collection of items of the same type which fits into a single item slot. Item stacks can be dropped on the ground. Items which drop into the same coordinates will form an item stack.=Grupa przedmiotów jest zbiorem przedmiotów tego samego typu, która mieści się w jednym miejscu na przedmiot. Grupy przedmiotów mogą zostać upuszczone na ziemię. Przedmioty, które zostaną upuszczone na te same współrzędne utworzą grupę przedmiotów. +Dropped item stacks will be collected automatically when you stand close to them.=Upuszczone grupy przedmiotów zostaną podniesione automatycznie gdy staniesz w ich pobliżu. +Items have several properties, including the following:=Przedmioty mają wiele właściwości, między innymi: +• Maximum stack size: Number of items which fit on 1 item stack=• Maksymalny rozmiar grupy: Liczba przedmiotów które mieszczą się w jednej grupie +• Pointing range: How close things must be to be pointed while wielding this item=• Zasięg wskazywania: Jak blisko muszą być przedmioty aby można na nie wskazać za pomocą tego przedmiotu +• Group memberships: See “Basics > Groups”=• Przynależność do grupy: Zobacz "Podstawy > Grupy" +• May be used for crafting or cooking=• Mogą być używane do wytwarzania lub pieczenia +Tools=Narzędzia +Some items may serve as a tool when wielded. Any item which has some special use which can be directly used by its wielder is considered a tool.=Niektóre przedmioty służą jako narzędzia gdy trzyma się je w rękach. Dowolny przedmiot, który ma specjalne użycia które mogą być bezpośrednio użyte przez jego posiadacza jest uznawany za narzędzie. +A common subset of tools is mining tools. These are important to break all kinds of blocks. Weapons are a kind of tool. There are of course many other possible tools. Special actions of tools are usually done by left-click or right-click.=Częstym podzbiorem narzędzi są narzędzia do kopania. Są one istotne przy niszczeniu różnych typów bloków. Bronie są innym rodzajem narzędzia. Jest oczywiście wiele innych możliwych narzędzi. Specjalne akcje narzędzi są zwykle aktywowane przy użyciu lewego lub prawego przycisku myszy. +When nothing is wielded, players use their hand which may act as tool and weapon.=Gdy nic nie jest trzymane, gracze używają swojej ręki, która może służyć jako narzędzie i broń. +Mining tools are important to break all kinds of blocks. Weapons are another kind of tool. There are some other more specialized tools. Special actions of tools are usually done by right-click.=Narzędzia do kopania są istotne do niszczenia różnych bloków. Innym rodzajem narzędzi są bronie. Istnieją również inne, bardzie wyspecjalizowane narzędzia. Specjalne akcje narzędzi są zwykle wykonywane przy użyciu lewego oraz prawego przycisku myszy. +When nothing is wielded, players use their hand which may act as tool and weapon. The hand is capable of punching and deals minimum damage.=Gdy nic nie jest trzymane gracze używają swojej dłoni, która może służyć za narzędzie i za broń. Ręką można uderzać co zadaje minimalne obrażenia. +Many tools will wear off when using them and may eventually get destroyed. The damage is displayed in a damage bar below the tool icon. If no damage bar is shown, the tool is in mint condition. Tools may be repairable by crafting, see “Basics > Crafting”.=Wiele narzędzi będzie się zużywać podczas używania, co w końcu sprawi, że zostaną zniszczone. Zużycie jest wyświetlane jako pasek poniżej ikony narzędzia. Jeśli pasek nie jest pokazywany, narzędzie jest w idealnym stanie. Narzędzia mogą być naprawiane przez wytwarzania, zobacz "Podstawy > Wytwarzanie". +Weapons=Bronie +Some items are usable as a melee weapon when wielded. Weapons share most of the properties of tools.=Niektóre przedmioty są przydatne jako bronie wręcz gdy trzymane. Bronie mają wiele podobnych własności co narzędzia. +Melee weapons deal damage by punching players and other animate objects. There are two ways to attack:=Bronie wręcz zadają obrażenia przy uderzaniu graczy i innych obiektów. +• Single punch: Left-click once to deal a single punch=• Pojedyncze uderzenie: Kliknij lewy przycisk myszy aby wykonać jedno uderzenie +• Quick punching: Hold down the left mouse button to deal quick repeated punches=• Szybkie uderzenia: Przytrzymaj lewy przycisk myszy aby zadać szybkie, powtarzające się uderzenia +There are two core attributes of melee weapons:=Dwie istotne cechy każdej broni wręcz: +• Maximum damage: Damage which is dealt after a hit when the weapon was fully recovered=• Maksymalne obrażenia: Obrażenia zadawane gdy broń przy uderzeniu gdy broń jest całkowicie ochłonięta +• Full punch interval: Time it takes for fully recovering from a punch=• Pełny okres uderzenia: Czas który jest potrzebny do ochłonięcia broni po uderzeniu +A weapon only deals full damage when it has fully recovered from a previous punch. Otherwise, the weapon will deal only reduced damage. This means, quick punching is very fast, but also deals rather low damage. Note the full punch interval does not limit how fast you can attack.=Broń zadaje pełne obrażenia tylko gdy jest w pełni ochłonięta z poprzedniego uderzenia. W przeciwnym wypadku zadane obrażenia będą zmniejszone. To oznacza, że szybkie uderzanie jest bardzo szybkie, ale zadaje niskie obrażenia. Zauważ, że pełny okres uderzenia nie jest limitem na to jak szybko możesz atakować. +There is a rule which sometimes makes attacks impossible: Players, animate objects and weapons belong to damage groups. A weapon only deals damage to those who share at least one damage group with it. So if you're using the wrong weapon, you might not deal any damage at all.=Istnieje reguła która sprawia, że ataki są czasem niemożliwe: Gracze, ruchome obiekty i bronie należą do grup obrażeń. Broń zadaje obrażenia tylko tym, którzy należą do przynajmniej jednej z jej grup obrażeń. +Pointing=Wskazywanie +“Pointing” means looking at something in range with the crosshair. Pointing is needed for interaction, like mining, punching, using, etc. Pointable things include blocks, players, computer enemies and objects.="Wskazywanie" oznacza patrzenia na coś w zasięgu celownikiem. Wskazywanie jest wymagane podczas interakcji takich jak kopanie, uderzanie, używanie itp. Wskazywalne obiekty to między innymi bloki, gracze, przeciwnicy komputerowi i obiekty. +To point something, it must be in the pointing range (also just called “range”) of your wielded item. There's a default range when you are not wielding anything. A pointed thing will be outlined or highlighted (depending on your settings). Pointing is not possible with the 3rd person front camera.=Aby na coś wskazać musi być to w zasięgu wskazywania (zwykle nazywanym po prostu "zasięgiem") trzymanego przez ciebie przedmiotu. Gdy nic nie jest trzymane jest to zasięg domyślny. Wskazywany przedmiot będzie obrysowany lub podświetlony (w zależności od twoich ustawień). Wskazywanie nie jest możliwe gdy włączona jest przednia kamera trzecioosobowa. +A few things can not be pointed. Most blocks are pointable. A few blocks, like air, can never be pointed. Other blocks, like liquids can only be pointed by special items.=Na niektóre rzeczy nie można wskazywać. Większość bloków jest wskazywalna. Na niektóre bloki, np. powietrze, nie można wskazać. Inne bloki, takie jak płyny, mogą być wskazane tylko przy użyciu specjalnych przedmiotów. +Camera=Kamera +There are 3 different views which determine the way you see the world. The modes are:=Istnieją 3 różne widoki, które definiują w jaki sposób będziesz obserwował świat. Te widoki to: +• 1: First-person view (default)=• 1: Widok pierwszoosobowy (domyślny) +• 2: Third-person view from behind=• 2: Widok trzecioosobowy od tyłu +• 3: Third-person view from the front=• 3: Widok trzecioosobowy od przodu +You can change the camera mode by pressing [F7].=Możesz zmienić widok kamery naciskając [F7]. +You might be able to zoom with [Z] to zoom the view at the crosshair. This allows you to look further.=Możesz być w stanie przybliżać widok naciskając [Z]. To pozawala spojrzeć dalej w kierunku celownika. +Zooming is a gameplay feature that might be enabled or disabled by the game. By default, zooming is enabled when in Creative Mode but disabled otherwise.=Przybliżanie jako cecha rozgrywki może być włączone lub wyłączone przez grę. Domyślnie przybliżanie jest włączone w trybie Kreatywny i wyłączone w przeciwnym przypadku. +There is also Cinematic Mode which can be toggled with [F8]. With Cinematic Mode enabled, the camera movements become more smooth. Some players don't like it, it is a matter of taste.=Istnieje również tryb kinowy, który może być włączony naciskając [F8]. Gdy jest on włączony ruchy kamery są bardziej wygładzone. Niektórzy gracze go nie lubią, jest to kwestia gustu. +By holding down [Z], you can zoom the view at your crosshair. You need the “zoom” privilege to do this.=Przytrzymując [Z] możesz przybliżyć widok na swoim celowniku. Potrzebujesz przywileju "zoom" aby to zrobić. +• Switch camera mode: [F7]=• Zmień widok kamery: [F7] +• Toggle Cinematic Mode: [F8]=• Przełącz tryb kinowy: [F8] +• Zoom: [Z]=• Przybliż: [Z] +Blocks=Bloki +The world of MineClone 2 is made entirely out of blocks (voxels, to be precise). Blocks can be added or removed with the correct tools.=Świat MineClone 2 jest w całości złożony z bloków (a bardziej precyzyjnie voxeli). Bloki mogą być dodawane lub usuwane przy użyciu odpowiednich narzędzi. +The world is made entirely out of blocks (voxels, to be precise). Blocks can be added or removed with the correct tools.=Świat jest w całości złożony z bloków (a bardziej precyzyjnie voxeli). Bloki mogą być dodawane lub usuwane przy użyciu odpowiednich narzędzi. +Blocks can have a wide range of different properties which determine mining times, behavior, looks, shape, and much more. Their properties include:=Bloki mogą mieć wiele różnych właściwości określających czas kopania, zachowanie, wygląd, kształt i wiele więcej. Te własności to między innymi: +• Collidable: Collidable blocks can not be passed through; players can walk on them. Non-collidable blocks can be passed through freely=• Zderzalne: Przez bloki z tą własnością nie można przechodzić; gracze mogą po nich chodzić. Przez nie-zderzalne bloki można swobodnie przechodzić. +• Pointable: Pointable blocks show a wireframe or a halo box when pointed. But you will just point through non-pointable blocks. Liquids are usually non-pointable but they can be pointed at by some special tools=• Wskazywalne: Te bloki pokażą obwód lub poświatę gdy zostaną wskazane. Ale przez niewskazywalne bloki będziesz wskazywała bloki znajdujące się za nimi. Płyny są zwykła niewskazywalne, ale można na nie wskazać przy użyciu specjalnych narzędzi. +• Mining properties: By which tools it can be mined, how fast and how much it wears off tools=• Własności kopania: Przez jakie narzędzia mogą być wykopane, jak szybko oraz jak bardzo zużyje to narzędzie +• Climbable: While you are at a climbable block, you won't fall and you can move up and down with the jump and sneak keys=• Wspinaczkowe: Gdy jesteś obok bloków wspinaczkowych nie spadniesz, oraz możesz poruszać się w górę i w dół korzystając z przycisków do skakania i skradania. +• Drowning damage: See the entry “Basics > Player”=• Obrażenia tonięcia: Zobacz wpis "Podstawy > Gracz" +• Liquids: See the entry “Basics > Liquids”=• Płyny: Zobacz wpis "Podstawy > Płyny" +• Group memberships: Group memberships are used to determine mining properties, crafting, interactions between blocks and more=• Przynależność do grup: Przynależności do grup definiują własności kopania, wytwarzania, interakcje między blokami i wiele więcej +Mining=Kopanie +Mining (or digging) is the process of breaking blocks to remove them. To mine a block, point it and hold down the left mouse button until it breaks.=Kopanie (lub wydobywanie) jest procesem niszczenia i usuwania bloków. Aby wykopać blok, wskaż na niego i przytrzymaj lewy przycisk myszy aż się zniszczy. +Blocks require a mining tool to be mined. Different blocks are mined by different mining tools, and some blocks can not be mined by any tool. Blocks vary in hardness and tools vary in strength. Mining tools will wear off over time. The mining time and the tool wear depend on the block and the mining tool. The fastest way to find out how efficient your mining tools are is by just trying them out on various blocks. Any items you gather by mining will drop on the ground, ready to be collected.=Bloki wymagają narzędzi do kopania aby je wykopać. Różne bloki są wykopywane przez różne narzędzia, a niektóre nie mogą być wykopane przez żadne narzędzie. Najszybszym sposobem testowania jak efektowne są twoje narzędzia do kopania jest po prostu wypróbowanie ich na różnych blokach. Wszystkie przedmioty które wykopiesz zostaną upuszczone na ziemię, gotowe do podniesienia. +After mining, a block may leave a “drop” behind. This is a number of items you get after mining. Most commonly, you will get the block itself. There are other possibilities for a drop which depends on the block type. The following drops are possible:=Po wykopaniu, blok może upuścić "zrzut". Jest to kilka przedmiotów zdobytych przez kopanie. Najczęściej będzie to wykopany blok. Możliwe są inne zrzuty zależne od typu bloku. Następujące zrzuty są możliwe: +• Always drops itself (the usual case)=• Zawsze wyrzuca siebie (typowy przypadek) +• Always drops the same items=• Zawsze wyrzuca te same przedmioty +• Drops items based on probability=• Wyrzuca przedmioty z pewnym prawdopodobieństwem +• Drops nothing=• Nie wyrzuca niczego +Building=Budowanie +Almost all blocks can be built (or placed). Building is very simple and has no delay.=Prawie wszystkie bloki mogą być zbudowane (lub postawione). Stawianie jest bardzo proste i natychmiastowe. +To build your wielded block, point at a block in the world and right-click. If this is not possible because the pointed block has a special right-click action, hold down the sneak key before right-clicking.=Aby postawić trzymany blok, wskaż na blok w świecie i kliknij prawy przycisk. Jeśli jest to niemożliwe, ponieważ wskazany blok ma specjalną akcję aktywowaną prawym przyciskiem myszy, przytrzymaj przycisk skradania przed kliknięciem prawego przycisku. +Blocks can almost always be built at pointable blocks. One exception are blocks attached to the floor; these can only be built on the floor.=Bloki prawie zawsze mogą być zbudowane na wskazywalnych blokach. Jednym z wyjątków są bloki przyczepione do podłogi; takie mogą być zbudowane tylko na podłodze. +Normally, blocks are built in front of the pointed side of the pointed block. A few blocks are different: When you try to build at them, they are replaced.=Zwykle, bloki są zbudowane przed wskazaną stroną wskazanego bloki. Niektóre bloki są inne: Gdy próbujesz na nich coś postawić są one tym zastępowane. +Liquids=Płyny +Liquids are special dynamic blocks. Liquids like to spread and flow to their surrounding blocks. Players can swim and drown in them.=Płyny są specjalnymi dynamicznymi blokami. Płyny lubią się rozprzestrzeniać i wpływać na otaczające bloki. Gracze mogą w nich pływać i tonąć. +Liquids usually come in two forms: In source form (S) and in flowing form (F).=Płyny zwykle pojawiają się w dwóch formach: W formie źródła (S) oraz w formie bieżącej (F). +Liquid sources have the shape of a full cube. A liquid source will generate flowing liquids around it from time to time, and, if the liquid is renewable, it also generates liquid sources. A liquid source can sustain itself. As long it is left alone, a liquid source will normally keep its place and does not drain out.=Źródła płynów są w kształcie pełnej kostki. Źródło płynu od czasu do czasu wygeneruje bieżący formę płynu w swoim otoczeniu oraz jeśli płyn jest odnawialny, utworzy również źródła płynu. Źródło płynu podtrzymuje siebie. Tak długo jak nie jest ruszane, źródło wody zostanie w miejscu i nie kończy się. +Flowing liquids take a sloped form. Flowing liquids spread around the world until they drain. A flowing liquid can not sustain itself and always comes from a liquid source, either directly or indirectly. Without a liquid source, a flowing liquid will eventually drain out and disappear.=Bieżące płyny przyjmują formę ściętą. Rozprzestrzeniają się one po świecie dopóki się nie wyczerpią. Bieżący płyn nie podtrzymuje sam siebie i zawsze powstaje ze źródła płynu, bezpośrednio lub pośrednio. Bez źródła płynu, płyn bieżący prędzej czy później wyczerpie się i zniknie. +All liquids share the following properties:=Wszystkie płyny mają następujące własności: +• All properties of blocks (including drowning damage)=• Wszystkie własności bloków (włączając w to obrażenia od tonięcia) +• Renewability: Renewable liquids can create new sources=• Odnawialność: Odnawialne płyny mogą tworzyć nowe źródła +• Flowing range: How many flowing liquids are created at maximum per liquid source, it determines how far the liquid will spread. Possible are ranges from 0 to 8. At 0, no flowing liquids will be created. Image 5 shows a liquid of flowing range 2=• Zasięg płynięcia: Ile maksymalnie płynów bieżących jest utworzonych przez źródło płynu. Definiuje to jak daleko płyn może się rozprzestrzenić. Możliwe wartości są od 0 do 8. Przy 0, żadne płyny bieżące nie będą utworzone. Obrazek 5 pokazuje płyn z zasięgiem płynięcia 2 +• Viscosity: How slow players move through it and how slow the liquid spreads=• Lepkość: Jak wolno gracze poruszają się przez niego i jak wolno płyn się rozprzestrzenia +Renewable liquids create new liquid sources at open spaces (image 2). A new liquid source is created when:=Odnawialne płyny mogą tworzyć nowe źródła płynów w wolnej przestrzeni (obrazek 2). Nowe źródło płynu jest tworzone gdy: +• Two renewable liquid blocks of the same type touch each other diagonally=• Dwa odnawialne źródła płynów tego samego typu stykają się po przekątnej +• These blocks are also on the same height=• Bloki te są na tej samej wysokości +• One of the two “corners” is open space which allows liquids to flow in=• Jeden z dwóch "rogów" jest wolną przestrzenią gdzie może wpłynąć płyn +When those criteria are met, the open space is filled with a new liquid source of the same type (image 3).=Gdy te kryteria są spełnione, wolna przestrzeń jest zapełniona źródłem płynu tego samego typu (obrazek 3). +Swimming in a liquid is fairly straightforward: The usual direction keys for basic movement, the jump key for rising and the sneak key for sinking.=Pływanie w płynie jest całkiem proste: Klawisze chodzenia powodują ruch w danym kierunku, przycisk skakania powoduje wznoszenia, a skradania opadanie. +The physics for swimming and diving in a liquid are:=Fizyka pływania i nurkowania w płynach jest następująca: +• The higher the viscosity, the slower you move=• Im wyższa lepkość, tym wolniej się poruszasz +• If you rest, you'll slowly sink=• Jeśli się nie ruszasz, będziesz powoli opadała +• There is no fall damage for falling into a liquid as such=• Nie ma obrażeń od upadku gdy wpadniesz do płynu +• If you fall into a liquid, you will be slowed down on impact (but don't stop instantly). Your impact depth is determined by your speed and the liquid viscosity. For a safe high drop into a liquid, make sure there is enough liquid above the ground, otherwise you might hit the ground and take fall damage=• Gdy wpadasz do płynu będziesz spowolniona przy zetknięciu (ale nie natychmiast). Zanurzenie po upadku jest ustalane na podstawie twojej szybkości oraz lepkości płynu. Żeby bezpiecznie skoczyć do płynu, upewnij się, że jest go wystarczająco dużo nad ziemię. W przeciwnym wypadku możesz uderzyć w ziemię i otrzymać obrażenia od upadku. +Liquids are often not pointable. But some special items are able to point all liquids.=Płyny są zwykle niewskazywalne, ale niektóre specjalne przedmioty mogą wskazywać na płyny. +Crafting=Wytwarzanie +Crafting is the task of combining several items to form a new item.=Wytwarzanie jest procesem łączenia i przetwarzania przedmiotów aby utworzyć nowy przedmiot. +To craft something, you need one or more items, a crafting grid (C) and a crafting recipe. A crafting grid is like a normal inventory which can also be used for crafting. Items need to be put in a certain pattern into the crafting grid. Next to the crafting grid is an output slot (O). Here the result will appear when you placed items correctly. This is just a preview, not the actual item. Crafting grids can come in different sizes which limits the possible recipes you can craft.=Aby coś wytworzyć potrzebujesz jednego lub więcej przedmiotów, siatki do wytwarzania oraz receptury. Siatka do wytwarzania jest jak zwykły ekwipunek, który może być użyty do wytwarzania. Przedmioty muszą być ułożone w konkretny wzór w siatce do wytwarzania. Obok siatki wytwarzania jest miejsce wyjściowe (O). Tutaj pojawi się rezultat gdy poprawnie umieścisz przedmioty. Jest to tylko podgląd, a nie faktyczny przedmiot. Siatki do wytwarzania mogą mieć różne rozmiary, co ogranicza liczbę receptur które możesz wytworzyć. +To complete the craft, take the result item from the output slot, which will consume items from the crafting grid and creates a new item. It is not possible to place items into the output slot.=Aby zakończyć wytwarzanie zabierze wynikowy przedmiot z miejsca wyjściowego. Skonsumuje to przedmioty z siatki do wytwarzania i utworzy nowy przedmiot. Nie da się umieszczać przedmiotów w miejscu wyjściowym. +A description on how to craft an item is called a “crafting recipe”. You need this knowledge to craft. There are multiple ways to learn crafting recipes. One way is by using a crafting guide, which contains a list of available crafting recipes. Some games provide crafting guides. There are also some mods which you can download online for installing a crafting guide. Another way is by reading the online manual of the game (if one is available).=Opis w jaki sposób uzyskać dany przedmiot nazywa się "recepturą wytwarzania". Potrzebujesz tej wiedzy do wytwarzania. Jest kilka sposobów by je poznać. Jednym z nich jest korzystanie z przewodnika do wytwarzania, który zawiera listę dostępnych receptur do wytwarzania. Niektóre gry dostarczają takie przewodniki. Istnieją także mody, które możesz pobrać z internetu dodające przewodniki. Innym sposobem jest przeczytanie instrukcji gry w internecie (jeśli taka jest dostępna). +Crafting recipes consist of at least one input item and exactly one stack of output items. When performing a single craft, it will consume exactly one item from each stack of the crafting grid, unless the crafting recipe defines replacements.=Receptury do wytwarzania składają się z przynajmniej jednego przedmiotu na wejściu i dokładnie jednej grupy przedmiotów wyjściowych. Podczas dokonywania pojedynczego wytwarzania skonsumowany zostanie dokładnie jeden przedmiot z każdej grupy w siatce wytwarzania, chyba, że receptura definiuje zamienniki. +There are multiple types of crafting recipes:=Istnieje kilka typów receptur: +• Shaped (image 2): Items need to be placed in a particular shape=• Kształtne (obrazek 2): Przedmioty muszą być ułożone w konkretny kształt +• Shapeless (images 3 and 4): Items need to be placed somewhere in input (both images show the same recipe)=• Bezkształtne (obrazki 3 i 4): Przedmioty muszą być ułożone gdzieś w wejściu (oba obrazki pokazują tę samą recepturę) +• Cooking: Explained in “Basics > Cooking”=• Pieczenie: Wyjaśnione w "Podstawy > Pieczenie" +• Repairing (image 5): Place two damaged tools into the crafting grid anywhere to get a tool which is repaired by 5%=• Naprawianie (obrazek 5): Postaw dwa uszkodzone narzędzia w siatce do wytwarzania w dowolnym miejscu aby uzyskać narzędzie naprawione o 5% +In some crafting recipes, some input items do not need to be a concrete item, instead they need to be a member of a group (see “Basics > Groups”). These recipes offer a bit more freedom in the input items. Images 6-8 show the same group-based recipe. Here, 8 items of the “stone” group are required, which is true for all of the shown items.=W niektórych recepturach, niektóre przedmioty wejściowe nie muszą być konkretnymi przedmiotami, tylko przynależeć do pewnej grupy (zobacz "Podstawy > Grupy"). Te receptury są nieco mniej restrykcyjne jeśli chodzi o wejściowe przedmioty. Obrazki 6-8 pokazują tę samą recepturę opartą o grupy. W tym przypadku 8 przedmiotów z grupy "kamień" są potrzebne, a wszystkie pokazane przedmioty do niej należą. +Rarely, crafting recipes have replacements. This means, whenever you perform a craft, some items in the crafting grid will not be consumed, but instead will be replaced by another item.=Czasami, receptury mają zamienniki. To oznacza, że po wykonaniu przetwarzania, niektóre przedmioty w siatce nie będą skonsumowane, a jedynie zamienione w inny przedmiot. +Cooking=Pieczenie +Cooking (or smelting) is a form of crafting which does not involve a crafting grid. Cooking is done with a special block (like a furnace), an cookable item, a fuel item and time in order to yield a new item.=Pieczenie (lub przetapianie) jest formą wytwarzania, która nie wymaga siatki do wytwarzania. Pieczenie jest wykonywane przy użyciu specjalnego bloku (np. pieca), przedmiotu który można upiec, paliwa oraz czasu potrzebnego na uzyskanie nowego przedmiotu. +Each fuel item has a burning time. This is the time a single item of the fuel keeps a furnace burning.=Każdy przedmiot będący paliwem ma czas wypalania. Jest to czas przez jaki pojedynczy przedmiot tego paliwa utrzymuje piec zapalony. +Each cookable item requires time to be cooked. This time is specific to the item type and the item must be “on fire” for the whole cooking time to actually yield the result.=Każdy przedmiot możliwy do upieczenia potrzebuje czasu by zostać upieczony. Czas ten jest przypisany do typu przedmiotu i każdy przedmiot musi być "na ogniu" przez cały ten czas by uzyskać przedmiot wynikowy. +Hotbar=Pasek szybkiego dostępu +At the bottom of the screen you see some squares. This is called the “hotbar”. The hotbar allows you to quickly access the first items from your player inventory.=Na dole swojego ekwipunku możesz zobaczyć kwadraty. To nazywa się "pasek szybkiego dostępu". Pozwala on na szybki dostęp do pierwszych przedmiotów z twojego ekwipunku. +You can change the selected item with the mouse wheel or the keyboard.=Możesz zmieniać wybrany przedmiot przy użyciu kółka myszy lub klawiatury. +• Select previous item in hotbar: [Mouse wheel up] or [B]=• Wybierz poprzedni przedmiot w pasku: [Kółko myszy w górę] lub [B] +• Select next item in hotbar: [Mouse wheel down] or [N]=• Wybierz następny przedmiot w pasku: [Kółko myszy w dół] lub [N] +• Select item in hotbar directly: [1]-[9]=• Wybierz bezpośrednio przedmiot w pasku: [1]-[9] +The selected item is also your wielded item.=Wybrany przedmiot jest również przedmiotem, który trzymasz. +Minimap=Minimapa +If you have a map item in any of your hotbar slots, you can use the minimap.=Jeśli masz przedmiot mapy w którymś z twoich miejsc na pasku szybkiego dostępu, możesz korzystać z minimapy. +Press [F9] to make a minimap appear on the top right. The minimap helps you to find your way around the world. Press it again to select different minimap modes and zoom levels. The minimap also shows the positions of other players.=Naciśnij [F9] aby minimapa pojawiła się w prawym górnym rogu. Minimapa pomoże ci odnaleźć się w świecie. Naciśnij [F9] ponownie aby wybrać inny tryb minimapy i stopień przybliżenia. Minimapa pokazuje również pozycję innych graczy. +There are 2 minimap modes and 3 zoom levels.=Są 2 tryby minimapy oraz 3 stopnie przybliżenia. +Surface mode (image 1) is a top-down view of the world, roughly resembling the colors of the blocks this world is made of. It only shows the topmost blocks, everything below is hidden, like a satellite photo. Surface mode is useful if you got lost.=Tryb powierzchni (obrazek 1) jest widokiem z lotu ptaka na świat, mniej więcej odzwierciedlającym kolory bloków z których stworzony jest świat. Pokazuje tylko najwyżej położone bloki, wszystko poniżej jest ukryte, podobnie jak zdjęcie satelitarne. Tryb ten jest przydatny gdy się zgubisz. +Radar mode (image 2) is more complicated. It displays the “denseness” of the area around you and changes with your height. Roughly, the more green an area is, the less “dense” it is. Black areas have many blocks. Use the radar to find caverns, hidden areas, walls and more. The rectangular shapes in image 2 clearly expose the position of a dungeon.=Tryb radaru (obrazek 2) jest bardziej skomplikowany. Pokazuje "gęstość" obszaru wokół ciebie i zmienia się z wysokością. Z grubsza, im bardziej zielony jest obszar, ty mniej "gęsty" jest. Czarne obszary mają wiele bloków. Użyj tego trybu by znaleźć jaskinie, ukryte obszary, ściany i więcej. Prostokątne kształty w obrazku 2 wyraźnie ujawniają pozycję lochów. +There are also two different rotation modes. In “square mode”, the rotation of the minimap is fixed. If you press [Shift]+[F9] to switch to “circle mode”, the minimap will instead rotate with your looking direction, so “up” is always your looking direction.=Istnieją również dwa różne tryby rotacji. W "trybie kwadratowym" rotacja minimapy jest ustalona. Jeśli naciśniesz [Shift]+[F9] aby zmienić na "tryb okręgu", minimapy będzie natomiast obracać się wraz z twoim kierunkiem patrzenia. +In some games, the minimap may be disabled.=W niektórych grach minimapa może być wyłączona. +• Toggle minimap mode: [F9]=• Przełącz tryb minimapy: [F9] +• Toggle minimap rotation mode: [Shift]+[F9]=• Przełącz tryb rotacji minimapy: [Shift]+[F9] +Inventory=Ekwipunek +Inventories are used to store item stacks. There are other uses, such as crafting. An inventory consists of a rectangular grid of item slots. Each item slot can either be empty or hold one item stack. Item stacks can be moved freely between most slots.=Ekwipunki są wykorzystywane do przechowywania grup przedmiotów. Mogą być również wykorzystywane w innych celach, np. wytwarzanie. Ekwipunek składa się z prostokątnej siatki miejsc na przedmioty. Każde miejsce na przedmioty może być puste lub zapełnione jedną grupą przedmiotów. Grupy przedmiotów można dowolnie przenosić pomiędzy miejscami. +You have your own inventory which is called your “player inventory”, you can open it with the inventory key (default: [I]). The first inventory slots are also used as slots in your hotbar.=Posiadasz swój własny ekwipunek nazywany "ekwipunkiem gracza", możesz go otworzyć klikając przycisk inwentarza (domyślnie: [I]). Pierwsze miejsca ekwipunku są również wykorzystywane jako miejsca na pasku szybkiego dostępu. +Blocks can also have their own inventory, e.g. chests and furnaces.=Bloki mogą mieć swój własny ekwipunek, np. skrzynie lub piece. +Inventory controls:=Sterowanie w ekwipunku +Taking: You can take items from an occupied slot if the cursor holds nothing.=Zabieranie: Możesz zabierać przedmioty z zajętego miejsca jeśli na kursorze niczego nie ma. +• Left click: take entire item stack=• Lewy przycisk: weź całą grupę przedmiotów +• Right click: take half from the item stack (rounded up)=• Prawy przycisk: weź połowę przedmiotów z grupy (zaokrąglone w górę) +• Middle click: take 10 items from the item stack=• Środkowy przycisk: weź 10 przedmiotów z grupy +• Mouse wheel down: take 1 item from the item stack=• Kółko myszy w dół: Weź 1 przedmiot z grupy +Putting: You can put items onto a slot if the cursor holds 1 or more items and the slot is either empty or contains an item stack of the same item type.=Wstawianie: Możesz wstawić przedmioty w miejsce jeśli na kursorze jest przynajmniej 1 przedmiot, a wskazane miejsce jest puste lub zawiera grupę przedmiotów tego samego typu. +• Left click: put entire item stack=• Lewy przycisk: Wstaw całą grupę przedmiotów +• Right click: put 1 item of the item stack=• Prawy przycisk: Wstaw 1 przedmiot z grupy +• Right click or mouse wheel up: put 1 item of the item stack=• Prawy przycisk lub kółko myszy w górę: Wstaw 1 przedmiot z grupy +• Middle click: put 10 items of the item stack=• Środkowy przycisk: wstaw 10 przedmiotów z grupy +Exchanging: You can exchange items if the cursor holds 1 or more items and the destination slot is occupied by a different item type.=Wymienianie: Możesz wymieniać przedmioty jeśli na kursorze jest przynajmniej jeden przedmiot, a we wskazanym miejscu znajduje się grupa innych przedmiotów. +• Click: exchange item stacks=• Kliknij: wymień grupy przedmiotów +Throwing away: If you hold an item stack and click with it somewhere outside the menu, the item stack gets thrown away into the environment.=Wyrzucanie: Jeśli trzymasz grupę przedmiotów i klikniesz poza menu ekwipunku, grupa przedmiotów zostanie wyrzucona w świat. +Quick transfer: You can quickly transfer an item stack to/from the player inventory to/from another item's inventory slot like a furnace, chest, or any other item with an inventory slot when that item's inventory is accessed. The target inventory is generally the most relevant inventory in this context.=Szybki transfer: Możesz szybko przemieszczać grupę przedmiotów z/do ekwipunku gracza do/z ekwipunku innego przedmiotu, takich jak piec, skrzynia czy innego z ekwipunkiem, gdy jego ekwipunek jest otworzony. Docelowy ekwipunek jest najczęściej najbardziej istotnym ekwipunkiem w takim kontekście. +• Sneak+Left click: Automatically transfer item stack=• Skradanie+Lewy przycisk: Automatycznie przenieś grupę przedmiotów +Online help=Pomoc online +You may want to check out these online resources related to MineClone 2.=Możesz chcieć zobaczyć na te zasoby online powiązane z MineClone 2. +MineClone 2 download and forum discussion: =MineClone 2 pobieranie oraz dyskusja na forum: +Here you find the most recent version of MineClone 2 and can discuss it.=Tutaj możesz znaleźć najnowszą wersję MineClone 2 i porozmawiać o niej +Bug tracker: =Śledzenie błędów: +Report bugs here.=Zgłaszaj tu zauważone błędy. +Minetest links:=Linki dotyczące Minetest: +You may want to check out these online resources related to Minetest:=Możesz chcieć zobaczyć te zasoby online dotyczące Minetest +Official homepage of Minetest: =Oficjalna strona Minetest: +The main place to find the most recent version of Minetest, the engine used by MineClone 2.=Miejsce gdzie można znaleźć najnowszą wersję Minetesta, silnika wykorzystywanego przez MineClone 2. +The main place to find the most recent version of Minetest.=Miejsce gdzie można znaleźć najnowszą wersję Minetesta. +Community wiki: =Wiki społeczności: +A community-based documentation website for Minetest. Anyone with an account can edit it! It also features a documentation of Minetest Game.=Utrzymywana przez społeczność dokumentacja na temat Minetest. Każdy z kontem może ją edytować! Znajduje się na niej również dokumentacja Gry Minetest. +Minetest forums: =Forum Minetest: +A web-based discussion platform where you can discuss everything related to Minetest. This is also a place where player-made mods and games are published and discussed. The discussions are mainly in English, but there is also space for discussion in other languages.=Platforma dyskusyjna, gdzie możesz porozmawiać na wszystkie tematy związane z Minetestem. Jest to również miejsce gdzie stworzone przez graczy mody i gry są publikowane i omawiane. Rozmowy są prowadzone głównie po angielsku ale jest również miejsce na rozmowy w innych językach. +Chat: =Czat: +A generic Internet Relay Chat channel for everything related to Minetest where people can meet to discuss in real-time. If you do not understand IRC, see the Community Wiki for help.=Ogólne kanał IRC na dowolny temat związany z Minetest, gdzie ludzie mogą się spotkać i rozmawiać w czasie rzeczywistym. Jeśli nie rozumiesz IRC, zobacz na Wiki społeczności by znaleźć pomoc. +Groups=Grupy +Items, players and objects (animate and inanimate) can be members of any number of groups. Groups serve multiple purposes:=Przedmioty, gracze i obiekty (ruchome i nieruchome) mogą przynależeć do dowolnej liczby grup. Grupy pełnią kilka funkcji: +• Crafting recipes: Slots in a crafting recipe may not require a specific item, but instead an item which is a member of a particular group, or multiple groups=• Receptury wytwarzania: Miejsca w recepturze mogą nie wymagać konkretnego przedmiotu, lecz przedmiotu, który przynależy do konkretnej grupy, lub kilku grup +• Digging times: Diggable blocks belong to groups which are used to determine digging times. Mining tools are capable of digging blocks belonging to certain groups=• Czas kopania: Bloki które można wykopać należą do grupy, które definiują czas ich kopania. Narzędzia do kopania są w stanie kopać przedmioty należące do pewnych grup +• Block behavior: Blocks may show a special behaviour and interact with other blocks when they belong to a particular group=• Zachowanie bloku: Bloki mogą wykazywać się pewnym zachowaniem i wchodzić w interakcję z innymi blokami gdy należą do pewnych grup +• Damage and armor: Objects and players have armor groups, weapons have damage groups. These groups determine damage. See also: “Basics > Weapons”=• Obrażenia i zbroja: Obiekty i gracze mają grupy zbroi, bronie mają grupy obrażeń. Te grupy definiują obrażenia. Zobacz również: "Podstawy > Bronie" +• Other uses=• Inne użycia +In the item help, many important groups are usually mentioned and explained.=We wpisach o przedmiotach wiele istotnych grup jest zwykle wymienionych i opisanych. +Glossary=Słowniczek +This is a list of commonly used terms:=Jest to lita często używanych terminów: +Controls:=Sterowanie: +• Wielding: Holding an item in hand=• Trzymanie: Posiadanie przedmiotu w ręce +• Pointing: Looking with the crosshair at something in range=• Wskazywanie: Patrzenie na coś w zasięgu celownikiem +• Dropping: Throwing an item or item stack to the ground=• Upuszczanie: Wyrzucenie przedmiotu lub grupy przedmiotów na ziemię +• Punching: Attacking with left-click, is also used on blocks=• Uderzanie: Atakowanie lewym przyciskiem myszy, używane również na blokach +• Sneaking: Walking slowly while (usually) avoiding to fall over edges=• Skradanie: Powolne chodzenie i (zwykle) unikanie spadania z bloków +• Climbing: Moving up or down a climbable block=• Wspinanie: Wchodzenie w górę lub schodzenie w dół po wspinaczkowych blokach +Blocks:=Bloki: +• Block: Cubes that the worlds are made of=• Blok: Kostki z którego stworzony jest świat +• Mining/digging: Using a mining tool to break a block=• Kopanie/Wydobywanie: Używanie przedmiotów do kopania do niszczenia bloków +• Building/placing: Putting a block somewhere=• Budowanie/Umieszczanie: Wstawianie gdzieś bloku +• Drop: Items you get after mining a block=• Zrzut: Przedmioty uzyskane po wykopaniu bloku +• Using a block: Right-clicking a block to access its special function=• Używanie bloku: Kliknięcie prawym przyciskiem na blok aby uruchomić jego specjalną funkcję +Items:=Przedmioty: +• Item: A single thing that players can possess=• Przedmiot: Pojedyncza rzecz, którą gracz może posiadać +• Item stack: A collection of items of the same kind=• Grupa przedmiotów: Zbiór przedmiotów tego samego typu +• Maximum stack size: Maximum amount of items in an item stack=• Maksymalny rozmiar grupy: Maksymalna liczba przedmiotów w grupie przedmiotów +• Slot / inventory slot: Can hold one item stack=• Miejsce / miejsce w ekwipunku: Może przechowywać jedną grupę przedmiotów +• Inventory: Provides several inventory slots for storage=• Ekwipunek: Dostarcza kilka miejsc w ekwipunku do przechowywania +• Player inventory: The main inventory of a player=• Ekwipunek gracza: Główny ekwipunek gracza +• Tool: An item which you can use to do special things with when wielding=• Narzędzie: Przedmiot, który można wykorzystać w specjalny sposób podczas trzymania +• Range: How far away things can be to be pointed by an item=• Zasięg: Jak dalekie rzeczy mogą być wskazane przedmiotem +• Mining tool: A tool which allows to break blocks=• Narzędzie do kopania: Narzędzie pozwalające niszczyć bloki +• Craftitem: An item which is (primarily or only) used for crafting=• Przedmiot do wytwarzania: Przedmiot który jest (głównie lub tylko) wykorzystywany do wytwarzania. +Gameplay:=Rozgrywka +• “heart”: A single health symbol, indicates 2 HP=• "serce": Pojedynczy symbol zdrowia, reprezentujący 2 HP +• “bubble”: A single breath symbol, indicates 1 BP=• "bąbel": Pojedynczy symbol oddechu, reprezentujący 1 BP +• HP: Hit point (equals half 1 “heart”)=• HP: Punkt zdrowia (równy połowie serca) +• BP: Breath point, indicates breath when diving=• BP: Punkt oddechu reprezentujący ilość powietrza podczas nurkowania +• Mob: Computer-controlled enemy=• Mob: Przeciwnik sterowany przez komputer +• Crafting: Combining multiple items to create new ones=• Wytwarzanie: Łączenie kilku przedmiotów w celu uzyskania innych +• Crafting guide: A helper which shows available crafting recipes=• Przewodnik wytwarzania: Pomocniczy spis dostępnych receptur wytwarzania +• Spawning: Appearing in the world=• Spawnowanie: Pojawienie się w świecie +• Respawning: Appearing again in the world after death=• Odradzanie: Ponownie pojawienie się w świecie po śmierci +• Group: Puts similar things together, often affects gameplay=• Grupa: Łączy podobne rzeczy razem, często wpływa na rozgrywkę +• noclip: Allows to fly through walls=• noclip: Pozwala przelatywać przez ściany +Interface=Interfejs: +• Hotbar: Inventory slots at the bottom=• Pasek szybkiego dostępu: Miejsca ekwipunku na dole ekranu +• Statbar: Indicator made out of half-symbols, used for health and breath=• Pasek statusu: Wskaźniki składające się z symboli używane dla oznaczania życia oraz oddechu +• Minimap: The map or radar at the top right=• Minimapa: Mapa lub radar w prawym górnym rogu ekranu +• Crosshair: Seen in the middle, used to point at things=• Celownik: Widoczny na środku ekranu, używany do wskazywania na rzeczy +Online multiplayer:=Gra wieloosobowa w internecie: +• PvP: Player vs Player. If active, players can deal damage to each other=• PvP: Gracz kontra Gracz. Jeśli ten tryb jest aktywny, gracze mogą zadawać sobie obrażenia +• Griefing: Destroying the buildings of other players against their will=• Griefowanie: Celowe niszczenie budynków innych graczy wbrew ich woli +• Protection: Mechanism to own areas of the world, which only allows the owners to modify blocks inside=• Ochrona: Mechanizm pozwalający wejść w posiadanie pewnych części świata, co pozwala tylko właścicielom modyfikować bloki wewnątrz +Technical terms:=Techniczne terminy: +• Minetest: This game engine=• Minetest: Ten silnik gier +• MineClone 2: What you play right now=• MineClone 2: To w co teraz grasz +• Minetest Game: A game for Minetest by the Minetest developers=• Gra Minetest: Gra w Minetest napisana przez jego twórców +• Game: A complete playing experience to be used in Minetest; such as a game or sandbox or similar=• Gra: Kompletny doświadczenie do wykorzystania w Minetest; takie jak gry, piaskownice i podobne +• Mod: A single subsystem which adds or modifies functionality; is the basic building block of games and can be used to further enhance or modify them=• Mod: Pojedynczy system, który dodaje, lub modyfikuje funkcjonalność; jest podstawowym blokiem budowalnym gier i może być wykorzystywany do dalszego urozmaicania i modyfikowania ich +• Privilege: Allows a player to do something=• Przywilej: Pozwala graczowi coś zrobić +• Node: Other word for “block”=• Węzeł: Inna nazwa na "blok" +Settings=Ustawienia +There is a large variety of settings to configure Minetest. Pretty much every aspect can be changed that way.=Jest wiele różnych ustawień pozwalających zmodyfikować działanie Minetesta. Niemal każdy aspekt może być w ten sposób zmieniony. +These are a few of the most important gameplay settings:=Oto kilka najważniejszych ustawień dotyczących rozgrywki: +• Damage enabled (enable_damage): Enables the health and breath attributes for all players. If disabled, players are immortal=• Włączone obrażenia (enable_damage): Włącza paski zdrowia i oddechu. Jeśli wyłączone, gracze są nieśmiertelni +• Creative Mode (creative_mode): Enables sandbox-style gameplay focusing on creativity rather than a challenging gameplay. The meaning depends on the game; usual changes are: Reduced dig times, easy access to almost all items, tools never wear off, etc.=• Tryb kreatywny (creative_mode): Włącza rozgrywkę w stylu piaskownicy, skupiająca się na kreatywności a nie wyzwaniach. Dokładne znaczenie zależy od gry; najczęstsze zmiany to: Zmniejszony czas kopania, łatwy dostęp do niemal wszystkich przedmiotów, narzędzie się nie wykorzystują itp. +• PvP (enable_pvp): Short for “Player vs Player”. If enabled, players can deal damage to each other=• PvP (enable_pvp): Skrót od "Player vs Player" (gracz kontra gracz). Jeśli włączone, gracze mogą zadawać sobie obrażenia +For a full list of all available settings, use the “All Settings” dialog in the main menu.=Aby zobaczyć pełną listę dostępnych ustawień, użyj przycisku "Wszystkie ustawienia" w menu głównym. +Movement modes=Tryby poruszania +You can enable some special movement modes that change how you move.=Możesz uruchomić specjalne tryby poruszania, które zmieniają sposób w jaki się przemieszczasz. +Pitch movement mode:=Alternatywny tryb poruszania bez-ważkiego: +• Description: If this mode is activated, the movement keys will move you relative to your current view pitch (vertical look angle) when you're in a liquid or in fly mode.=• Opis: Jeśli ten tryb jest włączony, klawisze ruchu będą poruszać cię prostopadle do kierunku patrzenia, gdy jesteś w płynach lub w trybie latania. +• Default key: [L]=• Domyślny przycisk: [L] +• No privilege required=• Nie potrzeba żadnego przywileju +Fast mode:=Tryb szybki: +• Description: Allows you to move much faster. Hold down the the “Use” key [E] to move faster. In the client configuration, you can further customize fast mode.=• Opis: Pozwala poruszać się znacznie szybciej. Przytrzymaj swój przycisk "Używania" [E] aby poruszać się szybciej. W konfiguracji klienta możesz dokładniej skonfigurować tryb szybki. +• Default key: [J]=• Domyślny przycisk: [J] +• Required privilege: fast=• Potrzebny przywilej: fast +Fly mode:=Tryb latania: +• Description: Gravity doesn't affect you and you can move freely in all directions. Use the jump key to rise and the sneak key to sink.=• Opis: Grawitacja przestaje na ciebie wpływać i możesz swobodnie poruszać się w dowolnym kierunku. Użyj przycisku skoku aby się wznosić, a przycisku skradania aby opadać. +• Default key: [K]=• Domyślny przycisk: [K] +• Required privilege: fly=• Potrzebny przywilej: fly +Noclip mode:=Tryb noclip: +• Description: Allows you to move through walls. Only works when fly mode is enabled, too.=• Opis: Pozwala przechodzić przez ściany. Działa tylko gdy uruchomiony jest tryb latania. +• Default key: [H]=• Domyślny przycisk: [H] +• Required privilege: noclip=• Potrzebny przywilej: noclip +Console=Konsola +With [F10] you can open and close the console. The main use of the console is to show the chat log and enter chat messages or server commands.=Naciskając [F10] możesz otworzyć i zamknąć konsolę. Głównym zastosowaniem konsoli jest wyświetlenie czatu oraz wysyłanie wiadomości lub wpisywanie komend serwera. +Using the chat or server command key also opens the console, but it is smaller and will be closed after you sent a message.=Korzystanie z przycisku czatu lub komand serwera również otwiera konsolę, będzie ona jednak mniejsza i zostanie zamknięta po wysłaniu wiadomości. +Use the chat to communicate with other players. This requires you to have the “shout” privilege.=Użyj czatu by komunikować się z innymi graczami. Wymaga to przywileju "shout". +Just type in the message and hit [Enter]. Public chat messages can not begin with “/”.=Aby to zrobić wpisz wiadomość i naciśnij [Enter]. Publiczne wiadomości nie mogą rozpoczynać się od znaku "/". +You can send private messages: Say “/msg ” in chat to send “” which can only be seen by .=Możesz wysyłać prywatne wiadomości: Napisz "/msg " w czacie aby wysłać "" widoczną tylko przez . +There are some special controls for the console:=W konsoli obowiązuje kilka specjalnych metod sterowania: +• [F10] Open/close console=• [F10] Otwórz/zamknij konsolę +• [Enter]: Send message or command=• [Enter]: Wyślij wiadomość lub komendę +• [Tab]: Try to auto-complete a partially-entered player name=• [Tab]: Spróbuj dokończyć częściowo wprowadzone imię gracza +• [Ctrl]+[Left]: Move cursor to the beginning of the previous word=• [Ctrl]+[Lewo]: Przenieś kursor na początek poprzedniego słowa +• [Ctrl]+[Right]: Move cursor to the beginning of the next word=• [Ctrl]+[Prawo]: Przenieś kursor na początek następnego słowa +• [Ctrl]+[Backspace]: Delete previous word=• [Ctrl]+[Backspace]: Usuń poprzednie słowo +• [Ctrl]+[Delete]: Delete next word=• [Ctrl]+[Delete]: Usuń następne słowo +• [Ctrl]+[U]: Delete all text before the cursor=• [Ctrl]+[U]: Usuń cały tekst przed kursorem +• [Ctrl]+[K]: Delete all text after the cursor=• [Ctrl]+[K]: Usuń cały tekst po kursorze +• [Page up]: Scroll up=• [Page up]: Przewiń do góry +• [Page down]: Scroll down=• [Page down]: Przewiń w dół +There is also an input history. Minetest saves your previous console inputs which you can quickly access later:=Istnieje również historia wprowadzania. Minetest zapisuje wprowadzone komendy, do szybkiego dostępu później: +• [Up]: Go to previous entry in history=• [Góra]: Idź do poprzedniej komendy w historii +• [Down]: Go to next entry in history=• [Dół]: Idź do następnej komendy w historii +Server commands=Komendy serwera +Server commands (also called “chat commands”) are little helpers for advanced users. You don't need to use these commands when playing. But they might come in handy to perform some more technical tasks. Server commands work both in multi-player and single-player mode.=Komendy serwera (zwane również "komendy czatu") są drobnymi pomocnymi komendami dla zaawansowanych użytkowników. Nie musisz korzystać z tych komend podczas grania, ale mogą okazać się przydatne przy wykonywaniu technicznych zadań. Działają one zarówno w grze wieloosobowej i jednoosobowej. +Server commands can be entered by players using the chat to perform a special server action. There are a few commands which can be issued by everyone, but some commands only work if you have certain privileges granted on the server. There is a small set of basic commands which are always available, other commands can be added by mods.=Komendy serwera mogą być wprowadzane przy użyciu czatu, aby wykonać akcje na serwerze. Niektóre komendy mogą być wywołane przez każdego, ale niektóre działają tylko jeśli masz przyznane przywileje na serwerze. Mały zbiór podstawowych komend dostępny jest zawsze, inne komendy mogą być dodane przez mody. +To issue a command, simply type it like a chat message or press Minetest's command key (default: [/]). All commands have to begin with “/”, for example “/mods”. The Minetest command key does the same as the chat key, except that the slash is already entered.=Aby wywołać komendę, po prostu wpisze ją jako wiadomość czatu lub kliknij przycisk komend Minetesta (domyślnie: [/]). Wszystkie komendy muszą zaczynać się od "/', np. "/mods". Przycisk komend Minetesta robi dokładnie to samo co przycisk czatu, ale "/" jest od razu wpisany. +Commands may or may not give a response in the chat log, but errors will generally be shown in the chat. Try it for yourselves: Close this window and type in the “/mods” command. This will give you the list of available mods on this server.=Komendy mogą, ale nie muszą wypisać odpowiedź w czacie, ale błędy będą zwykle pokazane w czacie. Sama spróbuj: Zamknij to okno i wpisz komendę "/mods". Ta komenda wypiszę listę dostępnych modów na tym serwerze. +“/help all” is a very important command: You get a list of all available commands on the server, a short explanation and the allowed parameters. This command is also important because the available commands often differ per server.="/help all" jest bardzo ważną komendą: Zostanie ci pokazana lista wszystkich dostępnych komend na serwerze, krótkie wyjaśnienie oraz dozwolone parametry. Ta komenda jest również ważna, ponieważ dostępne komendy będą inne w zależności od serwera. +Commands are followed by zero or more parameters.=Po komendach mogą wystąpić parametry. +In the command reference, you see some placeholders which you need to replace with an actual value. Here's an explanation:=W opisie komend możesz zobaczyć tekst zastępczy, który musisz zamienić na faktyczną wartość. Oto krótkie wyjaśnienie: +• Text in greater-than and lower-than signs (e.g. “”): Placeholder for a parameter=• Teks pomiędzy symbolami większe niż oraz mniejsze niż (np. ""): Tekst zastępczy dla parametru +• Anything in square brackets (e.g. “[text]”) is optional and can be omitted=• Cokolwiek w nawiasach kwadratowych (np. "[tekst]") jest opcjonalne i może być pominięte +• Pipe or slash (e.g. “text1 | text2 | text3”): Alternation. One of multiple texts must be used (e.g. “text2”)=• Pionowa kreska lub slesz (np. "tekst1 | tekst2 | tekst3"): Alternatywa. Jeden z wymienionych tekstów musi być użyty (np. "tekst2") +• Parenthesis: (e.g. “(word1 word2) | word3”): Groups multiple words together, used for alternations=• Nawiasy (np. "((słowo1 słowo2) | słowo3)"): Grupuje wiele słów razem, używane przy alternatywach +• Everything else is to be read as literal text=• Wszystko inne powinno być czytane jako dosłowny tekst +Here are some examples to illustrate the command syntax:=Oto kilka przykładów ilustrujących składnię komend: +• /mods: No parameters. Just enter “/mods”=• /mods: Brak parametrów. Po prostu wpisz "/mods" +• /me : 1 parameter. You have to enter “/me ” followed by any text, e.g. “/me orders pizza”=• /ja : 1 parametr. Musisz wpisać "/ja ", a następnie dowolny tekst, np. "/ja zamawiam pizzę" +• /give : Two parameters. Example: “/give Player default:apple”=• /give : Dwa parametry. Przykładowo: "/give gracz default:apple" +• /help [all|privs|]: Valid inputs are “/help”, “/help all”, “/help privs”, or “/help ” followed by a command name, like “/help time”=• /help [all|privs|]: Poprawne użycia tej komendy to "/help", "/help all", "/help privs" lub "/help ", po którym następują nazwa komendy, np. "/help mods" +• /spawnentity [,,]: Valid inputs include “/spawnentity boats:boat” and “/spawnentity boats:boat 0,0,0”=• /spawnentity [,,]: Poprawne użycia tej komendy to np. "/spawnentity boats:boat" oraz "/spawnentity boats:boat 0,0,0" +Some final remarks:=Kilka uwag na koniec: +• For /give and /giveme, you need an itemstring. This is an internally used unique item identifier which you may find in the item help if you have the “give” or “debug” privilege=• Aby użyć komend /give oraz /giveme, potrzebujesz nazwy przedmiotu. Jest to używany wewnętrznie unikalny identyfikator, który możesz znaleźć w pomocy jeśli masz przywileje "give" lub "debug" +• For /spawnentity you need an entity name, which is another identifier=• Aby użyć /spawnentity musisz znać nazwę obiektu, która podobnie jest identyfikatorem +Privileges=Przywileje +Each player has a set of privileges, which differs from server to server. Your privileges determine what you can and can't do. Privileges can be granted and revoked from other players by any player who has the privilege called “privs”.=Każdy gracz ma zbiór przywilejów, które są różne w zależności od serwera. Twoje przywileje definiują co możesz, a czego nie możesz robić. Przywileje mogą być nadane i odebrane przez dowolnego gracza, który ma przywilej "privs". +On a multiplayer server with the default configuration, new players start with the privileges called “interact” and “shout”. The “interact” privilege is required for the most basic gameplay actions such as building, mining, using, etc. The “shout” privilege allows to chat.=Na serwerze z domyślną konfiguracją nowi gracze zaczynają z przywilejami "interact" oraz "shout". Przywilej "interact" pozwala na podstawowe akcje gry takie jak budowanie, kopanie, używanie itp. Przywilej "shout" pozwala na używanie czatu. +There is a small set of core privileges which you'll find on every server, other privileges might be added by mods.=Mały zbiór bazowych przywilejów znajdziesz na każdym serwerze, inne przywileje mogą zostać dodane przez mody. +To view your own privileges, issue the server command “/privs”.=Aby zobaczyć swoje przywileje, użyj komendy serwera "/privs". +Here are a few basic privilege-related commands:=Oto kilka podstawowych komend związanych z przywilejami: +• /privs: Lists your privileges=• /privs: Pokazuje twoje przywileje +• /privs : Lists the privileges of =• /privs : Pokazuje przywileje +• /help privs: Shows a list and description about all privileges=• /help privs: Pokazuje listę i opis wszystkich przywilejów +Players with the “privs” privilege can modify privileges at will:=Gracze z przywilejem "privs" mogą zmieniać przywileje jak chcą: +• /grant : Grant to =• /grant : Nadal +• /revoke : Revoke from =• /revoke : Odbierz +In single-player mode, you can use “/grantme all” to unlock all abilities.=W trybie jednoosobowym możesz użyć "/grantme all" aby odblokować wszystkie umiejętności. +Light=Światło +As the world is entirely block-based, so is the light in the world. Each block has its own brightness. The brightness of a block is expressed in a “light level” which ranges from 0 (total darkness) to 15 (as bright as the sun).=Jako, że świat jest całkowicie oparty na blokach, jest tak również w przypadku światła. Każdy blok ma swoją własną jasność. Jasność bloku jest wyrażona w "poziomie oświetlenia", który przyjmuje wartości od 0 (zupełnie ciemny) do 15 (jasny jak słońce). +There are two types of light: Sunlight and artificial light.=Są dwa typy światła: słoneczne oraz sztuczne. +Artificial light is emitted by luminous blocks. Artificial light has a light level from 1-14.=Światło sztuczne jest emitowane przez oświetlające bloki. Sztuczne światło ma poziom oświetlenia od 1 do 14. +Sunlight is the brightest light and always goes perfectly straight down from the sky at each time of the day. At night, the sunlight will become moonlight instead, which still provides a small amount of light. The light level of sunlight is 15.=Światło słoneczne jest najjaśniejszym światłem i zawsze świeci bezpośrednio w dół w trakcie dnia. W nocy światło to zamieni się w księżycowe, które wciąż daje niewielką ilość światła. Poziom oświetlenia słonecznego jest równy 15. +Blocks have 3 levels of transparency:=Bloki mają 3 poziomy przeźroczystości: +• Transparent: Sunlight goes through limitless, artificial light goes through with losses=• Przeźroczysty: Światło słoneczne przenika bez strat, sztuczne przenika ze spadkiem +• Semi-transparent: Sunlight and artificial light go through with losses=• Półprzeźroczysty: Światło słoneczne i sztuczne przenika ze stratą jasności +• Opaque: No light passes through=• Nieprzeźroczysty: Światło nie przenika +Artificial light will lose one level of brightness for each transparent or semi-transparent block it passes through, until only darkness remains (image 1).=Światło sztuczne będzie traciło jeden poziom jasności z każdym przeźroczystym lub nieprzeźroczystym blokiem przez który przenika, dopóki nie pozostanie tylko ciemność (obrazek 1). +Sunlight will preserve its brightness as long it only passes fully transparent blocks. When it passes through a semi-transparent block, it turns to artificial light. Image 2 shows the difference.=Światło słoneczne zachowuje swoją jasność tak długo jak przenika tylko przez w pełni przeźroczyste bloki. Gdy przenika przez półprzeźroczyste bloki, zamienia się w światło sztuczne. Obrazek 2 pokazuje różnicy. +Note that “transparency” here only means that the block is able to carry brightness from its neighboring blocks. It is possible for a block to be transparent to light but you can't see trough the other side.=Zwróć uwagę, że "przeźroczystość" odnosi się tutaj tylko do możliwości przenoszenia poziomu oświetlenia z sąsiednich bloków. Jest możliwe by blok był przeźroczysty dla światła, ale nie będziesz w stanie przez niego zobaczyć. +Coordinates=Współrzędne +The world is a large cube. And because of this, a position in the world can be easily expressed with Cartesian coordinates. That is, for each position in the world, there are 3 values X, Y and Z.=Świat jest wielką kostką. I z tego powodu pozycja w świecie może być łatwo wyrażona we współrzędnych kartezjańskich. To oznacza, że dla każdej pozycji na świecie są 3 wartości X, Y oraz Z. +Like this: (5, 45, -12)=Na przykład: (5, 45, -12) +This refers to the position where X@=5, Y@=45 and Z@=-12. The 3 letters are called “axes”: Y is for the height. X and Z are for the horizontal position.=To opisuje pozycje w której X@=5, Y@=45 i Z@=-12. Te 3 litery nazywamy "osiami": Y jest wysokością, X i Z są dla pozycji poziomej. +The values for X, Y and Z work like this:=Wartości dla X, Y i Z działają następująco: +• If you go up, Y increases=• Jeśli pójdziesz w górę, Y się zwiększy +• If you go down, Y decreases=• Jeśli pójdziesz w dół, Y się zmniejszy +• If you follow the sun, X increases=• Jeśli podążysz za słońcem, X się zwiększy +• If you go to the reverse direction, X decreases=• Jeśli pójdziesz w przeciwnym kierunku, X się zmniejszy +• Follow the sun, then go right: Z increases=• Podążaj za słońcem następnie, w prawo: Z się zwiększy +• Follow the sun, then go left: Z decreases=• Podążaj za słońcem następnie, w lewo: Z się zmniejszy +• The side length of a full cube is 1=• Długość boku jednego sześcianu wynosi 1 +You can view your current position in the debug screen (open with [F5]).=Możesz zobaczyć swoją aktualną pozycję na ekranie debug (otwórz go naciskając [F5]). + +# MCL2 extensions +Creative Mode=Tryb kreatywny +Enabling Creative Mode in MineClone 2 applies the following changes:=Włączenie trybu kreatywnego w MineClone 2 aplikuje następujące zmiany: +• You keep the things you've placed=• Nie tracisz postawionych rzeczy +• Creative inventory is available to obtain most items easily=• Kreatywny ekwipunek jest dostępny, który pozwala łatwo zdobywać przedmioty +• Hand breaks all default blocks instantly=• Ręka niszczy wszystkie domyślne bloki natychmiastowo +• Greatly increased hand pointing range=• Znacząco zwiększony zasięg reki +• Mined blocks don't drop items=• Wykopane bloki nie wyrzucają zrzutu +• Items don't get used up=• Przedmioty nie zużywają się +• Tools don't wear off=• Narzędzie nie niszczą się +• You can eat food whenever you want=• Możesz jeść jedzenie kiedy tylko chcesz +• You can always use the minimap (including radar mode)=• Zawsze możesz korzystać z minimapy (włączając w to tryb radaru) +Damage is not affected by Creative Mode, it needs to be disabled separately.=Tryb kreatywny nie ma wpływu na obrażenia, muszą być wyłączone osobno. +Mobs=Moby +Mobs are the living beings in the world. This includes animals and monsters.=Moby są żyjącymi stworzeniami w świecie. To między innymi zwierzęta i potwory. +Mobs appear randomly throughout the world. This is called “spawning”. Each mob kind appears on particular block types at a given light level. The height also plays a role. Peaceful mobs tend to spawn at daylight while hostile ones prefer darkness. Most mobs can spawn on any solid block but some mobs only spawn on particular blocks (like grass blocks).=Moby pojawiają się losowo w świecie. Nazywamy to "spawnowaniem". Każdy mob pojawia się na pewnym typie bloku przy pewnym poziomie oświetlenia. Wysokość również ma znaczenie. Spokojne moby najczęściej spawnują się w świetle, podczas gdy wrogie preferują ciemność. Większość mobów spawnuje się na dowolnym stałym bloku, ale niektóre moby spawnują się tylko na konkretnych blokach (np. blokach trawy). +Like players, mobs have hit points and sometimes armor points, too (which means you need better weapons to deal any damage at all). Also like players, hostile mobs can attack directly or at a distance. Mobs may drop random items after they die.=Podobnie jak gracze, moby mają punkty życia, a czasami również zbroi (co oznacza, że będziesz potrzebował lepszych broni by zadać im obrażenia). Również podobnie jak gracze wrogie moby mogą atakować bezpośrednio lub z dystansu. Moby mogą wyrzucać losowe przedmioty przy śmierci. +Most animals roam the world aimlessly while most hostile mobs hunt players. Animals can be fed, tamed and bred.=Większość zwierząt przemieszcza się po świecie bez celu, a większość wrogich mobów poluje na gracza. Zwierzęta mogą być karmione, oswajane i rozmnażane. +Animals=Zwierzęta +Animals are peaceful beings which roam the world aimlessly. You can feed, tame and breed them.=Zwierzęta są spokojnymi mobami, które przemierzają świat bez celu. Mogą być karmione, oswajane i rozmnażane. +Feeding:=Karmienie: +Each animal has its own taste for food and doesn't just accept any food. To feed, hold an item in your hand and rightclick the animal.=Każde zwierzę ma swój własny gust w jedzeniu i nie przyjmuje byle czego. Aby nakarmić, weź przedmiot do swojej ręki i kliknij prawym przyciskiem na zwierzę. +Animals are attraced to the food they like and follow you as long you hold the food item in hand.=Zwierzęta są przyciągane do jedzenia które lubią i będą za tobą podążać tak długo jak będziesz je trzymała w dłoni. +Feeding an animal has three uses: Taming, healing and breeding.=Karmienie zwierząt a trzy zastosowania: Oswajanie, uzdrawianie i rozmnażanie. +Feeding heals animals instantly, depending on the quality of the food item.=Karmienie natychmiast uzdrawia zwierzęta w zależności od jakości. +Taming:=Oswajanie +A few animals can be tamed. You can generally do more things with tamed animals and use other items on them. For example, tame horses can be saddled and tame wolves fight on your side.=Niektóre zwierzęta mogą być oswojony. Z oswojonymi zwierzętami możesz zwykle robić więcej rzeczy i używać na nich dodatkowych przedmiotów. Przykładowo oswojone konie mogą być osiodłane, a oswojone wilki walczą po twojej stronie. +Breeding:=Rozmnażanie +When you have fed an animal up to its maximum health, then feed it again, you will activate “Love Mode” and many hearts appear around the animal.=Gdy nakarmisz zwierzę do pełnego zdrowia, a następnie nakarmisz je jeszcze raz, aktywujesz "tryb miłości" i wiele serc pojawi się wokół zwierzęcia. +Two animals of the same species will start to breed if they are in Love Mode and close to each other. Soon a baby animal will pop up.=Dwa zwierzęta tego samego gatunku będą się rozmnażać jeśli są blisko siebie i w trybie miłości. Wkrótce potem pojawi się dziecko zwierzątko. +Baby animals:=Dzieci zwierzątka +Baby animals are just like their adult couterparts, but they can't be tamed or bred and don't drop anything when they die. They grow to adults after a short time. When fed, they grow to adults faster.=Dzieci zwierzątka są takie jak ich dorosłe odpowiedniki, jednak nie mogą być oswojone i rozmnażane oraz nie wyrzucają niczego gdy umierają. Po pewnym czasie wyrastają w dorosłe zwierze. Gdy są karmione wyrastają szybciej. +Hunger=Głód +Hunger affects your health and your ability to sprint. Hunger is not in effect when damage is disabled.=Głód wpływa na twoje zdrowie i możliwość biegania. Głód jest wyłączony gdy obrażenia są wyłączone. +Core hunger rules:=Główne zasady głodu: +• You start with 20/20 hunger points (more points @= less hungry)=• Zaczynasz z 20/20 punktami głodu (więcej punktów @= mniej głodna) +• Actions like combat, jumping, sprinting, etc. decrease hunger points=• Akcje takie jak walka, skakanie, bieganie itp. zmniejszają liczbę punktów głodu +• Food restores hunger points=• Jedzenie przywraca punkty głodu +• If your hunger bar decreases, you're hungry=• Jeśli twój pasek głodu zmniejsza się, staniesz się głodna +• At 18-20 hunger points, you regenerate 1 HP every 4 seconds=• Przy 18-20 punktach głodu, będziesz regenerował 1 HP co 4 sekundy +• At 6 hunger points or less, you can't sprint=• Przy 6 punktach głodu i mniej, nie możesz biegać +• At 0 hunger points, you lose 1 HP every 4 seconds (down to 1 HP)=• Przy 0 punktach głodu i mniej, tracisz 1 HP co 4 sekundy +• Poisonous food decreases your health=• Trujące jedzenie zmniejsza twoje zdrowie +Details:=Szczegóły: +You have 0-20 hunger points, indicated by 20 drumstick half-icons above the hotbar. You also have an invisible attribute: Saturation.=Masz 0-20 punktów głodu, oznaczanych przez 20 pałek pół-ikon nad paskiem szybkiego dostępu. Posiadasz również niewidzialną własność: Nasycenie. +Hunger points reflect how full you are while saturation points reflect how long it takes until you're hungry again.=Punkty głodu pokazują jak pełna jesteś, podczas gdy punkty nasycenia mówią jak długo zajmie zanim znów będziesz głodna. +Each food item increases both your hunger level as well your saturation.=Każde jedzenie zwiększa zarówno twój poziom głodu jak i nasycenia. +Food with a high saturation boost has the advantage that it will take longer until you get hungry again.=Jedzenie z większym wzrostem nasycenia ma tę przewagę, że sprawi, że dłużej zajmie zanim znów będziesz głodna. +A few food items might induce food poisoning by chance. When you're poisoned, the health and hunger symbols turn sickly green. Food poisoning drains your health by 1 HP per second, down to 1 HP. Food poisoning also drains your saturation. Food poisoning goes away after a while or when you drink milk.=Niektóre jedzenia mogą losowo wywołać zatrucie pokarmowe. Gdy jesteś otruta symbole życia i głodu zmienią kolor na zgniło-zielony. Zatrucie pokarmowe zmniejsza twoje życie o 1 HP na sekundę aż do 1 hp. Zmniejsza ono również twoje nasycenie. Zatrucie pokarmowe przechodzi po chwili lub gdy wypijesz mleko. +You start with 5 saturation points. The maximum saturation is equal to your current hunger level. So with 20 hunger points your maximum saturation is 20. What this means is that food items which restore many saturation points are more effective the more hunger points you have. This is because at low hunger levels, a lot of the saturation boost will be lost due to the low saturation cap.=Zaczynasz z 5 punktami nasycenia. Maksymalne nasycenie jest równe twojemu aktualnemu poziomowi głodu. Więc z 20 punktami głodu, twój maksymalny poziom nasycenia to 20. To oznacza, że jedzenie które zwiększa nasycenie jest bardziej efektywne im więcej punktów głodu masz. Jest tak ponieważ na niskich poziomach głodu spora część zwiększenia nasycenia zostanie stracona przez niski poziom maksymalny. +If your saturation reaches 0, you're hungry and start to lose hunger points. Whenever you see the hunger bar decrease, it is a good time to eat.=Gdy twój poziom nasycenia spadnie do 0 stajesz się głodna i zaczynasz tracić punkty głodu. Gdy widzisz, że twój pasek głodu zmniejsza się, to jest to dobry moment na jedzenie. +Saturation decreases by doing things which exhaust you (highest exhaustion first):=Nasycenie zmniejsza się gdy robisz rzeczy, które cię męczą (w kolejności od najbardziej męczącego): +• Regenerating 1 HP=• Odnowienie 1 HP +• Suffering food poisoning=• Zatrucie pokarmowe +• Sprint-jumping=• Skakanie podczas biegu +• Sprinting=• Bieganie +• Attacking=• Atakowanie +• Taking damage=• Otrzymywanie obrażeń +• Swimming=• Pływanie +• Jumping=• Skakanie +• Mining a block=• Kopanie bloku +Other actions, like walking, do not exaust you.=Inne akcje takie jak chodzenie nie męczą cię. +If you have a map item in any of your hotbar slots, you can use the minimap.=Jeśli masz przedmiot mapy w swoim pasku szybkiego dostępu możesz korzystać z minimapy. + diff --git a/mods/HELP/mcl_doc_basics/mcl_extension.lua b/mods/HELP/mcl_doc_basics/mcl_extension.lua index c6f9f0aa9..a0f31a2c8 100644 --- a/mods/HELP/mcl_doc_basics/mcl_extension.lua +++ b/mods/HELP/mcl_doc_basics/mcl_extension.lua @@ -1,4 +1,4 @@ -local S = minetest.get_translator("mcl_doc_basics") +local S = minetest.get_translator(minetest.get_current_modname()) doc.add_entry("advanced", "creative", { name = S("Creative Mode"), diff --git a/mods/HELP/mcl_item_id/API.md b/mods/HELP/mcl_item_id/API.md new file mode 100644 index 000000000..a2f244e0c --- /dev/null +++ b/mods/HELP/mcl_item_id/API.md @@ -0,0 +1,24 @@ +# mcl_item_id +Show the item ID of an item in the description. +With this API, you can register a different name space than "mineclone" for your mod. + +## mcl_item_id.set_mod_namespace(modname, namespace) +Set a name space for all items in a mod. + +* param1: the modname +* param2: (optional) string of the desired name space, if nil, it is the name of the mod + +## mcl_item_id.get_mod_namespace(modname) +Get the name space of a mod registered with mcl_item_id.set_mod_namespace(modname, namespace). + +* param1: the modname + +### Examples: + +The name of the mod is "mod" which registered an item called "mod:itemname". + +* mcl_item_id.set_mod_namespace("mod", "mymod") will show "mymod:itemname" in the description of "mod:itemname" +* mcl_item_id.set_mod_namespace(minetest.get_current_modname()) will show "mod:itemname" in the description of "mod:itemname" +* mcl_item_id.get_mod_namespace(minetest.get_current_modname()) will return "mod" + +(If no namespace is set by a mod, mcl_item_id.get_mod_namespace(minetest.get_current_modname()) will return "mineclone") diff --git a/mods/HELP/mcl_item_id/init.lua b/mods/HELP/mcl_item_id/init.lua new file mode 100644 index 000000000..f3e6d2735 --- /dev/null +++ b/mods/HELP/mcl_item_id/init.lua @@ -0,0 +1,62 @@ +mcl_item_id = { + mod_namespaces = {}, +} + +local game = "mineclone" + +function mcl_item_id.set_mod_namespace(modname, namespace) + local namespace = namespace or modname + mcl_item_id.mod_namespaces[modname] = namespace +end + +function mcl_item_id.get_mod_namespace(modname) + local namespace = mcl_item_id.mod_namespaces[modname] + if namespace then + return namespace + else + return game + end +end + +local same_id = { + enchanting = { "table" }, + experience = { "bottle" }, + heads = { "skeleton", "zombie", "creeper", "wither_skeleton" }, + mobitems = { "rabbit", "chicken" }, + walls = { + "andesite", "brick", "cobble", "diorite", "endbricks", + "granite", "mossycobble", "netherbrick", "prismarine", + "rednetherbrick", "redsandstone", "sandstone", + "stonebrick", "stonebrickmossy", + }, + wool = { + "black", "blue", "brown", "cyan", "green", + "grey", "light_blue", "lime", "magenta", "orange", + "pink", "purple", "red", "silver", "white", "yellow", + }, +} + +tt.register_snippet(function(itemstring) + local def = minetest.registered_items[itemstring] + local item_split = itemstring:find(":") + local id_string = itemstring:sub(item_split) + local id_modname = itemstring:sub(1, item_split - 1) + local new_id = game .. id_string + local mod_namespace = mcl_item_id.get_mod_namespace(id_modname) + for mod, ids in pairs(same_id) do + for _, id in pairs(ids) do + if itemstring == "mcl_" .. mod .. ":" .. id then + new_id = game .. ":" .. id .. "_" .. mod:gsub("s", "") + end + end + end + if mod_namespace ~= game then + new_id = mod_namespace .. id_string + end + if mod_namespace ~= id_modname then + minetest.register_alias_force(new_id, itemstring) + end + if minetest.settings:get_bool("mcl_item_id_debug", false) then + return new_id, "#555555" + end +end) \ No newline at end of file diff --git a/mods/HELP/mcl_item_id/mod.conf b/mods/HELP/mcl_item_id/mod.conf new file mode 100644 index 000000000..c45e17fd3 --- /dev/null +++ b/mods/HELP/mcl_item_id/mod.conf @@ -0,0 +1,3 @@ +name = mcl_item_id +author = NO11 +depends = tt \ No newline at end of file diff --git a/mods/HELP/mcl_tt/init.lua b/mods/HELP/mcl_tt/init.lua index 9d0113040..3451e76da 100644 --- a/mods/HELP/mcl_tt/init.lua +++ b/mods/HELP/mcl_tt/init.lua @@ -1,2 +1,4 @@ -dofile(minetest.get_modpath("mcl_tt").."/snippets_base.lua") -dofile(minetest.get_modpath("mcl_tt").."/snippets_mcl.lua") +local modpath = minetest.get_modpath(minetest.get_current_modname()) + +dofile(modpath.."/snippets_base.lua") +dofile(modpath.."/snippets_mcl.lua") \ No newline at end of file diff --git a/mods/HELP/mcl_tt/locale/mcl_tt.de.tr b/mods/HELP/mcl_tt/locale/mcl_tt.de.tr index 8f878afc7..54c376c3b 100644 --- a/mods/HELP/mcl_tt/locale/mcl_tt.de.tr +++ b/mods/HELP/mcl_tt/locale/mcl_tt.de.tr @@ -45,3 +45,4 @@ Mining durability: @1=Grabehaltbarkeit: @1 Block breaking strength: @1=Blockbruchstärke: @1 @1 uses=@1 Verwendungen Unlimited uses=Unbegrenzte Verwendungen +Durability: @1=Haltbarkeit: @1 diff --git a/mods/HELP/mcl_tt/locale/mcl_tt.pl.tr b/mods/HELP/mcl_tt/locale/mcl_tt.pl.tr new file mode 100644 index 000000000..aecc15d1e --- /dev/null +++ b/mods/HELP/mcl_tt/locale/mcl_tt.pl.tr @@ -0,0 +1,48 @@ +# textdomain: mcl_tt +Head armor=Zbroja na głowę +Torso armor=Zbroja na pierś +Legs armor=Zbroja na nogi +Feet armor=Zbroja na stopy +Armor points: @1=Punkty zbroi +Armor durability: @1=Wytrzymałość zbroi: @1 +Protection: @1%=Ochrona: @1% +Hunger points: +@1=Punkty głodu: +@1 +Saturation points: +@1=Punkty nasycenia: +@1 +Deals damage when falling=Zadaje obrażenia gdy spada +Grows on grass blocks or dirt=Rośnie na blokach trawy i ziemi +Grows on grass blocks, podzol, dirt or coarse dirt=Rośnie na blokach trawy, bielicy, ziemi oraz twardej ziemi +Flammable=Łatwopalne +Zombie view range: -50%=Zasięg widzenia zombie: -50% +Skeleton view range: -50%=Zasięg widzenia szkieleta: -50% +Creeper view range: -50%=Zasięg widzenia creepera: -50% +Damage: @1=Obrażenia: @1 +Damage (@1): @2=Obrażenia (@1): @2 +Healing: @1=Leczenie: @1 +Healing (@1): @2=Leczenie (@1): @2 +Full punch interval: @1s=Pełny okres uderzenia: @1s +Contact damage: @1 per second=Obrażenia kontaktowe: @1 na sekundę +Contact healing: @1 per second=Leczenie kontaktowe: @1 na sekundę +Drowning damage: @1=Obrażenia od topienia: @1 +Bouncy (@1%)=Sprężystość (@1%) +Luminance: @1=Luminancja: @1 +Slippery=Śliskość +Climbable=Wspinaczkowe +Climbable (only downwards)=Wspinaczkowe (tylko w dół) +No jumping=Nie można skakać +No swimming upwards=Nie można płynąć pod górę +No rising=Nie wolno wstawać +Fall damage: @1%=Obrażenia od upadku @1% +Fall damage: +@1%=Obrażenia od upadku +@1% +No fall damage=Brak obrażeń od upadku +Mining speed: @1=Szybkość kopania: @1 +Very fast=Bardzo szybkie +Extremely fast=Ekstremalnie szybkie +Fast=Szybkie +Slow=Wolne +Very slow=Bardzo wolne +Painfully slow=Boleśnie wolne +Mining durability: @1=Wytrzymałość kopania: @1 +Block breaking strength: @1=Siła niszczenia bloku: @1 +@1 uses=@1 użyć +Unlimited uses=Nielimitowane użycia + diff --git a/mods/HELP/mcl_tt/locale/template.txt b/mods/HELP/mcl_tt/locale/template.txt index 1259216c7..6fb735b13 100644 --- a/mods/HELP/mcl_tt/locale/template.txt +++ b/mods/HELP/mcl_tt/locale/template.txt @@ -45,3 +45,4 @@ Mining durability: @1= Block breaking strength: @1= @1 uses= Unlimited uses= +Durability: @1= diff --git a/mods/HELP/mcl_tt/snippets_base.lua b/mods/HELP/mcl_tt/snippets_base.lua index 8242f2c19..4e200d539 100644 --- a/mods/HELP/mcl_tt/snippets_base.lua +++ b/mods/HELP/mcl_tt/snippets_base.lua @@ -1,6 +1,6 @@ -local S = minetest.get_translator("mcl_tt") +local S = minetest.get_translator(minetest.get_current_modname()) -local function get_min_digtime(caps) +--[[local function get_min_digtime(caps) local mintime local unique = true local maxlevel = caps.maxlevel @@ -25,7 +25,7 @@ local function get_min_digtime(caps) end end return mintime, unique -end +end]] local function newline(str) if str ~= "" then @@ -47,7 +47,7 @@ tt.register_snippet(function(itemstring, toolcaps) local minestring = "" local capstr = "" local caplines = 0 - for k,v in pairs(groupcaps) do + for _,v in pairs(groupcaps) do local speedstr = "" local miningusesstr = "" -- Mining capabilities @@ -153,9 +153,9 @@ tt.register_snippet(function(itemstring, toolcaps) end) -- Weapon stats -tt.register_snippet(function(itemstring) +--[[tt.register_snippet(function(itemstring) local def = minetest.registered_items[itemstring] -end) +end)]] -- Food tt.register_snippet(function(itemstring) diff --git a/mods/HELP/mcl_tt/snippets_mcl.lua b/mods/HELP/mcl_tt/snippets_mcl.lua index 3d13df751..825776f5f 100644 --- a/mods/HELP/mcl_tt/snippets_mcl.lua +++ b/mods/HELP/mcl_tt/snippets_mcl.lua @@ -1,8 +1,8 @@ -local S = minetest.get_translator("mcl_tt") +local S = minetest.get_translator(minetest.get_current_modname()) -- Armor tt.register_snippet(function(itemstring) - local def = minetest.registered_items[itemstring] + --local def = minetest.registered_items[itemstring] local s = "" local head = minetest.get_item_group(itemstring, "armor_head") local torso = minetest.get_item_group(itemstring, "armor_torso") @@ -26,7 +26,7 @@ tt.register_snippet(function(itemstring) return s end) tt.register_snippet(function(itemstring, _, itemstack) - local def = minetest.registered_items[itemstring] + --local def = minetest.registered_items[itemstring] local s = "" local use = minetest.get_item_group(itemstring, "mcl_armor_uses") local pts = minetest.get_item_group(itemstring, "mcl_armor_points") @@ -75,7 +75,7 @@ tt.register_snippet(function(itemstring) end) tt.register_snippet(function(itemstring) - local def = minetest.registered_items[itemstring] + --local def = minetest.registered_items[itemstring] if minetest.get_item_group(itemstring, "crush_after_fall") == 1 then return S("Deals damage when falling"), mcl_colors.YELLOW end @@ -107,3 +107,8 @@ tt.register_snippet(function(itemstring) end end) +tt.register_snippet(function(itemstring, _, itemstack) + if itemstring:sub(1, 23) == "mcl_fishing:fishing_rod" or itemstring:sub(1, 12) == "mcl_bows:bow" then + return S("Durability: @1", S("@1 uses", mcl_util.calculate_durability(itemstack or ItemStack(itemstring)))) + end +end) diff --git a/mods/HELP/tt/init.lua b/mods/HELP/tt/init.lua index a5ae24a35..819bf7b81 100644 --- a/mods/HELP/tt/init.lua +++ b/mods/HELP/tt/init.lua @@ -7,11 +7,11 @@ tt.NAME_COLOR = mcl_colors.YELLOW -- API tt.registered_snippets = {} -tt.register_snippet = function(func) +function tt.register_snippet(func) table.insert(tt.registered_snippets, func) end -tt.register_priority_snippet = function(func) +function tt.register_priority_snippet(func) table.insert(tt.registered_snippets, 1, func) end @@ -43,7 +43,7 @@ local function apply_snippets(desc, itemstring, toolcaps, itemstack) end local function should_change(itemstring, def) - return itemstring ~= "" and itemstring ~= "air" and itemstring ~= "ignore" and itemstring ~= "unknown" and def ~= nil and def.description ~= nil and def.description ~= "" and def._tt_ignore ~= true + return itemstring ~= "" and itemstring ~= "air" and itemstring ~= "ignore" and itemstring ~= "unknown" and def and def.description and def.description ~= "" and def._tt_ignore ~= true end local function append_snippets() @@ -60,7 +60,7 @@ end minetest.register_on_mods_loaded(append_snippets) -tt.reload_itemstack_description = function(itemstack) +function tt.reload_itemstack_description(itemstack) local itemstring = itemstack:get_name() local def = itemstack:get_definition() local meta = itemstack:get_meta() diff --git a/mods/HUD/awards/api.lua b/mods/HUD/awards/api.lua index d795f0dca..49b11a6cf 100644 --- a/mods/HUD/awards/api.lua +++ b/mods/HUD/awards/api.lua @@ -14,11 +14,16 @@ -- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -- +local modname = minetest.get_current_modname() +local modpath = minetest.get_modpath(modname) +local S = minetest.get_translator(modname) + -- The global award namespace awards = { - show_mode = "hud" + show_mode = "hud", } -dofile(minetest.get_modpath("awards").."/api_helpers.lua") + +dofile(modpath.."/api_helpers.lua") -- Table Save Load Functions function awards.save() @@ -29,8 +34,6 @@ function awards.save() end end -local S = minetest.get_translator("awards") - function awards.init() awards.players = awards.load() awards.def = {} @@ -53,7 +56,7 @@ end function awards.register_trigger(name, func) awards.trigger_types[name] = func awards.on[name] = {} - awards['register_on_'..name] = function(func) + awards["register_on_"..name] = function(func) table.insert(awards.on[name], func) end end diff --git a/mods/HUD/awards/chat_commands.lua b/mods/HUD/awards/chat_commands.lua index 88e799dfe..88bed0afe 100644 --- a/mods/HUD/awards/chat_commands.lua +++ b/mods/HUD/awards/chat_commands.lua @@ -14,7 +14,7 @@ -- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -- -local S = minetest.get_translator("awards") +local S = minetest.get_translator(minetest.get_current_modname()) minetest.register_chatcommand("awards", { params = S("[c|clear|disable|enable]"), diff --git a/mods/HUD/awards/init.lua b/mods/HUD/awards/init.lua index 63c9303c1..9b46fd066 100644 --- a/mods/HUD/awards/init.lua +++ b/mods/HUD/awards/init.lua @@ -14,9 +14,11 @@ -- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -- -dofile(minetest.get_modpath("awards").."/api.lua") -dofile(minetest.get_modpath("awards").."/chat_commands.lua") -dofile(minetest.get_modpath("awards").."/sfinv.lua") -dofile(minetest.get_modpath("awards").."/unified_inventory.lua") -dofile(minetest.get_modpath("awards").."/triggers.lua") +local modpath = minetest.get_modpath(minetest.get_current_modname()) + +dofile(modpath.."/api.lua") +dofile(modpath.."/chat_commands.lua") +dofile(modpath.."/sfinv.lua") +dofile(modpath.."/unified_inventory.lua") +dofile(modpath.."/triggers.lua") diff --git a/mods/HUD/awards/locale/awards.pl.tr b/mods/HUD/awards/locale/awards.pl.tr new file mode 100644 index 000000000..76d5b9161 --- /dev/null +++ b/mods/HUD/awards/locale/awards.pl.tr @@ -0,0 +1,63 @@ +# textdomain:awards +@1/@2 chat messages=@1/@2 wiadomości na czacie +@1/@2 crafted=Wytworzono @1/@2 +@1/@2 deaths=@1/@2 śmierci +@1/@2 dug=Wykopano @1/@2 +@1/@2 game joins=Dołączono do @1/@2 gier +@1/@2 placed=Postawiono @1/@2 +@1 (got)=@1 (zdobyto) +@1: @2=@1: @2 +@1’s awards:=Nagrody @1: +(Secret Award)=(Sekretna nagroda) += += +Achievement gotten!=Zdobyto osiągnięcie! +Achievement gotten:=Zdobyto osiągnięcie: +Achievement gotten: @1=Zdobyto osiągnięcie: @1 +Achievement not found.=Nie znaleziono osiągnięcia. +All your awards and statistics have been cleared. You can now start again.=Wszystkie twoje nagrody i statystyki zostały usunięte. Możesz zacząć ponownie. +Awards=Nagrody. +Craft: @1×@2=Wytwórz: @1×@2 +Craft: @1=Wytwórz: @1 +Die @1 times.=Zgiń @1 razy. +Die.=Zgiń. +Get the achievements statistics for the given player or yourself=Zobacz statystyki osiągnięć danego gracza lub siebie +Join the game @1 times.=Dołącz do gry @1 razy. +Join the game.=Dołącz do gry. +List awards in chat (deprecated)=Wypisz nagrody w czacie (przestarzałe) +Place a block: @1=Postaw blok: @1 +Place blocks: @1×@2=Postaw bloki: @1×@2 +Secret achievement gotten!=Zdobyto sekretne osiągnięcie! +Secret achievement gotten:=Zdobyto sekretne osiągnięcie: +Secret achievement gotten: @1=Zdobyto sekretne osiągnięcie: @1 +Show details of an achievement=Pokaż szczegóły osiągnięcia +Show, clear, disable or enable your achievements=Pokaż, wyczyść, wyłącz lub włącz swoje osiągnięcia +Get this achievement to find out what it is.=Zdobądź to osiągnięcie aby dowiedzieć się jakie ono jest. +Write @1 chat messages.=Napisz @1 wiadomości na czacie. +Write something in chat.=Napisz coś na czacie. +You have disabled your achievements.=Twoje osiągnięcia zostały wyłączone. +You have enabled your achievements.=Twoje osiągnięcia zostały włączone. +You have not gotten any awards.=Nie zdobyto żadnych osiągnięć. +You've disabled awards. Type /awards enable to reenable.=Wyłączono osiągnięcia. Napisz /awards by je włączyć. +[c|clear|disable|enable]=[c|clear|disable|enable] +OK=OK +Error: No awards available.=Błąd: Brak dostępnych nagród. +Eat: @1×@2=Zjedz: @1×@2 +Eat: @1=Zjedz: @1 +@1/@2 eaten=Zjedzono @1/@2 +Place @1 block(s).=Postaw bloki: @1. +Dig @1 block(s).=Wykop bloki: @1. +Eat @1 item(s).=Zjedz przedmioty: @1. +Craft @1 item(s).=Wytwórz przedmioty: @1. +Can give achievements to any player=Może przyznawać osiągnięcia dowolnemu graczowi. +(grant ( | all)) | list=(grant ( | all)) | list +Give achievement to player or list all achievements=Daj osiągnięcie graczowi lub wypisz wszystkie osiągnięcia +@1 (@2)=@1 (@2) +Invalid syntax.=Niepoprawna składnia. +Invalid action.=Niepoprawna czynność. +Player is not online.=Gracz nie jest online. +Done.=Gotowe. +Achievement “@1” does not exist.=Osiągnięcie "@1" nie istnieje. +@1 has made the achievement @2=@2 zostało zdobyte przez @1. +Mine a block: @1=Wykop blok: @1 +Mine blocks: @1×@2=Wykop blok: @1×@2 diff --git a/mods/HUD/awards/sfinv.lua b/mods/HUD/awards/sfinv.lua index 5d02cbb58..3b41d29ab 100644 --- a/mods/HUD/awards/sfinv.lua +++ b/mods/HUD/awards/sfinv.lua @@ -1,5 +1,5 @@ if minetest.get_modpath("sfinv") then - local S = minetest.get_translator("awards") + local S = minetest.get_translator(minetest.get_current_modname()) sfinv.register_page("awards:awards", { title = S("Awards"), diff --git a/mods/HUD/awards/triggers.lua b/mods/HUD/awards/triggers.lua index 318a4b281..c7194d2c9 100644 --- a/mods/HUD/awards/triggers.lua +++ b/mods/HUD/awards/triggers.lua @@ -14,7 +14,7 @@ -- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -- -local S = minetest.get_translator("awards") +local S = minetest.get_translator(minetest.get_current_modname()) awards.register_trigger("dig", function(def) local tmp = { @@ -250,9 +250,7 @@ minetest.register_on_dignode(function(pos, oldnode, digger) local tnodedug = string.split(entry.node, ":") local tmod = tnodedug[1] local titem = tnodedug[2] - if not tmod or not titem or not data.count[tmod] or not data.count[tmod][titem] then - -- table running failed! - elseif data.count[tmod][titem] > entry.target-1 then + if tmod and titem and data.count[tmod] and data.count[tmod][titem] and data.count[tmod][titem] > entry.target-1 then return entry.award end elseif awards.get_total_item_count(data, "count") > entry.target-1 then @@ -277,9 +275,7 @@ minetest.register_on_placenode(function(pos, node, digger) local tnodedug = string.split(entry.node, ":") local tmod = tnodedug[1] local titem = tnodedug[2] - if not tmod or not titem or not data.place[tmod] or not data.place[tmod][titem] then - -- table running failed! - elseif data.place[tmod][titem] > entry.target-1 then + if tmod and titem and data.place[tmod] and data.place[tmod][titem] and data.place[tmod][titem] > entry.target-1 then return entry.award end elseif awards.get_total_item_count(data, "place") > entry.target-1 then @@ -303,9 +299,7 @@ minetest.register_on_item_eat(function(hp_change, replace_with_item, itemstack, local titemstring = string.split(entry.item, ":") local tmod = titemstring[1] local titem = titemstring[2] - if not tmod or not titem or not data.eat[tmod] or not data.eat[tmod][titem] then - -- table running failed! - elseif data.eat[tmod][titem] > entry.target-1 then + if tmod and titem and data.eat[tmod] and data.eat[tmod][titem] and data.eat[tmod][titem] > entry.target-1 then return entry.award end elseif awards.get_total_item_count(data, "eat") > entry.target-1 then @@ -331,9 +325,7 @@ minetest.register_on_craft(function(itemstack, player, old_craft_grid, craft_inv local titemcrafted = string.split(entry.item, ":") local tmod = titemcrafted[1] local titem = titemcrafted[2] - if not tmod or not titem or not data.craft[tmod] or not data.craft[tmod][titem] then - -- table running failed! - elseif data.craft[tmod][titem] > entry.target-1 then + if tmod and titem and data.craft[tmod] and data.craft[tmod][titem] and data.craft[tmod][titem] > entry.target-1 then return entry.award end elseif awards.get_total_item_count(data, "craft") > entry.target-1 then @@ -390,7 +382,7 @@ end) minetest.register_on_chat_message(function(name, message) -- Run checks local idx = string.find(message,"/") - if not name or (idx ~= nil and idx <= 1) then + if not name or (idx and idx <= 1) then return end diff --git a/mods/HUD/awards/unified_inventory.lua b/mods/HUD/awards/unified_inventory.lua index be5ca5f94..3dc238e1a 100644 --- a/mods/HUD/awards/unified_inventory.lua +++ b/mods/HUD/awards/unified_inventory.lua @@ -1,6 +1,5 @@ -if minetest.get_modpath("unified_inventory") ~= nil then - local S = minetest.get_translator("awards") - +if minetest.get_modpath("unified_inventory") then + local S = minetest.get_translator(minetest.get_current_modname()) unified_inventory.register_button("awards", { type = "image", image = "awards_ui_icon.png", diff --git a/mods/HUD/hudbars/default_settings.lua b/mods/HUD/hudbars/default_settings.lua index ce43cc8be..865a7cb6a 100644 --- a/mods/HUD/hudbars/default_settings.lua +++ b/mods/HUD/hudbars/default_settings.lua @@ -37,7 +37,7 @@ hb.settings.alignment_pattern = hb.load_setting("hudbars_alignment_pattern", "st hb.settings.autohide_breath = hb.load_setting("hudbars_autohide_breath", "bool", true) local sorting = minetest.settings:get("hudbars_sorting") -if sorting ~= nil then +if sorting then hb.settings.sorting = {} hb.settings.sorting_reverse = {} for k,v in string.gmatch(sorting, "(%w+)=(%w+)") do diff --git a/mods/HUD/hudbars/init.lua b/mods/HUD/hudbars/init.lua index 6f90aa03d..505ff403b 100644 --- a/mods/HUD/hudbars/init.lua +++ b/mods/HUD/hudbars/init.lua @@ -1,17 +1,22 @@ -local S = minetest.get_translator("hudbars") +local modname = minetest.get_current_modname() +local modpath = minetest.get_modpath(modname) + +local S = minetest.get_translator(modname) local N = function(s) return s end -hb = {} +local math = math +local table = table -hb.hudtables = {} - --- number of registered HUD bars -hb.hudbars_count = 0 - --- table which records which HUD bar slots have been “registered” so far; used for automatic positioning -hb.registered_slots = {} - -hb.settings = {} +hb = { + hudtables = {}, + -- number of registered HUD bars + hudbars_count = 0, + -- table which records which HUD bar slots have been “registered” so far; used for automatic positioning + registered_slots = {}, + settings = {}, + -- Table which contains all players with active default HUD bars (only for internal use) + players = {}, +} function hb.load_setting(sname, stype, defaultval, valid_values) local sval @@ -22,10 +27,10 @@ function hb.load_setting(sname, stype, defaultval, valid_values) elseif stype == "number" then sval = tonumber(minetest.settings:get(sname)) end - if sval ~= nil then - if valid_values ~= nil then + if sval then + if valid_values then local valid = false - for i=1,#valid_values do + for i = 1, #valid_values do if sval == valid_values[i] then valid = true end @@ -45,7 +50,8 @@ function hb.load_setting(sname, stype, defaultval, valid_values) end -- Load default settings -dofile(minetest.get_modpath("hudbars").."/default_settings.lua") +dofile(modpath.."/default_settings.lua") + if minetest.get_modpath("mcl_experience") and not minetest.is_creative_enabled("") then -- reserve some space for experience bar: hb.settings.start_offset_left.y = hb.settings.start_offset_left.y - 20 @@ -85,9 +91,6 @@ local function make_label(format_string, format_string_config, label, start_valu return ret end --- Table which contains all players with active default HUD bars (only for internal use) -hb.players = {} - function hb.value_to_barlength(value, max) if max == 0 then return 0 @@ -111,7 +114,7 @@ function hb.get_hudtable(identifier) end function hb.get_hudbar_position_index(identifier) - if hb.settings.sorting[identifier] ~= nil then + if hb.settings.sorting[identifier] then return hb.settings.sorting[identifier] else local i = 0 @@ -176,7 +179,7 @@ function hb.register_hudbar(identifier, text_color, label, textures, direction, format_string_config.format_max_value = "%d" end - hudtable.add_all = function(player, hudtable, start_value, start_max, start_hidden) + function hudtable.add_all(player, hudtable, start_value, start_max, start_hidden) if start_value == nil then start_value = hudtable.default_start_value end if start_max == nil then start_max = hudtable.default_start_max end if start_hidden == nil then start_hidden = hudtable.default_start_hidden end @@ -212,7 +215,7 @@ function hb.register_hudbar(identifier, text_color, label, textures, direction, offset = { x = offset.x - 1, y = offset.y - 1 }, z_index = 0, }) - if textures.icon ~= nil then + if textures.icon then ids.icon = player:hud_add({ hud_elem_type = "image", position = pos, @@ -332,7 +335,7 @@ function hb.change_hudbar(player, identifier, new_value, new_max_value, new_icon end local value_changed, max_changed = false, false - if new_value ~= nil then + if new_value then if new_value ~= hudtable.hudstate[name].value then hudtable.hudstate[name].value = new_value value_changed = true @@ -340,7 +343,7 @@ function hb.change_hudbar(player, identifier, new_value, new_max_value, new_icon else new_value = hudtable.hudstate[name].value end - if new_max_value ~= nil then + if new_max_value then if new_max_value ~= hudtable.hudstate[name].max then hudtable.hudstate[name].max = new_max_value max_changed = true @@ -350,29 +353,29 @@ function hb.change_hudbar(player, identifier, new_value, new_max_value, new_icon end if hb.settings.bar_type == "progress_bar" then - if new_icon ~= nil and hudtable.hudids[name].icon ~= nil then + if new_icon and hudtable.hudids[name].icon then player:hud_change(hudtable.hudids[name].icon, "text", new_icon) end - if new_bgicon ~= nil and hudtable.hudids[name].bgicon ~= nil then + if new_bgicon and hudtable.hudids[name].bgicon then player:hud_change(hudtable.hudids[name].bgicon, "text", new_bgicon) end - if new_bar ~= nil then + if new_bar then player:hud_change(hudtable.hudids[name].bar , "text", new_bar) end - if new_label ~= nil then + if new_label then hudtable.label = new_label local new_text = make_label(hudtable.format_string, hudtable.format_string_config, new_label, hudtable.hudstate[name].value, hudtable.hudstate[name].max) player:hud_change(hudtable.hudids[name].text, "text", new_text) end - if new_text_color ~= nil then + if new_text_color then player:hud_change(hudtable.hudids[name].text, "number", new_text_color) end else - if new_icon ~= nil and hudtable.hudids[name].bar ~= nil then + if new_icon and hudtable.hudids[name].bar then player:hud_change(hudtable.hudids[name].bar, "text", new_icon) end - if new_bgicon ~= nil and hudtable.hudids[name].bg ~= nil then + if new_bgicon and hudtable.hudids[name].bg then player:hud_change(hudtable.hudids[name].bg, "text", new_bgicon) end end @@ -422,8 +425,9 @@ function hb.hide_hudbar(player, identifier) local name = player:get_player_name() local hudtable = hb.get_hudtable(identifier) if hudtable == nil then return false end + if hudtable.hudstate[name].hidden == true then return true end if hb.settings.bar_type == "progress_bar" then - if hudtable.hudids[name].icon ~= nil then + if hudtable.hudids[name].icon then player:hud_change(hudtable.hudids[name].icon, "scale", {x=0,y=0}) end player:hud_change(hudtable.hudids[name].bg, "scale", {x=0,y=0}) @@ -440,10 +444,11 @@ function hb.unhide_hudbar(player, identifier) local name = player:get_player_name() local hudtable = hb.get_hudtable(identifier) if hudtable == nil then return false end + if hudtable.hudstate[name].hidden == false then return true end local value = hudtable.hudstate[name].value local max = hudtable.hudstate[name].max if hb.settings.bar_type == "progress_bar" then - if hudtable.hudids[name].icon ~= nil then + if hudtable.hudids[name].icon then player:hud_change(hudtable.hudids[name].icon, "scale", {x=1,y=1}) end if hudtable.hudstate[name].max ~= 0 then @@ -545,7 +550,7 @@ local function update_hud(player, has_damage) end minetest.register_on_player_hpchange(function(player) - if hb.players[player:get_player_name()] ~= nil then + if hb.players[player:get_player_name()] then update_health(player) end end) diff --git a/mods/HUD/hudbars/locale/hudbars.pl.tr b/mods/HUD/hudbars/locale/hudbars.pl.tr new file mode 100644 index 000000000..be06b3579 --- /dev/null +++ b/mods/HUD/hudbars/locale/hudbars.pl.tr @@ -0,0 +1,7 @@ +# textdomain: hudbars +Health=Życie +Breath=Tlen + +# Default format string for progress bar-style HUD bars, e.g. “Health 5/20” +@1: @2/@3=@1: @2/@3 + diff --git a/mods/HUD/mcl_achievements/init.lua b/mods/HUD/mcl_achievements/init.lua index 2f1db1fe6..c963773d1 100644 --- a/mods/HUD/mcl_achievements/init.lua +++ b/mods/HUD/mcl_achievements/init.lua @@ -3,7 +3,7 @@ -- If true, activates achievements from other Minecraft editions (XBox, PS, etc.) local non_pc_achievements = false -local S = minetest.get_translator("mcl_achievements") +local S = minetest.get_translator(minetest.get_current_modname()) -- Achievements from PC Edition diff --git a/mods/HUD/mcl_achievements/locale/mcl_achievements.pl.tr b/mods/HUD/mcl_achievements/locale/mcl_achievements.pl.tr new file mode 100644 index 000000000..78ab53f82 --- /dev/null +++ b/mods/HUD/mcl_achievements/locale/mcl_achievements.pl.tr @@ -0,0 +1,50 @@ +# textdomain:mcl_achievements +Aquire Hardware=Zdobądź narzędzie +Bake Bread=Upiecz chleb +Benchmarking=Rzemieślnictwo +Cow Tipper=Raz krowie śmierć +Craft a bookshelf.=Wytwórz półkę z książkami. +Craft a cake using wheat, sugar, milk and an egg.=Wytwórz ciasto z pszenicy, cukru, mleka i jajka. +Craft a crafting table from 4 wooden planks.=Wytwórz stół rzemieślniczy z 4 desek. +Craft a stone pickaxe using sticks and cobblestone.=Wytwórz kamienny kilof korzystając z patyków i brukowca. +Craft a wooden sword using wooden planks and sticks on a crafting table.=Wytwórz drewniany miecz korzystając z desek i patyków na stole rzemieślniczym. +DIAMONDS!=DIAMENTY! +Delicious Fish=Pyszna ryba +Dispense With This=Dozuj to +Eat a cooked porkchop.=Zjedz upieczony kotlet. +Eat a cooked rabbit.=Zjedz pieczonego królika. +Get really desperate and eat rotten flesh.=Bądź zdesperowany i zjedz zgniłe mięso. +Getting Wood=Zbieranie drewna +Getting an Upgrade=Ulepszenie +Hit a skeleton, wither skeleton or stray by bow and arrow from a distance of at least 20 meters.=Traf szkieleta, witherowego szkieleta lub tułacza strzałą z łuku z odległości co najmniej 20 metrów. +Hot Topic=Gorący temat +Into Fire=W ogień +Into the Nether=W Nether +Iron Belly=Żelazny żołądek +Librarian=Bibliotekarz +Mine emerald ore.=Wykop rudę szmaragdu. +On A Rail=Na torach +Pick up a blaze rod from the floor.=Podnieś płomienną różdżkę z podłogi. +Pick up a diamond from the floor.=Ponieś diament z podłogi. +Pick up a wood item from the ground.@nHint: Punch a tree trunk until it pops out as an item.=Podnieś drewniany przedmiot z ziemi.@nPodpowiedź: Uderzaj pień drzewa dopóki nie wyleci jako przedmiot. +Pick up leather from the floor.@nHint: Cows and some other animals have a chance to drop leather, when killed.=Podnieś skórkę z ziemi.@nPodpowiedź: Krowy i inne zwierzęta mają szansę upuścić skórę gdy zostaną zabite. +Place a dispenser.=Postaw dozownik. +Place a flower pot.=Postaw doniczkę. +Pork Chop=Kotlet +Pot Planter=Ogrodnik +Rabbit Season=Sezon na króliki +Sniper Duel=Pojedynek snajperów +Take a cooked fish from a furnace.@nHint: Use a fishing rod to catch a fish and cook it in a furnace.=Weź upieczoną rybę z pieca.@nPodpowiedź: Użyj wędki aby złapać rybę i upiecz ją w piecu. +Take an iron ingot from a furnace's output slot.@nHint: To smelt an iron ingot, put a fuel (like coal) and iron ore into a furnace.=Weź sztabkę żelaza z wyjściowego miejsca pieca.@nPodpowiedź: Aby wytopić sztabkę żelaza, umieść paliwo (np. węgiel) w piecu. +The Haggler=Handlarz +The Lie=Kłamstwo +Time to Farm!=Czas na rolnictwo! +Time to Mine!=Czas na kopanie! +Time to Strike!=Czas na atak! +Travel by minecart for at least 1000 meters from your starting point in a single ride.=Przejedź przez przynajmniej 1000 metrów od punktu startowego pojedynczą przejażdżką. +Use 8 cobblestones to craft a furnace.=Użyj 8 brukowców by wytworzyć piec. +Use a crafting table to craft a wooden hoe from wooden planks and sticks.=Użyj stołu rzemieślniczego aby wytworzyć drewnianą motykę z desek i patyków. +Use a crafting table to craft a wooden pickaxe from wooden planks and sticks.=Użyj stołu rzemieślniczego aby wytworzyć drewniany kilof z desek i patyków. +Use obsidian and a fire starter to construct a Nether portal.=Użyj obsydianu i źródła ognia aby skonstruować portal do Netheru. +Use wheat to craft a bread.=Użyj pszenicy by wytworzyć chleb. + diff --git a/mods/HUD/mcl_credits/init.lua b/mods/HUD/mcl_credits/init.lua index 4464a401b..235b2a3cb 100644 --- a/mods/HUD/mcl_credits/init.lua +++ b/mods/HUD/mcl_credits/init.lua @@ -1,23 +1,26 @@ +local modname = minetest.get_current_modname() +local S = minetest.get_translator(modname) + mcl_credits = { players = {}, } -mcl_credits.description = "A faithful Open Source clone of Minecraft" +mcl_credits.description = S("A faithful Open Source clone of Minecraft") -- Sub-lists are sorted by number of commits, but the list should not be rearranged (-> new contributors are just added at the end of the list) mcl_credits.people = { - {"Creator of MineClone", 0x0A9400, { + { S("Creator of MineClone"), 0x0A9400, { "davedevils", }}, - {"Creator of MineClone2", 0xFBF837, { + { S("Creator of MineClone2"), 0xFBF837, { "Wuzzy", }}, - {"Maintainers", 0xFF51D5, { + { S("Maintainers"), 0xFF51D5, { "Fleckenstein", "kay27", "oilboi", }}, - {"Developers", 0xF84355, { + { S("Developers"), 0xF84355, { "bzoss", "AFCMS", "epCode", @@ -28,8 +31,9 @@ mcl_credits.people = { "Nicu", "aligator", "Code-Sploit", + "NO11", }}, - {"Contributors", 0x52FF00, { + { S("Contributors"), 0x52FF00, { "Laurent Rocher", "HimbeerserverDE", "TechDudie", @@ -46,7 +50,6 @@ mcl_credits.people = { "Jared Moody", "Li0n", "Midgard", - "NO11", "Saku Laesvuori", "Yukitty", "ZedekThePD", @@ -64,7 +67,7 @@ mcl_credits.people = { "NO11", "j45", }}, - {"Original Mod Authors", 0x343434, { + { S("Original Mod Authors"), 0x343434, { "Wuzzy", "Fleckenstein", "BlockMen", @@ -96,20 +99,21 @@ mcl_credits.people = { "jordan4ibanez", "paramat", }}, - {"3D Models", 0x0019FF, { + { S("3D Models"), 0x0019FF, { "22i", "tobyplowy", "epCode", }}, - {"Textures", 0xFF9705, { + { S("Textures"), 0xFF9705, { "XSSheep", "Wuzzy", "kingoscargames", "leorockway", "xMrVizzy", - "yutyo" + "yutyo", + "NO11", }}, - {"Translations", 0x00FF60, { + { S("Translations"), 0x00FF60, { "Wuzzy", "Rocher Laurent", "wuniversales", @@ -141,7 +145,7 @@ function mcl_credits.show(player) ids = { player:hud_add({ hud_elem_type = "image", - text = "menu_bg.png", + text = "credits_bg.png", position = {x = 0, y = 0}, alignment = {x = 1, y = 1}, scale = {x = -100, y = -100}, @@ -149,13 +153,22 @@ function mcl_credits.show(player) }), player:hud_add({ hud_elem_type = "text", - text = "Sneak to skip", + text = S("Sneak to skip"), position = {x = 1, y = 1}, alignment = {x = -1, y = -1}, offset = {x = -5, y = -5}, z_index = 1001, number = 0xFFFFFF, - }) + }), + player:hud_add({ + hud_elem_type = "text", + text = " "..S("Jump to speed up (additionally sprint)"), + position = {x = 0, y = 1}, + alignment = {x = 1, y = -1}, + offset = {x = -5, y = -5}, + z_index = 1002, + number = 0xFFFFFF, + }), }, } add_hud_element({ @@ -215,13 +228,22 @@ end) minetest.register_globalstep(function(dtime) for _, huds in pairs(mcl_credits.players) do local player = huds.player - if not huds.new and player:get_player_control().sneak then + local control = player:get_player_control() + if not huds.new and control.sneak then mcl_credits.hide(player) else local moving = {} local any for id, y in pairs(huds.moving) do y = y - 1 + + if control.jump then + y = y - 2 + if control.aux1 then + y = y - 5 + end + end + if y > -100 then if id == huds.icon then y = math.max(400, y) diff --git a/mods/HUD/mcl_credits/locale/mcl_credits.de.tr b/mods/HUD/mcl_credits/locale/mcl_credits.de.tr new file mode 100644 index 000000000..fa26f5bc4 --- /dev/null +++ b/mods/HUD/mcl_credits/locale/mcl_credits.de.tr @@ -0,0 +1,14 @@ +# textdomain: mcl_credits +3D Models=3D Modelle +A faithful Open Source clone of Minecraft=Ein treuer Open-Source-Klon von Minecraft +Contributors=Mitwirkende +Creator of MineClone=Schöpfer von MineClone +Creator of MineClone2=Schöpfer von MineClone2 +Developers=Entwickler +Jump to speed up (additionally sprint)=Springen, um zu beschleunigen (zusätzlich sprinten) +Maintainers=Betreuer +MineClone5=MineClone5 +Original Mod Authors=Original-Mod-Autoren +Sneak to skip=Schleichen zum Überspringen +Textures=Texturen +Translations=Übersetzungen diff --git a/mods/HUD/mcl_credits/locale/mcl_credits.es.tr b/mods/HUD/mcl_credits/locale/mcl_credits.es.tr new file mode 100644 index 000000000..a8886286e --- /dev/null +++ b/mods/HUD/mcl_credits/locale/mcl_credits.es.tr @@ -0,0 +1,14 @@ +# textdomain: mcl_credits +3D Models= +A faithful Open Source clone of Minecraft= +Contributors= +Creator of MineClone= +Creator of MineClone2= +Developers= +Jump to speed up (additionally sprint)= +Maintainers= +MineClone5= +Original Mod Authors= +Sneak to skip= +Textures= +Translations= \ No newline at end of file diff --git a/mods/HUD/mcl_credits/locale/mcl_credits.fr.tr b/mods/HUD/mcl_credits/locale/mcl_credits.fr.tr new file mode 100644 index 000000000..b34249eff --- /dev/null +++ b/mods/HUD/mcl_credits/locale/mcl_credits.fr.tr @@ -0,0 +1,14 @@ +# textdomain: mcl_credits +3D Models=Modèles 3D +A faithful Open Source clone of Minecraft=Un clone open source de Minecraft +Contributors=Contributeurs +Creator of MineClone=Créateur de MineClone +Creator of MineClone2=Créateur de MineClone2 +Developers=Développeurs +Jump to speed up (additionally sprint)=Saut pour accélérer (peut être combiné avec sprint) +Maintainers=Mainteneurs +MineClone5=MineClone5 +Original Mod Authors=Auteurs des mods originaux +Sneak to skip=Shift pour passer +Textures=Textures +Translations=Traductions \ No newline at end of file diff --git a/mods/HUD/mcl_credits/locale/mcl_credits.pl.tr b/mods/HUD/mcl_credits/locale/mcl_credits.pl.tr new file mode 100644 index 000000000..a8886286e --- /dev/null +++ b/mods/HUD/mcl_credits/locale/mcl_credits.pl.tr @@ -0,0 +1,14 @@ +# textdomain: mcl_credits +3D Models= +A faithful Open Source clone of Minecraft= +Contributors= +Creator of MineClone= +Creator of MineClone2= +Developers= +Jump to speed up (additionally sprint)= +Maintainers= +MineClone5= +Original Mod Authors= +Sneak to skip= +Textures= +Translations= \ No newline at end of file diff --git a/mods/HUD/mcl_credits/locale/mcl_credits.ru.tr b/mods/HUD/mcl_credits/locale/mcl_credits.ru.tr new file mode 100644 index 000000000..a8886286e --- /dev/null +++ b/mods/HUD/mcl_credits/locale/mcl_credits.ru.tr @@ -0,0 +1,14 @@ +# textdomain: mcl_credits +3D Models= +A faithful Open Source clone of Minecraft= +Contributors= +Creator of MineClone= +Creator of MineClone2= +Developers= +Jump to speed up (additionally sprint)= +Maintainers= +MineClone5= +Original Mod Authors= +Sneak to skip= +Textures= +Translations= \ No newline at end of file diff --git a/mods/HUD/mcl_credits/locale/template.txt b/mods/HUD/mcl_credits/locale/template.txt new file mode 100644 index 000000000..3ee9fa56c --- /dev/null +++ b/mods/HUD/mcl_credits/locale/template.txt @@ -0,0 +1,14 @@ +# textdomain: mcl_credits +3D Models= +A faithful Open Source clone of Minecraft= +Contributors= +Creator of MineClone= +Creator of MineClone2= +Developers= +Jump to speed up (additionally sprint)= +Maintainers= +MineClone5= +Original Mod Authors= +Sneak to skip= +Textures= +Translations= diff --git a/mods/HUD/mcl_credits/textures/credits_bg.png b/mods/HUD/mcl_credits/textures/credits_bg.png new file mode 100644 index 000000000..ad74cbd30 Binary files /dev/null and b/mods/HUD/mcl_credits/textures/credits_bg.png differ diff --git a/mods/HUD/mcl_death_messages/init.lua b/mods/HUD/mcl_death_messages/init.lua index 0432c3488..91e13995b 100644 --- a/mods/HUD/mcl_death_messages/init.lua +++ b/mods/HUD/mcl_death_messages/init.lua @@ -1,4 +1,4 @@ -local S = minetest.get_translator("mcl_death_messages") +local S = minetest.get_translator(minetest.get_current_modname()) mcl_death_messages = { assist = {}, @@ -237,12 +237,10 @@ mcl_damage.register_on_damage(function(obj, damage, reason) end) minetest.register_globalstep(function(dtime) - local new_assist = {} - for obj, tbl in pairs(mcl_death_messages.assist) do tbl.timeout = tbl.timeout - dtime - if (obj:is_player() or obj:get_luaentity()) and tbl.timeout > 0 then - new_assist[obj] = tbl + if not obj:is_player() and not obj:get_luaentity() or tbl.timeout > 0 then + mcl_death_messages.assist[obj] = nil end end end) diff --git a/mods/HUD/mcl_death_messages/locale/mcl_death_messages.pl.tr b/mods/HUD/mcl_death_messages/locale/mcl_death_messages.pl.tr new file mode 100644 index 000000000..65fcde760 --- /dev/null +++ b/mods/HUD/mcl_death_messages/locale/mcl_death_messages.pl.tr @@ -0,0 +1,59 @@ +# textdomain: mcl_death_messages +@1 went up in flames=@1 stanęła w płomieniach +@1 walked into fire whilst fighting @2=@1 weszła w płomienie podczas walki z @2 +@1 was struck by lightning=@1 została trafiona piorunem +@1 was struck by lightning whilst fighting @2=@1 została trafiona piorunem z @2 +@1 burned to death=@1 została spalona żywcem +@1 was burnt to a crisp whilst fighting @2=@1 została usmażona podczas walki z @2 +@1 tried to swim in lava=@1 próbowała pływać w lawie +@1 tried to swim in lava to escape @2=@1 próbowała pływać w lawie by uciec od @20 +@1 discovered the floor was lava=@1 odkryła, że podłoga to lawa +@1 walked into danger zone due to @2=@1 weszła do niebezpiecznej strony przez @2 +@1 suffocated in a wall=@1 udusiła się w ścianie +@1 suffocated in a wall whilst fighting @2=@1 udusiła się w ścianie podczas walki z @2 +@1 drowned=@1 utopiła się +@1 drowned whilst trying to escape @2=@1 utopiła się podczas ucieczki przed @2 +@1 starved to death=@1 zagłodziła się na śmierć +@1 starved to death whilst fighting @2=@1 zagłodziła się na śmierć podczas walki z @2 +@1 was pricked to death=@1 została zakłuta na śmierć +@1 walked into a cactus whilst trying to escape @2=@1 weszła w kaktus podczas ucieczki przed @2 +@1 hit the ground too hard=@1 zbyt twardo wylądowała +@1 hit the ground too hard whilst trying to escape @2=@1 zby twardo wylądowała podczas walki z @2 +@1 experienced kinetic energy=@1 doświadczyła energii kinetycznej +@1 experienced kinetic energy whilst trying to escape @2=@1 doświadczyła energii kinetycznej podczas ucieczki przed @2 +@1 fell out of the world=@1 wyleciała poza świat +@1 didn't want to live in the same world as @2=@1 nie chciała żyć w tym samym świecie co @2 +@1 died=@1 umarła +@1 died because of @2=@1 umarła przez @2 +@1 was killed by magic=@1 została zabita magią +@1 was killed by magic whilst trying to escape @2=@1 została zabita magią podczas ucieczki przed @2 +@1 was killed by @2 using magic=@1 została zabita przez @2 korzystając z magii +@1 was killed by @2 using @3=@1 została zabita przez @2 korzystając z @3 +@1 was roasted in dragon breath=@1 została usmażona przez oddech smoka +@1 was roasted in dragon breath by @2=@1 została usmażona przez oddech smoka od @2 +@1 withered away=@1 odeszła na wieki +@1 withered away whilst fighting @2=@1 odeszła na wieki podczas walki z @2 +@1 was killed by magic=@1 została zabita magią +@1 was shot by a skull from @2=@1 została zastrzelona czaszką przez @2 +@1 was squashed by a falling anvil=@1 została zmiażdżona spadającym kowadłem +@1 was squashed by a falling anvil whilst fighting @2=@1 została zmiażdżona spadającym kowadłem podczas walki z @2 +@1 was squashed by a falling block=@1 została zmiażdżona spadającym blokiem +@1 was squashed by a falling block whilst fighting @2=@1 została zmiażdżona spadającym blokiem podczas walki z @2 +@1 was slain by @2=@1 została zabita przez @2 +@1 was slain by @2 using @3=@1 została zabita przez @2 przy użyciu @3 +@1 was slain by @2=@1 została zabita przez @2 +@1 was slain by @2 using @3=@1 została zabita przez @2 przy użyciu @3 +@1 was shot by @2=@1 została zastrzelona przez @2 +@1 was shot by @2 using @3=@1 została zastrzelona przez @2 przy użyciu @3 +@1 was fireballed by @2=@1 została zabita kulą ognia przez @2 +@1 was fireballed by @2 using @3=@1 została zabita kulą ognia przez @2 przy użyciu @3 +@1 was killed trying to hurt @2=@1 została zabita gdy próbowała skrzywdzić @2 +@1 was killed by @3 trying to hurt @2=@1 została zabita przez @3 gdy próbowała skrzywdzić @2 +@1 blew up=@1 wybuchła +@1 was blown up by @2=@1 została wysadzona przez @2 +@1 was blown up by @2 using @3=@1 została wysadzona przez @2 przy użyciu @3 +@1 was squished too much=@1 została zbyt mocno ściśnięta +@1 was squashed by @2=@1 została ściśnięta przez @2 +@1 went off with a bang=@1 odeszła z hukiem +@1 went off with a bang due to a firework fired from @3 by @2=@1 odeszła z hukiem przez fajerwerki wystrzelone z @3 przez @2 + diff --git a/mods/HUD/mcl_experience/init.lua b/mods/HUD/mcl_experience/init.lua index fd78534fc..e514ffc19 100644 --- a/mods/HUD/mcl_experience/init.lua +++ b/mods/HUD/mcl_experience/init.lua @@ -1,5 +1,11 @@ -local S = minetest.get_translator("mcl_experience") +local S = minetest.get_translator(minetest.get_current_modname()) + mcl_experience = {} + +local vector = vector +local math = math +local string = string + local pool = {} local registered_nodes local max_xp = 2^31-1 @@ -34,7 +40,7 @@ minetest.register_on_mods_loaded(function() registered_nodes = minetest.registered_nodes end) -local load_data = function(player) +local function load_data(player) local name = player:get_player_name() pool[name] = {} local temp_pool = pool[name] @@ -46,7 +52,7 @@ local load_data = function(player) end -- saves data to be utilized on next login -local save_data = function(player) +local function save_data(player) local name = player:get_player_name() local temp_pool = pool[name] local meta = player:get_meta() @@ -64,7 +70,7 @@ minetest.register_on_leaveplayer(function(player) end) -- create instance of new hud -hud_manager.add_hud = function(player,hud_name,def) +function hud_manager.add_hud(player,hud_name,def) local name = player:get_player_name() if minetest.is_creative_enabled(name) then return @@ -94,7 +100,7 @@ hud_manager.add_hud = function(player,hud_name,def) end -- delete instance of hud -hud_manager.remove_hud = function(player,hud_name) +function hud_manager.remove_hud(player,hud_name) local name = player:get_player_name() if player_huds[name] and player_huds[name][hud_name] then player:hud_remove(player_huds[name][hud_name]) @@ -103,7 +109,7 @@ hud_manager.remove_hud = function(player,hud_name) end -- change element of hud -hud_manager.change_hud = function(data) +function hud_manager.change_hud(data) local name = data.player:get_player_name() if player_huds[name] and player_huds[name][data.hud_name] then data.player:hud_change(player_huds[name][data.hud_name], data.element, data.data) @@ -111,12 +117,12 @@ hud_manager.change_hud = function(data) end -- gets if hud exists -hud_manager.hud_exists = function(player,hud_name) +function hud_manager.hud_exists(player,hud_name) local name = player:get_player_name() if player_huds[name] and player_huds[name][hud_name] then - return(true) + return true else - return(false) + return false end end ------------------- @@ -127,7 +133,7 @@ minetest.register_on_leaveplayer(function(player) end) -- is used for shutdowns to save all data -local save_all = function() +local function save_all() for name,_ in pairs(pool) do local player = minetest.get_player_by_name(name) if player then @@ -144,7 +150,7 @@ end) function mcl_experience.get_player_xp_level(player) local name = player:get_player_name() - return(pool[name].level) + return pool[name].level end function mcl_experience.set_player_xp_level(player,level) @@ -262,7 +268,6 @@ function mcl_experience.add_experience(player, experience) if #final_candidates > 0 then local can = final_candidates[math.random(#final_candidates)] local stack, list, index, wear = can.stack, can.list, can.index, can.wear - local unbreaking_level = mcl_enchanting.get_enchantment(stack, "unbreaking") local uses = mcl_util.calculate_durability(stack) local multiplier = 2 * 65535 / uses local repair = experience * multiplier @@ -275,10 +280,6 @@ function mcl_experience.add_experience(player, experience) end stack:set_wear(math.floor(new_wear)) inv:set_stack(list, index, stack) - if can.list == "armor" then - local armor_inv = minetest.get_inventory({type = "detached", name = player:get_player_name() .. "_armor"}) - armor_inv:set_stack(list, index, stack) - end end local old_bar, old_xp, old_level = temp_pool.bar, temp_pool.xp, temp_pool.level @@ -333,14 +334,12 @@ minetest.register_on_dieplayer(function(player) mcl_experience.throw_experience(player:get_pos(), xp_amount) end) - -local name local collector, pos, pos2 local direction, distance, player_velocity, goal local currentvel, acceleration, multiplier, velocity local node, vel, def local is_moving, is_slippery, slippery, slip_factor -local size, data +local size local function xp_step(self, dtime) --if item set to be collected then only execute go to player if self.collected == true then diff --git a/mods/HUD/mcl_experience/locale/mcl_experience.pl.tr b/mods/HUD/mcl_experience/locale/mcl_experience.pl.tr new file mode 100644 index 000000000..5834bac14 --- /dev/null +++ b/mods/HUD/mcl_experience/locale/mcl_experience.pl.tr @@ -0,0 +1,8 @@ +# textdomain: mcl_experience +[[] ]=[[]