diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f142cd30e..ec273da06 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -31,6 +31,12 @@ Refer to [Minetest Lua API](https://github.com/minetest/minetest/blob/master/doc Follow [Lua code style guidelines](https://dev.minetest.net/Lua_code_style_guidelines). Use tabs, not spaces for indentation (tab size = 8). Never use `minetest.env`. +If you do a translation, try detecting translational issues with `check_translate_files.py` - just run it from tools folder: +```bash +# python3 check_translate_files.py fr | less +``` +(`fr` is a language code) + Check your code works as expected. Commit & push your changes to a new branch (not master, one change per a branch). diff --git a/GROUPS.md b/GROUPS.md index c65b2eb46..a6d63d82d 100644 --- a/GROUPS.md +++ b/GROUPS.md @@ -201,6 +201,8 @@ These groups are used mostly for informational purposes * `building_block=1`: Block is a building block * `deco_block=1`: Block is a decorational block +* `blast_furnace_smeltable=1` : Item or node is smeltable by a blast furnace +* `smoker_cookable=1` : Food is cookable by a smoker. ## Fake item groups These groups put similar items together which should all be treated by the gameplay or the GUI as a single item. diff --git a/README.md b/README.md index e980efa91..0beb7d4ae 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,11 @@ an explanation. ## Installation This game requires latest stable [Minetest](http://minetest.net) to run, please install -it first. Only stable versions of Minetest are officially supported. +it first. Only latest stable version of Minetest is officially supported. +There are lots of questions about Ubuntu, which has minetest-5.1.1 still. +Please, first of all, visit this page, it should fix the problem: https://launchpad.net/~minetestdevs/+archive/ubuntu/stable +Also, here is endless issue #123: https://git.minetest.land/MineClone5/MineClone5/issues/123 - really less preferable way. + There is no support for running MineClone 5 in development versions of Minetest. To install MineClone 5 (if you haven't already), move this directory into the diff --git a/mods/CORE/mcl_explosions/locale/mcl_explosions.oc.tr b/mods/CORE/mcl_explosions/locale/mcl_explosions.oc.tr new file mode 100644 index 000000000..d14aca0fa --- /dev/null +++ b/mods/CORE/mcl_explosions/locale/mcl_explosions.oc.tr @@ -0,0 +1,2 @@ +# textdomain:mcl_explosions +@1 was caught in an explosion.=@1 es mòrt(a) dins una petarada. \ No newline at end of file diff --git a/mods/CORE/mcl_mapgen/init.lua b/mods/CORE/mcl_mapgen/init.lua index 4aca65f54..5fadc3c9f 100644 --- a/mods/CORE/mcl_mapgen/init.lua +++ b/mods/CORE/mcl_mapgen/init.lua @@ -148,16 +148,48 @@ local chunk_scan_range = { [ CS_NODES] = {LAST_BLOCK+1, LAST_BLOCK+1}, } +local EDGE_MIN = mcl_mapgen.EDGE_MIN +local EDGE_MAX = mcl_mapgen.EDGE_MAX local function is_chunk_finished(minp) - local center = vector.add(minp, HALF_CS_NODES) - for check_x = center.x - CS_NODES, center.x + CS_NODES, CS_NODES do - for check_y = center.y - CS_NODES, center.y + CS_NODES, CS_NODES do - for check_z = center.z - CS_NODES, center.z + CS_NODES, CS_NODES do - local pos = vector.new(check_x, check_y, check_z) - if pos ~= center then - minetest_get_voxel_manip():read_from_map(pos, pos) - local node = minetest_get_node(pos) + local center_x = minp.x + HALF_CS_NODES + local center_y = minp.y + HALF_CS_NODES + local center_z = minp.z + HALF_CS_NODES + local from_x = center_x - CS_NODES + local from_y = center_y - CS_NODES + local from_z = center_z - CS_NODES + local to_x = center_x + CS_NODES + local to_y = center_y + CS_NODES + local to_z = center_z + CS_NODES + if from_x < EDGE_MIN then from_x = center_x end + if from_y < EDGE_MIN then from_y = center_y end + if from_z < EDGE_MIN then from_z = center_z end + if to_x > EDGE_MAX then to_x = center_x end + if to_y > EDGE_MAX then to_y = center_y end + if to_z > EDGE_MAX then to_z = center_z end + for check_x = from_x, to_x, CS_NODES do + local are_we_in_central_chunk = check_x == center_x + for check_y = from_y, to_y, CS_NODES do + are_we_in_central_chunk = are_we_in_central_chunk and (check_y == center_y) + for check_z = from_z, to_z, CS_NODES do + are_we_in_central_chunk = are_we_in_central_chunk and (check_z == center_z) + if not are_we_in_central_chunk then + local check_pos = {x = check_x, y = check_y, z = check_z} + minetest_get_voxel_manip():read_from_map(check_pos, check_pos) + local node = minetest_get_node(check_pos) if node.name == "ignore" then + -- return nil, means false, means, there is something to generate still, + -- (because one of adjacent chunks is unfinished - "ignore" means that), + -- means this chunk will be changed, at least one of its sides or corners + -- means it's unsafe to place anything there right now, it might disappar, + -- better to wait, see the diagram of conflict/ok areas per a single axis: + + -- conflict| ok |conflict|conflict| ok |conflict|conflict| ok |conflict + -- (_________Chunk1_________)|(_________Chunk2_________)|(_________Chunk3_________) + -- [Block1]|[MidBlk]|[BlockN]|[Block1]|[MidBlk]|[BlockN]|[Block1]|[MidBlk]|[BlockN] + -- \_____________Chunk2-with-shell____________/ + -- ...______Chunk1-with-shell________/ \________Chunk3-with-shell______... + -- Generation of chunk 1 AFFECTS 2 ^^^ ^^^ Generation of chunk 3 affects 2 + -- ^^^^^^^^Chunk 2 gen. affects 1 and 3^^^^^^^^ return end end @@ -325,7 +357,7 @@ minetest.register_on_generated(function(minp, maxp, chunkseed) -- mcl_mapgen.register_mapgen_lvm(function(vm_context), order_number) -- -- -- for _, v in pairs(queue_chunks_lvm) do - vm_context = v.f(vm_context) + v.f(vm_context) end -- -- -- mcl_mapgen.register_mapgen(function(minp, maxp, chunkseed, vm_context), order_number) -- diff --git a/mods/CORE/mcl_util/init.lua b/mods/CORE/mcl_util/init.lua index 90e44cedc..1ba698344 100644 --- a/mods/CORE/mcl_util/init.lua +++ b/mods/CORE/mcl_util/init.lua @@ -1,5 +1,11 @@ mcl_util = {} +local minetest_get_item_group = minetest.get_item_group +local minetest_get_meta = minetest.get_meta +local minetest_get_node = minetest.get_node +local minetest_get_node_timer = minetest.get_node_timer +local table_copy = table.copy + -- Updates all values in t using values from to*. function table.update(t, ...) for _, to in ipairs{...} do @@ -33,36 +39,6 @@ function mcl_util.rotate_axis(itemstack, placer, pointed_thing) return itemstack end --- Returns position of the neighbor of a double chest node --- or nil if node is invalid. --- This function assumes that the large chest is actually intact --- * pos: Position of the node to investigate --- * param2: param2 of that node --- * side: Which "half" the investigated node is. "left" or "right" -function mcl_util.get_double_container_neighbor_pos(pos, param2, side) - if side == "right" then - if param2 == 0 then - return {x=pos.x-1, y=pos.y, z=pos.z} - elseif param2 == 1 then - return {x=pos.x, y=pos.y, z=pos.z+1} - elseif param2 == 2 then - return {x=pos.x+1, y=pos.y, z=pos.z} - elseif param2 == 3 then - return {x=pos.x, y=pos.y, z=pos.z-1} - end - else - if param2 == 0 then - return {x=pos.x+1, y=pos.y, z=pos.z} - elseif param2 == 1 then - return {x=pos.x, y=pos.y, z=pos.z-1} - elseif param2 == 2 then - return {x=pos.x-1, y=pos.y, z=pos.z} - elseif param2 == 3 then - return {x=pos.x, y=pos.y, z=pos.z+1} - end - end -end - -- Iterates through all items in the given inventory and -- returns the slot of the first item which matches a condition. -- Returns nil if no item was found. @@ -87,7 +63,7 @@ end -- Returns true if itemstack is a shulker box local function is_not_shulker_box(itemstack) - local g = minetest.get_item_group(itemstack:get_name(), "shulker_box") + local g = minetest_get_item_group(itemstack:get_name(), "shulker_box") return g == 0 or g == nil end @@ -133,136 +109,116 @@ end --- source_stack_id (optional): The inventory position ID of the source inventory to take the item from (-1 for slot of the first valid item; -1 is default) --- destination_list (optional): List name of the destination inventory. Default is normally "main"; "src" for furnace -- Returns true on success and false on failure. +local SHULKER_BOX = 3 +local FURNACE = 4 +local DOUBLE_CHEST_LEFT = 5 +local DOUBLE_CHEST_RIGHT = 6 +local CONTAINER_GROUP_TO_LIST = { + [1] = "main", + [2] = "main", + [SHULKER_BOX] = "main", + [FURNACE] = "dst", + [DOUBLE_CHEST_LEFT] = "main", + [DOUBLE_CHEST_RIGHT] = "main", +} function mcl_util.move_item_container(source_pos, destination_pos, source_list, source_stack_id, destination_list) - local dpos = table.copy(destination_pos) - local spos = table.copy(source_pos) - local snode = minetest.get_node(spos) - local dnode = minetest.get_node(dpos) - - local dctype = minetest.get_item_group(dnode.name, "container") - local sctype = minetest.get_item_group(snode.name, "container") - - -- Container type 7 does not allow any movement - if sctype == 7 then - return false - end - - -- Normalize double container by forcing to always use the left segment first - 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 - return false - end - node = minetest.get_node(pos) - ctype = minetest.get_item_group(node.name, "container") - -- The left segment seems incorrect? We better bail out! - if ctype ~= 5 then - return false - end + local spos = table_copy(source_pos) + local snode = minetest_get_node(spos) + local sctype = minetest_get_item_group(snode.name, "container") + local default_source_list = CONTAINER_GROUP_TO_LIST[sctype] + if not default_source_list then return end + if sctype == DOUBLE_CHEST_RIGHT then + local sparam2 = snode.param2 + if sparam2 == 0 then spos.x = spos.x - 1 + elseif sparam2 == 1 then spos.z = spos.z + 1 + elseif sparam2 == 2 then spos.x = spos.x + 1 + elseif sparam2 == 3 then spos.z = spos.z - 1 end - return pos, node, ctype + snode = minetest_get_node(spos) + sctype = minetest_get_item_group(snode.name, "container") + if sctype ~= DOUBLE_CHEST_LEFT then return end end - - spos, snode, sctype = normalize_double_container(spos, snode, sctype) - dpos, dnode, dctype = normalize_double_container(dpos, dnode, dctype) - if not spos or not dpos then return false end - - local smeta = minetest.get_meta(spos) - local dmeta = minetest.get_meta(dpos) - + local smeta = minetest_get_meta(spos) local sinv = smeta:get_inventory() + local source_list = source_list or default_source_list + + local dpos = table_copy(destination_pos) + local dnode = minetest_get_node(dpos) + local dctype = minetest_get_item_group(dnode.name, "container") + local default_destination_list = CONTAINER_GROUP_TO_LIST[sctype] + if not default_destination_list then return end + if dctype == DOUBLE_CHEST_RIGHT then + local dparam2 = dnode.param2 + if dparam2 == 0 then dpos.x = dpos.x - 1 + elseif dparam2 == 1 then dpos.z = dpos.z + 1 + elseif dparam2 == 2 then dpos.x = dpos.x + 1 + elseif dparam2 == 3 then dpos.z = dpos.z - 1 + end + dnode = minetest_get_node(dpos) + dctype = minetest_get_item_group(dnode.name, "container") + if dctype ~= DOUBLE_CHEST_LEFT then return end + end + local dmeta = minetest_get_meta(dpos) local dinv = dmeta:get_inventory() - -- Default source lists - if not source_list then - -- Main inventory for most container types - if sctype == 2 or sctype == 3 or sctype == 5 or sctype == 6 or sctype == 7 then - source_list = "main" - -- Furnace: output - elseif sctype == 4 then - source_list = "dst" - -- Unknown source container type. Bail out - else - return false - end - end - -- Automatically select stack slot ID if set to automatic - if not source_stack_id then - source_stack_id = -1 - end + local source_stack_id = source_stack_id or -1 if source_stack_id == -1 then local cond = nil -- Prevent shulker box inception - if dctype == 3 then - cond = is_not_shulker_box - end + if dctype == SHULKER_BOX then cond = is_not_shulker_box end source_stack_id = mcl_util.get_eligible_transfer_item_slot(sinv, source_list, dinv, dpos, cond) if not source_stack_id then - -- Try again if source is a double container - if sctype == 5 then - spos = mcl_util.get_double_container_neighbor_pos(spos, snode.param2, "left") - smeta = minetest.get_meta(spos) - sinv = smeta:get_inventory() - - source_stack_id = mcl_util.get_eligible_transfer_item_slot(sinv, source_list, dinv, dpos, cond) - if not source_stack_id then - return false + if sctype == DOUBLE_CHEST_LEFT then + local sparam2 = snode.param2 + if sparam2 == 0 then spos.x = spos.x + 1 + elseif sparam2 == 1 then spos.z = spos.z - 1 + elseif sparam2 == 2 then spos.x = spos.x - 1 + elseif sparam2 == 3 then spos.z = spos.z + 1 end - else - return false + snode = minetest_get_node(spos) + sctype = minetest_get_item_group(snode.name, "container") + if sctype ~= DOUBLE_CHEST_RIGHT then return end + smeta = minetest_get_meta(spos) + sinv = smeta:get_inventory() + source_stack_id = mcl_util.get_eligible_transfer_item_slot(sinv, source_list, dinv, dpos, cond) end end + if not source_stack_id then return end end -- Abort transfer if shulker box wants to go into shulker box - if dctype == 3 then + if dctype == SHULKER_BOX then local stack = sinv:get_stack(source_list, source_stack_id) - if stack and minetest.get_item_group(stack:get_name(), "shulker_box") == 1 then - return false - end - end - -- Container type 7 does not allow any placement - if dctype == 7 then - return false + if stack and minetest_get_item_group(stack:get_name(), "shulker_box") == 1 then return end end - -- If it's a container, put it into the container - if dctype ~= 0 then - -- Automatically select a destination list if omitted - if not destination_list then - -- Main inventory for most container types - if dctype == 2 or dctype == 3 or dctype == 5 or dctype == 6 or dctype == 7 then - destination_list = "main" - -- Furnace source slot - elseif dctype == 4 then - destination_list = "src" + local destination_list = destination_list or default_destination_list + -- Move item + local ok = mcl_util.move_item(sinv, source_list, source_stack_id, dinv, destination_list) + -- Try transfer to neighbor node if transfer failed and double container + if not ok then + if dctype == DOUBLE_CHEST_LEFT then + local dparam2 = dnode.param2 + if dparam2 == 0 then dpos.x = dpos.x + 1 + elseif dparam2 == 1 then dpos.z = dpos.z - 1 + elseif dparam2 == 2 then dpos.x = dpos.x - 1 + elseif dparam2 == 3 then dpos.z = dpos.z + 1 end - end - if destination_list then - -- Move item - local ok = mcl_util.move_item(sinv, source_list, source_stack_id, dinv, destination_list) - - -- Try transfer to neighbor node if transfer failed and double container - if not ok and dctype == 5 then - dpos = mcl_util.get_double_container_neighbor_pos(dpos, dnode.param2, "left") - dmeta = minetest.get_meta(dpos) - dinv = dmeta:get_inventory() - - ok = mcl_util.move_item(sinv, source_list, source_stack_id, dinv, destination_list) - end - - -- Update furnace - if ok and dctype == 4 then - -- Start furnace's timer function, it will sort out whether furnace can burn or not. - minetest.get_node_timer(dpos):start(1.0) - end - - return ok + dnode = minetest_get_node(dpos) + dctype = minetest_get_item_group(dnode.name, "container") + if dctype ~= DOUBLE_CHEST_RIGHT then return end + dmeta = minetest_get_meta(dpos) + dinv = dmeta:get_inventory() + ok = mcl_util.move_item(sinv, source_list, source_stack_id, dinv, destination_list) end end - return false + -- Update furnace + if ok and dctype == FURNACE then + -- Start furnace's timer function, it will sort out whether furnace can burn or not. + minetest_get_node_timer(dpos):start(1.0) + end + return ok end -- Returns the ID of the first non-empty slot in the given inventory list @@ -292,7 +248,7 @@ function mcl_util.generate_on_place_plant_function(condition) end -- Call on_rightclick if the pointed node defines it - local node = minetest.get_node(pointed_thing.under) + local node = minetest_get_node(pointed_thing.under) if placer and not placer:get_player_control().sneak then if minetest.registered_nodes[node.name] and minetest.registered_nodes[node.name].on_rightclick then return minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, placer, itemstack) or itemstack @@ -300,8 +256,8 @@ function mcl_util.generate_on_place_plant_function(condition) end local place_pos - local def_under = minetest.registered_nodes[minetest.get_node(pointed_thing.under).name] - local def_above = minetest.registered_nodes[minetest.get_node(pointed_thing.above).name] + local def_under = minetest.registered_nodes[minetest_get_node(pointed_thing.under).name] + local def_above = minetest.registered_nodes[minetest_get_node(pointed_thing.above).name] if not def_under or not def_above then return itemstack end @@ -359,7 +315,7 @@ function mcl_util.call_on_rightclick(itemstack, player, pointed_thing) -- Call on_rightclick if the pointed node defines it if pointed_thing and pointed_thing.type == "node" then local pos = pointed_thing.under - local node = minetest.get_node(pos) + local node = minetest_get_node(pos) if player and not player:get_player_control().sneak then local nodedef = minetest.registered_nodes[node.name] local on_rightclick = nodedef and nodedef.on_rightclick @@ -372,7 +328,7 @@ end function mcl_util.calculate_durability(itemstack) local unbreaking_level = mcl_enchanting.get_enchantment(itemstack, "unbreaking") - local armor_uses = minetest.get_item_group(itemstack:get_name(), "mcl_armor_uses") + local armor_uses = minetest_get_item_group(itemstack:get_name(), "mcl_armor_uses") local uses @@ -417,6 +373,7 @@ function mcl_util.deal_damage(target, damage, mcl_reason) -- target:punch(puncher, 1.0, {full_punch_interval = 1.0, damage_groups = {fleshy = damage}}, vector.direction(puncher:get_pos(), target:get_pos()), damage) if luaentity.health > 0 then luaentity.health = luaentity.health - damage + luaentity.pause_timer = 0.4 end return end diff --git a/mods/CORE/mcl_worlds/init.lua b/mods/CORE/mcl_worlds/init.lua index eb366013e..d31913599 100644 --- a/mods/CORE/mcl_worlds/init.lua +++ b/mods/CORE/mcl_worlds/init.lua @@ -152,3 +152,23 @@ minetest.register_globalstep(function(dtime) dimtimer = 0 end end) + +function mcl_worlds.get_cloud_parameters() + if mcl_mapgen.name == "valleys" then + return { + height = 384, + speed = {x=-2, z=0}, + thickness=5, + color="#FFF0FEF", + ambient = "#201060", + } + else + -- MC-style clouds: Layer 127, thickness 4, fly to the “West” + return { + height = mcl_worlds.layer_to_y(127), + speed = {x=-2, z=0}, + thickness = 4, + color = "#FFF0FEF", + } + end +end diff --git a/mods/CORE/tga_encoder/LICENSE b/mods/CORE/tga_encoder/LICENSE new file mode 100644 index 000000000..f288702d2 --- /dev/null +++ b/mods/CORE/tga_encoder/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/mods/CORE/tga_encoder/README.md b/mods/CORE/tga_encoder/README.md new file mode 100644 index 000000000..1ad978a22 --- /dev/null +++ b/mods/CORE/tga_encoder/README.md @@ -0,0 +1,87 @@ +# tga_encoder +A TGA Encoder written in Lua without the use of external Libraries. + +Created by fleckenstein for MineClone2, then improved by erlehmann. + +May be used as a Minetest mod. + +See `examples.lua` for example code and usage hints. + +## Use Cases for `tga_encoder` + +### Encoding Textures for Editing + +TGA images of types 1/2/3 consist of header data followed by a pixel array. + +This makes it trivial to parse TGA files – and even edit pixels in-place. + +No checksums need to be updated on any kind of in-place texture editing. + +**Tip**: When storing an editable image in item meta, use zlib compression. + +### Legacy Minetest Texture Encoding + +Minetest 5.4 did not include `minetest.encode_png()` (or any equvivalent). + +Since `tga_encoder` is written in pure Lua, it does not need engine support. + +**Tip:** Look at `examples.lua` and the Minetest mod `mcl_maps` for guidance. + +### Advanced Texture Format Control + +The function `minetest.encode_png()` always encodes images as 32bpp RGBA. + +`tga_encoder` allows saving images as grayscale, 16bpp RGBA and 24bpp RGB. + +For generating maps from terrain, color-mapped formats can be more useful. + +### Encoding Very Small Textures + +Images of size 8×8 or below are often smaller than an equivalent PNG file. + +Note that on many filesystems files use at least 4096 bytes (i.e. 64×64). + +Therefore, saving bytes on files up to a few 100 bytes is often useless. + +### Encoding Reference Textures + +TGA is a simple format, which makes it easy to create reference textures. + +Using a hex editor, one can trivially see how all the pixels are stored. + +## Supported Image Types + +For all types, images are encoded in a fast single pass (i.e. append-only). + +### Color-Mapped Images (Type 1) + +These images contain a palette, followed by pixel data. + +* `A1R5G5B5` (8bpp RGB) +* `B8G8R8` (8bpp RGB) +* `B8G8R8A8` (8bpp RGBA) + +### True-Color Images (Type 2) + +These images contain uncompressed RGB(A) pixel data. + +* `A1R5G5B5` (16bpp RGBA) +* `B8G8R8` (24bpp RGB) +* `B8G8R8A8` (32bpp RGBA) + +### Grayscale Images (Type 3) + +* `Y8` (8bpp grayscale) + +### Run-Length Encoded (RLE), True-Color Images (Type 10) + +These images contain compressed RGB(A) pixel data. + +* `A1R5G5B5` (16bpp RGBA) +* `B8G8R8` (24bpp RGB) +* `B8G8R8A8` (32bpp RGBA) + +## TODO + +* Actually support `R8G8B8A8` input for `A1R5G5B5` output +* Add both zoomable and explorable maps to `mcl_maps`. diff --git a/mods/CORE/tga_encoder/examples.lua b/mods/CORE/tga_encoder/examples.lua new file mode 100644 index 000000000..7642281aa --- /dev/null +++ b/mods/CORE/tga_encoder/examples.lua @@ -0,0 +1,150 @@ +dofile("init.lua") + +-- encode a bitmap +local _ = { 0, 0, 0 } +local R = { 255, 127, 127 } +local pixels = { + { _, _, _, _, _, _, _ }, + { _, _, _, R, _, _, _ }, + { _, _, R, R, R, _, _ }, + { _, R, R, R, R, R, _ }, + { _, R, R, R, R, R, _ }, + { _, _, R, _, R, _, _ }, + { _, _, _, _, _, _, _ }, +} +tga_encoder.image(pixels):save("bitmap_small.tga") + +-- change a single pixel, then rescale the bitmap +local pixels_orig = pixels +pixels_orig[4][4] = { 255, 255, 255 } +local pixels = {} +for x = 1,56,1 do + local x_orig = math.ceil(x/8) + for z = 1,56,1 do + local z_orig = math.ceil(z/8) + local color = pixels_orig[z_orig][x_orig] + pixels[z] = pixels[z] or {} + pixels[z][x] = color + end +end +tga_encoder.image(pixels):save("bitmap_large.tga") + +-- note that the uncompressed grayscale TGA file written in this +-- example is 80 bytes – but an optimized PNG file is 81 bytes … +local pixels = {} +for x = 1,6,1 do -- left to right + for z = 1,6,1 do -- bottom to top + local color = { math.min(x * z * 4 - 1, 255) } + pixels[z] = pixels[z] or {} + pixels[z][x] = color + end +end +tga_encoder.image(pixels):save("gradient_8bpp_raw.tga", {color_format="Y8", compression="RAW"}) + +local pixels = {} +for x = 1,16,1 do -- left to right + for z = 1,16,1 do -- bottom to top + local r = math.min(x * 32 - 1, 255) + local g = math.min(z * 32 - 1, 255) + local b = 0 + -- blue rectangle in top right corner + if x > 8 and z > 8 then + r = 0 + g = 0 + b = math.min(z * 16 - 1, 255) + end + local color = { r, g, b } + pixels[z] = pixels[z] or {} + pixels[z][x] = color + end +end +local gradients = tga_encoder.image(pixels) +gradients:save("gradients_8bpp_raw.tga", {color_format="Y8", compression="RAW"}) +gradients:save("gradients_16bpp_raw.tga", {color_format="A1R5G5B5", compression="RAW"}) +gradients:save("gradients_16bpp_rle.tga", {color_format="A1R5G5B5", compression="RLE"}) +gradients:save("gradients_24bpp_raw.tga", {color_format="B8G8R8", compression="RAW"}) +gradients:save("gradients_24bpp_rle.tga", {color_format="B8G8R8", compression="RLE"}) + +for x = 1,16,1 do -- left to right + for z = 1,16,1 do -- bottom to top + local color = pixels[z][x] + color[#color+1] = ((x * x) + (z * z)) % 256 + pixels[z][x] = color + end +end +gradients:save("gradients_32bpp_raw.tga", {color_format="B8G8R8A8", compression="RAW"}) +-- the RLE-compressed file is larger than just dumping pixels because +-- the gradients in this picture can not be compressed well using RLE +gradients:save("gradients_32bpp_rle.tga", {color_format="B8G8R8A8", compression="RLE"}) + +local pixels = {} +for x = 1,512,1 do -- left to right + for z = 1,512,1 do -- bottom to top + local oz = (z - 256) / 256 + 0.75 + local ox = (x - 256) / 256 + local px, pz, i = 0, 0, 0 + while (px * px) + (pz * pz) <= 4 and i < 128 do + px = (px * px) - (pz * pz) + oz + pz = (2 * px * pz) + ox + i = i + 1 + end + local color = { + math.max(0, math.min(255, math.floor(px * 64))), + math.max(0, math.min(255, math.floor(pz * 64))), + math.max(0, math.min(255, math.floor(i))), + } + pixels[z] = pixels[z] or {} + pixels[z][x] = color + end +end +tga_encoder.image(pixels):save("fractal_8bpp.tga", {color_format="Y8"}) +tga_encoder.image(pixels):save("fractal_16bpp.tga", {color_format="A1R5G5B5"}) +tga_encoder.image(pixels):save("fractal_24bpp.tga", {color_format="B8G8R8"}) + +-- encode a colormapped bitmap +local K = { 0 } +local B = { 1 } +local R = { 2 } +local G = { 3 } +local W = { 4 } +local colormap = { + { 1, 2, 3 }, -- K + { 0, 0, 255 }, -- B + { 255, 0, 0 }, -- R + { 0, 255, 0 }, -- G + { 253, 254, 255 }, -- W +} +local pixels = { + { W, K, W, K, W, K, W }, + { R, G, B, R, G, B, K }, + { K, W, K, W, K, W, K }, + { G, B, R, G, B, R, W }, + { W, W, W, K, K, K, W }, + { B, R, G, B, R, G, K }, + { B, R, G, B, R, G, W }, +} +-- note that the uncompressed colormapped TGA file written in this +-- example is 108 bytes – but an optimized PNG file is 121 bytes … +tga_encoder.image(pixels):save("colormapped_B8G8R8.tga", {colormap=colormap}) +-- encoding as A1R5G5B5 saves 1 byte per palette entry → 103 bytes +tga_encoder.image(pixels):save("colormapped_A1R5G5B5.tga", {colormap=colormap, color_format="A1R5G5B5"}) + +-- encode a colormapped bitmap with transparency +local _ = { 0 } +local K = { 1 } +local W = { 2 } +local colormap = { + { 0, 0, 0, 0 }, + { 0, 0, 0, 255 }, + { 255, 255, 255, 255 }, +} +local pixels = { + { _, K, K, K, K, K, _ }, + { _, K, W, W, W, K, _ }, + { K, K, W, W, W, K, K }, + { K, W, W, W, W, W, K }, + { _, K, W, W, W, K, _ }, + { _, _, K, W, K, _, _ }, + { _, _, _, K, _, _, _ }, +} +tga_encoder.image(pixels):save("colormapped_B8G8R8A8.tga", {colormap=colormap}) diff --git a/mods/CORE/tga_encoder/init.lua b/mods/CORE/tga_encoder/init.lua new file mode 100644 index 000000000..ed387eec0 --- /dev/null +++ b/mods/CORE/tga_encoder/init.lua @@ -0,0 +1,594 @@ +tga_encoder = {} + +local image = setmetatable({}, { + __call = function(self, ...) + local t = setmetatable({}, {__index = self}) + t:constructor(...) + return t + end, +}) + +function image:constructor(pixels) + self.pixels = pixels + self.width = #pixels[1] + self.height = #pixels +end + +local pixel_depth_by_color_format = { + ["Y8"] = 8, + ["A1R5G5B5"] = 16, + ["B8G8R8"] = 24, + ["B8G8R8A8"] = 32, +} + +function image:encode_colormap_spec(properties) + local colormap = properties.colormap + local colormap_pixel_depth = 0 + if 0 ~= #colormap then + colormap_pixel_depth = pixel_depth_by_color_format[ + properties.color_format + ] + end + local colormap_spec = + string.char(0, 0) .. -- first entry index + string.char(#colormap % 256, math.floor(#colormap / 256)) .. -- number of entries + string.char(colormap_pixel_depth) -- bits per pixel + self.data = self.data .. colormap_spec +end + +function image:encode_image_spec(properties) + local color_format = properties.color_format + assert( + "Y8" == color_format or -- (8 bit grayscale = 1 byte = 8 bits) + "A1R5G5B5" == color_format or -- (A1R5G5B5 = 2 bytes = 16 bits) + "B8G8R8" == color_format or -- (B8G8R8 = 3 bytes = 24 bits) + "B8G8R8A8" == color_format -- (B8G8R8A8 = 4 bytes = 32 bits) + ) + local pixel_depth + if 0 ~= #properties.colormap then + pixel_depth = self.pixel_depth + else + pixel_depth = pixel_depth_by_color_format[color_format] + end + assert( nil ~= pixel_depth) + self.data = self.data + .. string.char(0, 0) -- X-origin + .. string.char(0, 0) -- Y-origin + .. string.char(self.width % 256, math.floor(self.width / 256)) -- width + .. string.char(self.height % 256, math.floor(self.height / 256)) -- height + .. string.char(pixel_depth) + .. string.char(0) -- image descriptor +end + +function image:encode_colormap(properties) + local colormap = properties.colormap + if 0 == #colormap then + return + end + local color_format = properties.color_format + assert ( + "A1R5G5B5" == color_format or + "B8G8R8" == color_format or + "B8G8R8A8" == color_format + ) + local colors = {} + if "A1R5G5B5" == color_format then + -- Sample depth rescaling is done according to the algorithm presented in: + -- + local max_sample_in = math.pow(2, 8) - 1 + local max_sample_out = math.pow(2, 5) - 1 + for i = 1,#colormap,1 do + local color = colormap[i] + local colorword = 32768 + + ((math.floor((color[1] * max_sample_out / max_sample_in) + 0.5)) * 1024) + + ((math.floor((color[2] * max_sample_out / max_sample_in) + 0.5)) * 32) + + ((math.floor((color[3] * max_sample_out / max_sample_in) + 0.5)) * 1) + local color_bytes = string.char( + colorword % 256, + math.floor(colorword / 256) + ) + colors[#colors + 1] = color_bytes + end + elseif "B8G8R8" == color_format then + for i = 1,#colormap,1 do + local color = colormap[i] + local color_bytes = string.char( + color[3], -- B + color[2], -- G + color[1] -- R + ) + colors[#colors + 1] = color_bytes + end + elseif "B8G8R8A8" == color_format then + for i = 1,#colormap,1 do + local color = colormap[i] + local color_bytes = string.char( + color[3], -- B + color[2], -- G + color[1], -- R + color[4] -- A + ) + colors[#colors + 1] = color_bytes + end + end + assert( 0 ~= #colors ) + self.data = self.data .. table.concat(colors) +end + +function image:encode_header(properties) + local color_format = properties.color_format + local colormap = properties.colormap + local compression = properties.compression + local colormap_type + local image_type + if "Y8" == color_format and "RAW" == compression then + colormap_type = 0 + image_type = 3 -- grayscale + elseif ( + "A1R5G5B5" == color_format or + "B8G8R8" == color_format or + "B8G8R8A8" == color_format + ) then + if "RAW" == compression then + if 0 ~= #colormap then + colormap_type = 1 + image_type = 1 -- colormapped RGB(A) + else + colormap_type = 0 + image_type = 2 -- RAW RGB(A) + end + elseif "RLE" == compression then + colormap_type = 0 + image_type = 10 -- RLE RGB + end + end + assert( nil ~= colormap_type ) + assert( nil ~= image_type ) + self.data = self.data + .. string.char(0) -- image id + .. string.char(colormap_type) + .. string.char(image_type) + self:encode_colormap_spec(properties) -- color map specification + self:encode_image_spec(properties) -- image specification + self:encode_colormap(properties) +end + +function image:encode_data(properties) + local color_format = properties.color_format + local colormap = properties.colormap + local compression = properties.compression + + local data_length_before = #self.data + if "Y8" == color_format and "RAW" == compression then + if 8 == self.pixel_depth then + self:encode_data_Y8_as_Y8_raw() + elseif 24 == self.pixel_depth then + self:encode_data_R8G8B8_as_Y8_raw() + end + elseif "A1R5G5B5" == color_format then + if 0 ~= #colormap then + if "RAW" == compression then + if 8 == self.pixel_depth then + self:encode_data_Y8_as_Y8_raw() + end + end + else + if "RAW" == compression then + self:encode_data_R8G8B8_as_A1R5G5B5_raw() + elseif "RLE" == compression then + self:encode_data_R8G8B8_as_A1R5G5B5_rle() + end + end + elseif "B8G8R8" == color_format then + if 0 ~= #colormap then + if "RAW" == compression then + if 8 == self.pixel_depth then + self:encode_data_Y8_as_Y8_raw() + end + end + else + if "RAW" == compression then + self:encode_data_R8G8B8_as_B8G8R8_raw() + elseif "RLE" == compression then + self:encode_data_R8G8B8_as_B8G8R8_rle() + end + end + elseif "B8G8R8A8" == color_format then + if 0 ~= #colormap then + if "RAW" == compression then + if 8 == self.pixel_depth then + self:encode_data_Y8_as_Y8_raw() + end + end + else + if "RAW" == compression then + self:encode_data_R8G8B8A8_as_B8G8R8A8_raw() + elseif "RLE" == compression then + self:encode_data_R8G8B8A8_as_B8G8R8A8_rle() + end + end + end + local data_length_after = #self.data + assert( + data_length_after ~= data_length_before, + "No data encoded for color format: " .. color_format + ) +end + +function image:encode_data_Y8_as_Y8_raw() + assert(8 == self.pixel_depth) + local raw_pixels = {} + for _, row in ipairs(self.pixels) do + for _, pixel in ipairs(row) do + local raw_pixel = string.char(pixel[1]) + raw_pixels[#raw_pixels + 1] = raw_pixel + end + end + self.data = self.data .. table.concat(raw_pixels) +end + +function image:encode_data_R8G8B8_as_Y8_raw() + assert(24 == self.pixel_depth) + local raw_pixels = {} + for _, row in ipairs(self.pixels) do + for _, pixel in ipairs(row) do + -- the HSP RGB to brightness formula is + -- sqrt( 0.299 r² + .587 g² + .114 b² ) + -- see + local gray = math.floor( + math.sqrt( + 0.299 * pixel[1]^2 + + 0.587 * pixel[2]^2 + + 0.114 * pixel[3]^2 + ) + 0.5 + ) + local raw_pixel = string.char(gray) + raw_pixels[#raw_pixels + 1] = raw_pixel + end + end + self.data = self.data .. table.concat(raw_pixels) +end + +function image:encode_data_R8G8B8_as_A1R5G5B5_raw() + assert(24 == self.pixel_depth) + local raw_pixels = {} + -- Sample depth rescaling is done according to the algorithm presented in: + -- + local max_sample_in = math.pow(2, 8) - 1 + local max_sample_out = math.pow(2, 5) - 1 + for _, row in ipairs(self.pixels) do + for _, pixel in ipairs(row) do + local colorword = 32768 + + ((math.floor((pixel[1] * max_sample_out / max_sample_in) + 0.5)) * 1024) + + ((math.floor((pixel[2] * max_sample_out / max_sample_in) + 0.5)) * 32) + + ((math.floor((pixel[3] * max_sample_out / max_sample_in) + 0.5)) * 1) + local raw_pixel = string.char(colorword % 256, math.floor(colorword / 256)) + raw_pixels[#raw_pixels + 1] = raw_pixel + end + end + self.data = self.data .. table.concat(raw_pixels) +end + +function image:encode_data_R8G8B8_as_A1R5G5B5_rle() + assert(24 == self.pixel_depth) + local colorword = nil + local previous_r = nil + local previous_g = nil + local previous_b = nil + local raw_pixel = '' + local raw_pixels = {} + local count = 1 + local packets = {} + local raw_packet = '' + local rle_packet = '' + -- Sample depth rescaling is done according to the algorithm presented in: + -- + local max_sample_in = math.pow(2, 8) - 1 + local max_sample_out = math.pow(2, 5) - 1 + for _, row in ipairs(self.pixels) do + for _, pixel in ipairs(row) do + if pixel[1] ~= previous_r or pixel[2] ~= previous_g or pixel[3] ~= previous_b or count == 128 then + if nil ~= previous_r then + colorword = 32768 + + ((math.floor((previous_r * max_sample_out / max_sample_in) + 0.5)) * 1024) + + ((math.floor((previous_g * max_sample_out / max_sample_in) + 0.5)) * 32) + + ((math.floor((previous_b * max_sample_out / max_sample_in) + 0.5)) * 1) + if 1 == count then + -- remember pixel verbatim for raw encoding + raw_pixel = string.char(colorword % 256, math.floor(colorword / 256)) + raw_pixels[#raw_pixels + 1] = raw_pixel + if 128 == #raw_pixels then + raw_packet = string.char(#raw_pixels - 1) + packets[#packets + 1] = raw_packet + for i=1, #raw_pixels do + packets[#packets +1] = raw_pixels[i] + end + raw_pixels = {} + end + else + -- encode raw pixels, if any + if #raw_pixels > 0 then + raw_packet = string.char(#raw_pixels - 1) + packets[#packets + 1] = raw_packet + for i=1, #raw_pixels do + packets[#packets +1] = raw_pixels[i] + end + raw_pixels = {} + end + -- RLE encoding + rle_packet = string.char(128 + count - 1, colorword % 256, math.floor(colorword / 256)) + packets[#packets +1] = rle_packet + end + end + count = 1 + previous_r = pixel[1] + previous_g = pixel[2] + previous_b = pixel[3] + else + count = count + 1 + end + end + end + colorword = 32768 + + ((math.floor((previous_r * max_sample_out / max_sample_in) + 0.5)) * 1024) + + ((math.floor((previous_g * max_sample_out / max_sample_in) + 0.5)) * 32) + + ((math.floor((previous_b * max_sample_out / max_sample_in) + 0.5)) * 1) + if 1 == count then + raw_pixel = string.char(colorword % 256, math.floor(colorword / 256)) + raw_pixels[#raw_pixels + 1] = raw_pixel + raw_packet = string.char(#raw_pixels - 1) + packets[#packets + 1] = raw_packet + for i=1, #raw_pixels do + packets[#packets +1] = raw_pixels[i] + end + raw_pixels = {} + else + -- encode raw pixels, if any + if #raw_pixels > 0 then + raw_packet = string.char(#raw_pixels - 1) + packets[#packets + 1] = raw_packet + for i=1, #raw_pixels do + packets[#packets +1] = raw_pixels[i] + end + raw_pixels = {} + end + -- RLE encoding + rle_packet = string.char(128 + count - 1, colorword % 256, math.floor(colorword / 256)) + packets[#packets +1] = rle_packet + end + self.data = self.data .. table.concat(packets) +end + +function image:encode_data_R8G8B8_as_B8G8R8_raw() + assert(24 == self.pixel_depth) + local raw_pixels = {} + for _, row in ipairs(self.pixels) do + for _, pixel in ipairs(row) do + local raw_pixel = string.char(pixel[3], pixel[2], pixel[1]) + raw_pixels[#raw_pixels + 1] = raw_pixel + end + end + self.data = self.data .. table.concat(raw_pixels) +end + +function image:encode_data_R8G8B8_as_B8G8R8_rle() + assert(24 == self.pixel_depth) + local previous_r = nil + local previous_g = nil + local previous_b = nil + local raw_pixel = '' + local raw_pixels = {} + local count = 1 + local packets = {} + local raw_packet = '' + local rle_packet = '' + for _, row in ipairs(self.pixels) do + for _, pixel in ipairs(row) do + if pixel[1] ~= previous_r or pixel[2] ~= previous_g or pixel[3] ~= previous_b or count == 128 then + if nil ~= previous_r then + if 1 == count then + -- remember pixel verbatim for raw encoding + raw_pixel = string.char(previous_b, previous_g, previous_r) + raw_pixels[#raw_pixels + 1] = raw_pixel + if 128 == #raw_pixels then + raw_packet = string.char(#raw_pixels - 1) + packets[#packets + 1] = raw_packet + for i=1, #raw_pixels do + packets[#packets +1] = raw_pixels[i] + end + raw_pixels = {} + end + else + -- encode raw pixels, if any + if #raw_pixels > 0 then + raw_packet = string.char(#raw_pixels - 1) + packets[#packets + 1] = raw_packet + for i=1, #raw_pixels do + packets[#packets +1] = raw_pixels[i] + end + raw_pixels = {} + end + -- RLE encoding + rle_packet = string.char(128 + count - 1, previous_b, previous_g, previous_r) + packets[#packets +1] = rle_packet + end + end + count = 1 + previous_r = pixel[1] + previous_g = pixel[2] + previous_b = pixel[3] + else + count = count + 1 + end + end + end + if 1 == count then + raw_pixel = string.char(previous_b, previous_g, previous_r) + raw_pixels[#raw_pixels + 1] = raw_pixel + raw_packet = string.char(#raw_pixels - 1) + packets[#packets + 1] = raw_packet + for i=1, #raw_pixels do + packets[#packets +1] = raw_pixels[i] + end + raw_pixels = {} + else + -- encode raw pixels, if any + if #raw_pixels > 0 then + raw_packet = string.char(#raw_pixels - 1) + packets[#packets + 1] = raw_packet + for i=1, #raw_pixels do + packets[#packets +1] = raw_pixels[i] + end + raw_pixels = {} + end + -- RLE encoding + rle_packet = string.char(128 + count - 1, previous_b, previous_g, previous_r) + packets[#packets +1] = rle_packet + end + self.data = self.data .. table.concat(packets) +end + +function image:encode_data_R8G8B8A8_as_B8G8R8A8_raw() + assert(32 == self.pixel_depth) + local raw_pixels = {} + for _, row in ipairs(self.pixels) do + for _, pixel in ipairs(row) do + local raw_pixel = string.char(pixel[3], pixel[2], pixel[1], pixel[4]) + raw_pixels[#raw_pixels + 1] = raw_pixel + end + end + self.data = self.data .. table.concat(raw_pixels) +end + +function image:encode_data_R8G8B8A8_as_B8G8R8A8_rle() + assert(32 == self.pixel_depth) + local previous_r = nil + local previous_g = nil + local previous_b = nil + local previous_a = nil + local raw_pixel = '' + local raw_pixels = {} + local count = 1 + local packets = {} + local raw_packet = '' + local rle_packet = '' + for _, row in ipairs(self.pixels) do + for _, pixel in ipairs(row) do + if pixel[1] ~= previous_r or pixel[2] ~= previous_g or pixel[3] ~= previous_b or pixel[4] ~= previous_a or count == 128 then + if nil ~= previous_r then + if 1 == count then + -- remember pixel verbatim for raw encoding + raw_pixel = string.char(previous_b, previous_g, previous_r, previous_a) + raw_pixels[#raw_pixels + 1] = raw_pixel + if 128 == #raw_pixels then + raw_packet = string.char(#raw_pixels - 1) + packets[#packets + 1] = raw_packet + for i=1, #raw_pixels do + packets[#packets +1] = raw_pixels[i] + end + raw_pixels = {} + end + else + -- encode raw pixels, if any + if #raw_pixels > 0 then + raw_packet = string.char(#raw_pixels - 1) + packets[#packets + 1] = raw_packet + for i=1, #raw_pixels do + packets[#packets +1] = raw_pixels[i] + end + raw_pixels = {} + end + -- RLE encoding + rle_packet = string.char(128 + count - 1, previous_b, previous_g, previous_r, previous_a) + packets[#packets +1] = rle_packet + end + end + count = 1 + previous_r = pixel[1] + previous_g = pixel[2] + previous_b = pixel[3] + previous_a = pixel[4] + else + count = count + 1 + end + end + end + if 1 == count then + raw_pixel = string.char(previous_b, previous_g, previous_r, previous_a) + raw_pixels[#raw_pixels + 1] = raw_pixel + raw_packet = string.char(#raw_pixels - 1) + packets[#packets + 1] = raw_packet + for i=1, #raw_pixels do + packets[#packets +1] = raw_pixels[i] + end + raw_pixels = {} + else + -- encode raw pixels, if any + if #raw_pixels > 0 then + raw_packet = string.char(#raw_pixels - 1) + packets[#packets + 1] = raw_packet + for i=1, #raw_pixels do + packets[#packets +1] = raw_pixels[i] + end + raw_pixels = {} + end + -- RLE encoding + rle_packet = string.char(128 + count - 1, previous_b, previous_g, previous_r, previous_a) + packets[#packets +1] = rle_packet + end + self.data = self.data .. table.concat(packets) +end + +function image:encode_footer() + self.data = self.data + .. string.char(0, 0, 0, 0) -- extension area offset + .. string.char(0, 0, 0, 0) -- developer area offset + .. "TRUEVISION-XFILE" + .. "." + .. string.char(0) +end + +function image:encode(properties) + self.data = "" + self:encode_header(properties) -- header + -- no color map and image id data + self:encode_data(properties) -- encode data + -- no extension or developer area + self:encode_footer() -- footer +end + +function image:save(filename, properties) + local properties = properties or {} + properties.colormap = properties.colormap or {} + properties.compression = properties.compression or "RAW" + + self.pixel_depth = #self.pixels[1][1] * 8 + + local color_format_defaults_by_pixel_depth = { + [8] = "Y8", + [24] = "B8G8R8", + [32] = "B8G8R8A8", + } + if nil == properties.color_format then + if 0 ~= #properties.colormap then + properties.color_format = + color_format_defaults_by_pixel_depth[ + #properties.colormap[1] * 8 + ] + else + properties.color_format = + color_format_defaults_by_pixel_depth[ + self.pixel_depth + ] + end + end + assert( nil ~= properties.color_format ) + + self:encode(properties) + + local f = assert(io.open(filename, "wb")) + f:write(self.data) + f:close() +end + +tga_encoder.image = image diff --git a/mods/CORE/tga_encoder/mod.conf b/mods/CORE/tga_encoder/mod.conf new file mode 100644 index 000000000..d65aca884 --- /dev/null +++ b/mods/CORE/tga_encoder/mod.conf @@ -0,0 +1,2 @@ +name = tga_encoder +description = A TGA Encoder written in Lua without the use of external Libraries. diff --git a/mods/ENTITIES/extra_mobs/cod.lua b/mods/ENTITIES/extra_mobs/cod.lua index fd0a40621..9813d67e7 100644 --- a/mods/ENTITIES/extra_mobs/cod.lua +++ b/mods/ENTITIES/extra_mobs/cod.lua @@ -30,26 +30,26 @@ local S = minetest.get_translator("extra_mobs") --################### local cod = { - type = "animal", - spawn_class = "water", - can_despawn = true, - passive = true, - hp_min = 3, - hp_max = 3, - xp_min = 1, - xp_max = 3, - armor = 100, + type = "animal", + spawn_class = "water", + can_despawn = true, + passive = true, + hp_min = 3, + hp_max = 3, + xp_min = 1, + xp_max = 3, + armor = 100, rotate = 270, - tilt_swim = true, - collisionbox = {-0.3, 0.0, -0.3, 0.3, 0.79, 0.3}, - visual = "mesh", - mesh = "extra_mobs_cod.b3d", - textures = { - {"extra_mobs_cod.png"} - }, - sounds = { - }, - animation = { + tilt_swim = true, + collisionbox = {-0.3, 0.0, -0.3, 0.3, 0.79, 0.3}, + visual = "mesh", + mesh = "extra_mobs_cod.b3d", + textures = { + {"extra_mobs_cod.png"} + }, + sounds = { + }, + animation = { stand_start = 1, stand_end = 20, walk_start = 1, @@ -57,45 +57,52 @@ local cod = { run_start = 1, run_end = 20, }, - drops = { + drops = { {name = "mcl_fishing:fish_raw", chance = 1, min = 1, max = 1,}, - {name = "mcl_dye:white", + {name = "mcl_dye:white", chance = 20, min = 1, max = 1,}, }, - visual_size = {x=3, y=3}, - makes_footstep_sound = false, - swim = true, - breathes_in_water = true, - jump = false, - view_range = 16, - runaway = true, - fear_height = 4, - do_custom = function(self) - self.object:set_bone_position("body", vector.new(0,1,0), vector.new(degrees(dir_to_pitch(self.object:get_velocity())) * -1 + 90,0,0)) - if minetest.get_item_group(self.standing_in, "water") ~= 0 then - if self.object:get_velocity().y < 2.5 then - self.object:add_velocity({ x = 0 , y = math.random(-.002, .002) , z = 0 }) - end - end - for _,object in pairs(minetest.get_objects_inside_radius(self.object:get_pos(), 10)) do - local lp = object:get_pos() - local s = self.object:get_pos() - local vec = { - x = lp.x - s.x, - y = lp.y - s.y, - z = lp.z - s.z - } - if object and not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "extra_mobs:cod" then - self.state = "runaway" - self.object:set_rotation({x=0,y=(atan(vec.z / vec.x) + 3 * pi / 2) - self.rotate,z=0}) - end - end - end + visual_size = {x=3, y=3}, + makes_footstep_sound = false, + swim = true, + breathes_in_water = true, + jump = false, + view_range = 16, + runaway = true, + fear_height = 4, + do_custom = function(self) + self.object:set_bone_position("body", vector.new(0,1,0), vector.new(degrees(dir_to_pitch(self.object:get_velocity())) * -1 + 90,0,0)) + if minetest.get_item_group(self.standing_in, "water") ~= 0 then + if self.object:get_velocity().y < 2.5 then + self.object:add_velocity({ x = 0 , y = math.random(-.002, .002) , z = 0 }) + end + end + for _,object in pairs(minetest.get_objects_inside_radius(self.object:get_pos(), 10)) do + local lp = object:get_pos() + local s = self.object:get_pos() + local vec = { + x = lp.x - s.x, + y = lp.y - s.y, + z = lp.z - s.z + } + if object and not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "extra_mobs:cod" then + self.state = "runaway" + self.object:set_rotation({x=0,y=(atan(vec.z / vec.x) + 3 * pi / 2) - self.rotate,z=0}) + end + end + end, + on_rightclick = function(self, clicker) + if clicker:get_wielded_item():get_name() == "mcl_buckets:bucket_water" then + self.object:remove() + clicker:set_wielded_item("mcl_fishing:bucket_cod") + awards.unlock(clicker:get_player_name(), "mcl:tacticalFishing") + end + end } mobs:register_mob("extra_mobs:cod", cod) diff --git a/mods/ENTITIES/extra_mobs/fox.lua b/mods/ENTITIES/extra_mobs/fox.lua index 10f9ca898..f153127f0 100644 --- a/mods/ENTITIES/extra_mobs/fox.lua +++ b/mods/ENTITIES/extra_mobs/fox.lua @@ -21,9 +21,11 @@ local S = minetest.get_translator("extra_mobs") local followitem = "mcl_farming:sweet_berry" local fox = { - type = "monster", + type = "animal", passive = false, spawn_class = "hostile", + skittish = true, + runaway = true, hp_min = 10, hp_max = 10, xp_min = 1, @@ -32,9 +34,20 @@ local fox = { attack_type = "dogfight", damage = 2, reach = 1.5, + jump = true, + makes_footstep_sound = true, + walk_velocity = 3, + run_velocity = 6, + follow_velocity = 2, + follow = followitem, + pathfinding = 1, + fear_height = 4, + view_range = 16, collisionbox = {-0.3, -0.01, -0.3, 0.3, 0.84, 0.3}, + specific_attack = { "mobs_mc:chicken", "extra_mobs:cod", "extra_mobs:salmon" }, visual = "mesh", mesh = "extra_mobs_fox.b3d", + rotate = 270, textures = { { "extra_mobs_fox.png", "extra_mobs_trans.png", @@ -42,10 +55,6 @@ local fox = { visual_size = {x=3, y=3}, sounds = { }, - jump = true, - makes_footstep_sound = true, - walk_velocity = 3, - run_velocity = 6, drops = { }, animation = { @@ -63,9 +72,9 @@ local fox = { lay_start = 34, lay_end = 34, }, - runaway = true, on_spawn = function(self) - if minetest.find_node_near(self.object:get_pos(), 4, "mcl_core:snow") ~= nil or minetest.find_node_near(self.object:get_pos(), 4, "mcl_core:dirt_with_grass_snow") ~= nil then + if minetest.find_node_near(self.object:get_pos(), 4, "mcl_core:snow") ~= nil + or minetest.find_node_near(self.object:get_pos(), 4, "mcl_core:dirt_with_grass_snow") ~= nil then self.object:set_properties({textures={"extra_mobs_artic_fox.png", "extra_mobs_trans.png"}}) end end, @@ -83,7 +92,11 @@ local fox = { end) end for _,object in pairs(minetest.get_objects_inside_radius(self.object:get_pos(), 8)) do - if object and not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "extra_mobs:fox" and self.state ~= "attack" and math.random(1, 500) == 1 then + if object + and not object:is_player() + and object:get_luaentity() + and object:get_luaentity().name == "extra_mobs:fox" + and self.state ~= "attack" and math.random(1, 500) == 1 then self.horny = true end local lp = object:get_pos() @@ -93,15 +106,30 @@ local fox = { y = lp.y - s.y, z = lp.z - s.z } - if object and object:is_player() and not object:get_player_control().sneak or not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "mobs_mc:wolf" then - self.state = "runaway" - self.object:set_rotation({x=0,y=(atan(vec.z / vec.x) + 3 * pi / 2) - self.rotate,z=0}) - if self.reach > vector.distance(self.object:get_pos(), object:get_pos()) and self.timer > .9 then - self.timer = 0 - object:punch(self.object, 1.0, { - full_punch_interval = 1.0, - damage_groups = {fleshy = self.damage} - }, nil) + -- scare logic + if (object + and object:is_player() + and not object:get_player_control().sneak) + or (not object:is_player() + and object:get_luaentity() + and object:get_luaentity().name == "mobs_mc:wolf") then + -- don't keep setting it once it's set + if not self.state == "runaway" then + self.state = "runaway" + self.object:set_rotation({x=0,y=(atan(vec.z / vec.x) + 3 * pi / 2) - self.rotate,z=0}) + end + -- if it is within a distance of the player or wolf + if 6 > vector.distance(self.object:get_pos(), object:get_pos()) then + self.timer = self.timer + 1 + -- have some time before getting scared + if self.timer > 6 then + self.timer = 0 + -- punch the fox for the player, but don't do any damage + self.object:punch(object, 0, { + full_punch_interval = 0, + damage_groups = {fleshy = 0} + }, nil) + end end end end @@ -109,10 +137,6 @@ local fox = { do_punch = function(self) self.state = "runaway" end, - follow = followitem, - fear_height = 4, - view_range = 16, - specific_attack = { "mobs_mc:chicken", "extra_mobs:cod", "extra_mobs:salmon" }, } mobs:register_mob("extra_mobs:fox", fox) @@ -146,21 +170,21 @@ mobs:spawn_setup({ --mobs:spawn_specific("extra_mobs:fox", "overworld", "ground", 0, minetest.LIGHT_MAX+1, 30, 6000, 3, 0, 500) --[[ mobs:spawn_specific( -"extra_mobs:artic_fox", -"overworld", -"ground", +"extra_mobs:artic_fox", +"overworld", +"ground", { "ColdTaiga", "IcePlainsSpikes", "IcePlains", "ExtremeHills+_snowtop", }, -0, -minetest.LIGHT_MAX+1, -30, -6000, -3, -mobs_mc.spawn_height.water, +0, +minetest.LIGHT_MAX+1, +30, +6000, +3, +mobs_mc.spawn_height.water, mobs_mc.spawn_height.overworld_max) ]]-- -- spawn eggs diff --git a/mods/ENTITIES/extra_mobs/glow_squid.lua b/mods/ENTITIES/extra_mobs/glow_squid.lua index 2169e1ddb..41c530e63 100644 --- a/mods/ENTITIES/extra_mobs/glow_squid.lua +++ b/mods/ENTITIES/extra_mobs/glow_squid.lua @@ -231,3 +231,13 @@ water) -- spawn egg mobs:register_egg("extra_mobs:glow_squid", S("Glow Squid"), "extra_mobs_spawn_icon_glow_squid.png", 0) + +-- dropped item (used to craft glowing itemframe) + +minetest.register_craftitem("extra_mobs:glow_ink_sac", { + description = S("Glow Ink Sac"), + _doc_items_longdesc = S("Use it to craft the Glow Item Frame."), + _doc_items_usagehelp = S("Use the Glow Ink Sac and the normal Item Frame to craft the Glow Item Frame."), + inventory_image = "extra_mobs_glow_ink_sac.png", + groups = { craftitem = 1 }, +}) diff --git a/mods/ENTITIES/extra_mobs/glow_squid_items.lua b/mods/ENTITIES/extra_mobs/glow_squid_items.lua deleted file mode 100644 index c7f30662b..000000000 --- a/mods/ENTITIES/extra_mobs/glow_squid_items.lua +++ /dev/null @@ -1,330 +0,0 @@ -local S = minetest.get_translator("extra_mobs") - -minetest.register_craftitem("extra_mobs:glow_ink_sac", { - description = S("Glow Ink Sac"), - _doc_items_longdesc = S("Use it to craft the Glow Item Frame."), - _doc_items_usagehelp = S("Use the Glow Ink Sac and the normal Item Frame to craft the Glow Item Frame."), - inventory_image = "extra_mobs_glow_ink_sac.png", - groups = { craftitem = 1 }, -}) - - --------------------- - ---[[This mod is originally by Zeg9, but heavily modified for MineClone 2. - -Model created by 22i, licensed under the -GNU GPLv3 . - -Source: -]] - - -local VISUAL_SIZE = 0.3 - -minetest.register_entity("extra_mobs:glow_item_frame_item",{ - hp_max = 1, - visual = "wielditem", - visual_size = {x=VISUAL_SIZE, y=VISUAL_SIZE}, - physical = false, - pointable = false, - textures = { "blank.png" }, - _texture = "blank.png", - _scale = 1, - glow = minetest.LIGHT_MAX, - - on_activate = function(self, staticdata) - if staticdata ~= nil and staticdata ~= "" then - local data = staticdata:split(';') - if data and data[1] and data[2] then - self._nodename = data[1] - self._texture = data[2] - if data[3] then - self._scale = data[3] - else - self._scale = 1 - end - end - end - if self._texture ~= nil then - self.object:set_properties({ - textures={self._texture}, - visual_size={x=VISUAL_SIZE/self._scale, y=VISUAL_SIZE/self._scale}, - }) - end - end, - get_staticdata = function(self) - if not self then return end - if self._nodename ~= nil and self._texture ~= nil then - local ret = self._nodename .. ';' .. self._texture - if self._scale ~= nil then - ret = ret .. ';' .. tostring(self._scale) - end - return ret - end - return "" - end, - - _update_texture = function(self) - if self._texture ~= nil then - self.object:set_properties({ - textures={self._texture}, - visual_size={x=VISUAL_SIZE/self._scale, y=VISUAL_SIZE/self._scale}, - }) - end - end, -}) - - -local facedir = {} -facedir[0] = {x=0,y=0,z=1} -facedir[1] = {x=1,y=0,z=0} -facedir[2] = {x=0,y=0,z=-1} -facedir[3] = {x=-1,y=0,z=0} - -local remove_item_entity = function(pos, node) - local objs = nil - if node.name == "extra_mobs:glow_item_frame" then - objs = minetest.get_objects_inside_radius(pos, .5) - end - if objs then - for _, obj in ipairs(objs) do - if obj and obj:get_luaentity() and obj:get_luaentity().name == "extra_mobs:glow_item_frame_item" then - obj:remove() - end - end - end -end - -local update_item_entity = function(pos, node, param2) - remove_item_entity(pos, node) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - local item = inv:get_stack("main", 1) - if not item:is_empty() then - if not param2 then - param2 = node.param2 - end - if node.name == "extra_mobs:glow_item_frame" then - local posad = facedir[param2] - pos.x = pos.x + posad.x*6.5/16 - pos.y = pos.y + posad.y*6.5/16 - pos.z = pos.z + posad.z*6.5/16 - end - local e = minetest.add_entity(pos, "extra_mobs:glow_item_frame_item") - local lua = e:get_luaentity() - lua._nodename = node.name - local itemname = item:get_name() - if itemname == "" or itemname == nil then - lua._texture = "blank.png" - lua._scale = 1 - else - lua._texture = itemname - local def = minetest.registered_items[itemname] - if def and def.wield_scale then - lua._scale = def.wield_scale.x - else - lua._scale = 1 - end - end - lua:_update_texture() - if node.name == "extra_mobs:glow_item_frame" then - local yaw = math.pi*2 - param2 * math.pi/2 - e:set_yaw(yaw) - end - end -end - -local drop_item = function(pos, node, meta, clicker) - local cname = "" - if clicker and clicker:is_player() then - cname = clicker:get_player_name() - end - if node.name == "extra_mobs:glow_item_frame" and not minetest.is_creative_enabled(cname) then - local inv = meta:get_inventory() - local item = inv:get_stack("main", 1) - if not item:is_empty() then - minetest.add_item(pos, item) - end - end - meta:set_string("infotext", "") - remove_item_entity(pos, node) -end - -minetest.register_node("extra_mobs:glow_item_frame",{ - description = S("Glow Item Frame"), - _tt_help = S("Can hold an item and glows"), - _doc_items_longdesc = S("Glow Item frames are decorative blocks in which items can be placed."), - _doc_items_usagehelp = S("Just place any item on the item frame. Use the item frame again to retrieve the item."), - drawtype = "mesh", - is_ground_content = false, - mesh = "extra_mobs_glow_item_frame.obj", - selection_box = { type = "fixed", fixed = {-6/16, -6/16, 7/16, 6/16, 6/16, 0.5} }, - collision_box = { type = "fixed", fixed = {-6/16, -6/16, 7/16, 6/16, 6/16, 0.5} }, - tiles = {"extra_mobs_glow_item_frame_border.png", "extra_mobs_glow_item_frame_border.png", "extra_mobs_glow_item_frame_border.png", "extra_mobs_glow_item_frame_border.png", "extra_mobs_glow_item_frame_border.png", "extra_mobs_glow_item_frame_border.png"}, - inventory_image = "extra_mobs_glow_item_frame_item.png", - wield_image = "extra_mobs_glow_item_frame.png", - paramtype = "light", - paramtype2 = "facedir", - - --FIXME: should only be glowing, no light source. How is that possible with a node? - light_source = 1, - - sunlight_propagates = true, - groups = { dig_immediate=3,deco_block=1,dig_by_piston=1,container=7,attached_node_facedir=1 }, - sounds = mcl_sounds.node_sound_defaults(), - node_placement_prediction = "", - on_place = function(itemstack, placer, pointed_thing) - if pointed_thing.type ~= "node" then - return itemstack - end - - -- Use pointed node's on_rightclick function first, if present - local node = minetest.get_node(pointed_thing.under) - if placer and not placer:get_player_control().sneak then - if minetest.registered_nodes[node.name] and minetest.registered_nodes[node.name].on_rightclick then - return minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, placer, itemstack) or itemstack - end - end - - return minetest.item_place(itemstack, placer, pointed_thing, minetest.dir_to_facedir(vector.direction(pointed_thing.above, pointed_thing.under))) - end, - on_construct = function(pos) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - inv:set_size("main", 1) - end, - on_rightclick = function(pos, node, clicker, itemstack) - if not itemstack then - return - end - local pname = clicker:get_player_name() - if minetest.is_protected(pos, pname) then - minetest.record_protection_violation(pos, pname) - return - end - local meta = minetest.get_meta(pos) - drop_item(pos, node, meta, clicker) - local inv = meta:get_inventory() - if itemstack:is_empty() then - remove_item_entity(pos, node) - meta:set_string("infotext", "") - inv:set_stack("main", 1, "") - return itemstack - end - local put_itemstack = ItemStack(itemstack) - put_itemstack:set_count(1) - inv:set_stack("main", 1, put_itemstack) - update_item_entity(pos, node) - -- Add node infotext when item has been named - local imeta = itemstack:get_meta() - local iname = imeta:get_string("name") - if iname then - meta:set_string("infotext", iname) - end - - if not minetest.is_creative_enabled(clicker:get_player_name()) then - itemstack:take_item() - end - return itemstack - end, - allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) - local name = player:get_player_name() - if minetest.is_protected(pos, name) then - minetest.record_protection_violation(pos, name) - return 0 - else - return count - end - end, - allow_metadata_inventory_take = function(pos, listname, index, stack, player) - local name = player:get_player_name() - if minetest.is_protected(pos, name) then - minetest.record_protection_violation(pos, name) - return 0 - else - return stack:get_count() - end - end, - allow_metadata_inventory_put = function(pos, listname, index, stack, player) - local name = player:get_player_name() - if minetest.is_protected(pos, name) then - minetest.record_protection_violation(pos, name) - return 0 - else - return stack:get_count() - end - end, - on_destruct = function(pos) - local meta = minetest.get_meta(pos) - local node = minetest.get_node(pos) - drop_item(pos, node, meta) - end, - on_rotate = function(pos, node, user, mode, param2) - if mode == screwdriver.ROTATE_FACE then - -- Rotate face - local meta = minetest.get_meta(pos) - local node = minetest.get_node(pos) - - local objs = nil - if node.name == "extra_mobs:glow_item_frame" then - objs = minetest.get_objects_inside_radius(pos, .5) - end - if objs then - for _, obj in ipairs(objs) do - if obj and obj:get_luaentity() and obj:get_luaentity().name == "extra_mobs:glow_item_frame_item" then - update_item_entity(pos, node, (node.param2+1) % 4) - break - end - end - end - return - elseif mode == screwdriver.ROTATE_AXIS then - return false - end - end, - -}) - -minetest.register_craft({ - type = "shapeless", - output = 'extra_mobs:glow_item_frame', - recipe = {'mcl_itemframes:item_frame', 'extra_mobs:glow_ink_sac'}, -}) - -minetest.register_lbm({ - label = "Update legacy item frames", - name = "extra_mobs:update_legacy_glow_item_frames", - nodenames = {"extra_mobs:glow_frame"}, - action = function(pos, node) - -- Swap legacy node, then respawn entity - node.name = "extra_mobs:glow_item_frame" - local meta = minetest.get_meta(pos) - local item = meta:get_string("item") - minetest.swap_node(pos, node) - if item ~= "" then - local itemstack = ItemStack(minetest.deserialize(meta:get_string("itemdata"))) - local inv = meta:get_inventory() - inv:set_size("main", 1) - if not itemstack:is_empty() then - inv:set_stack("main", 1, itemstack) - end - end - update_item_entity(pos, node) - end, -}) - --- FIXME: Item entities can get destroyed by /clearobjects -minetest.register_lbm({ - label = "Respawn item frame item entities", - name = "extra_mobs:respawn_entities", - nodenames = {"extra_mobs:glow_item_frame"}, - run_at_every_load = true, - action = function(pos, node) - update_item_entity(pos, node) - end, -}) - -minetest.register_alias("extra_mobs:glow_frame", "extra_mobs:glow_item_frame") - --------------------- \ No newline at end of file diff --git a/mods/ENTITIES/extra_mobs/init.lua b/mods/ENTITIES/extra_mobs/init.lua index 28fab0eeb..af35e1c3f 100644 --- a/mods/ENTITIES/extra_mobs/init.lua +++ b/mods/ENTITIES/extra_mobs/init.lua @@ -21,8 +21,3 @@ dofile(path .. "/cod.lua") dofile(path .. "/salmon.lua") dofile(path .. "/dolphin.lua") dofile(path .. "/glow_squid.lua") - ---Items -dofile(path .. "/glow_squid_items.lua") - - diff --git a/mods/ENTITIES/extra_mobs/locale/extra_mobs.fr.tr b/mods/ENTITIES/extra_mobs/locale/extra_mobs.fr.tr new file mode 100644 index 000000000..2948935c6 --- /dev/null +++ b/mods/ENTITIES/extra_mobs/locale/extra_mobs.fr.tr @@ -0,0 +1,11 @@ +# textdomain:extra_mobs +Hoglin=Hoglin +Piglin=Piglin +Piglin Brute=Piglin Barbare +Strider=Arpenteur +Fox=Renard +Cod=Poisson +Salmon=Saumon +Dolphin=Dauphin +Glow Squid=Pieuvre Lumineuse +Glow Ink Sac=Sac d'Encre Lumineuse \ No newline at end of file diff --git a/mods/ENTITIES/extra_mobs/locale/extra_mobs.ru.tr b/mods/ENTITIES/extra_mobs/locale/extra_mobs.ru.tr index 6ebba543e..c4c81f1bb 100644 --- a/mods/ENTITIES/extra_mobs/locale/extra_mobs.ru.tr +++ b/mods/ENTITIES/extra_mobs/locale/extra_mobs.ru.tr @@ -8,10 +8,4 @@ Cod=Треска Salmon=Лосось dolphin=Дельфин Glow Squid=Светящийся спрут -Glow Ink Sac=Светящийся чернильный мешок -Use it to craft the Glow Item Frame.=Используется для крафта светящейся рамки. -Use the Glow Ink Sac and the normal Item Frame to craft the Glow Item Frame.=Используйте светящийся чернильный мешок и обычную рамку для крафта светящейся рамки. -Glow Item Frame=Светящаяся рамка -Can hold an item and glows=Светится и может хранить предмет -Glow Item frames are decorative blocks in which items can be placed.=Светящаяся рамка это декоративный блок в который можно положить предметы. -Just place any item on the item frame. Use the item frame again to retrieve the item.=Просто используйте любой предмет на рамке. Используйте рамку снова, чтобы забрать предмет. \ No newline at end of file +Glow Ink Sac=Светящийся чернильный мешок \ No newline at end of file diff --git a/mods/ENTITIES/extra_mobs/locale/template.txt b/mods/ENTITIES/extra_mobs/locale/template.txt index 1eaf2a4ed..d1ede95ee 100644 --- a/mods/ENTITIES/extra_mobs/locale/template.txt +++ b/mods/ENTITIES/extra_mobs/locale/template.txt @@ -1,17 +1,11 @@ # textdomain:extra_mobs Hoglin= -piglin= -piglin Brute= +Piglin= +Piglin Brute= Strider= Fox= Cod= Salmon= -dolphin= +Dolphin= Glow Squid= -Glow Ink Sac= -Use it to craft the Glow Item Frame.= -Use the Glow Ink Sac and the normal Item Frame to craft the Glow Item Frame.= -Glow Item Frame= -Can hold an item and glows= -Glow Item frames are decorative blocks in which items can be placed.= -Just place any item on the item frame. Use the item frame again to retrieve the item.= \ No newline at end of file +Glow Ink Sac= \ No newline at end of file diff --git a/mods/ENTITIES/extra_mobs/salmon.lua b/mods/ENTITIES/extra_mobs/salmon.lua index ba3503b60..7ef9a8d36 100644 --- a/mods/ENTITIES/extra_mobs/salmon.lua +++ b/mods/ENTITIES/extra_mobs/salmon.lua @@ -10,26 +10,26 @@ local S = minetest.get_translator("extra_mobs") --################### local salmon = { - type = "animal", - spawn_class = "water", - can_despawn = true, - passive = true, - hp_min = 3, - hp_max = 3, - xp_min = 1, - xp_max = 3, - armor = 100, - rotate = 270, - tilt_swim = true, - collisionbox = {-0.4, 0.0, -0.4, 0.4, 0.79, 0.4}, - visual = "mesh", - mesh = "extra_mobs_salmon.b3d", - textures = { - {"extra_mobs_salmon.png"} - }, - sounds = { - }, - animation = { + type = "animal", + spawn_class = "water", + can_despawn = true, + passive = true, + hp_min = 3, + hp_max = 3, + xp_min = 1, + xp_max = 3, + armor = 100, + rotate = 270, + tilt_swim = true, + collisionbox = {-0.4, 0.0, -0.4, 0.4, 0.79, 0.4}, + visual = "mesh", + mesh = "extra_mobs_salmon.b3d", + textures = { + {"extra_mobs_salmon.png"} + }, + sounds = { + }, + animation = { stand_start = 1, stand_end = 20, walk_start = 1, @@ -37,24 +37,31 @@ local salmon = { run_start = 1, run_end = 20, }, - drops = { + drops = { {name = "mcl_fishing:salmon_raw", chance = 1, min = 1, max = 1,}, - {name = "mcl_dye:white", + {name = "mcl_dye:white", chance = 20, min = 1, max = 1,}, }, - visual_size = {x=3, y=3}, - makes_footstep_sound = false, - swim = true, - breathes_in_water = true, - jump = false, - view_range = 16, - runaway = true, - fear_height = 4, + visual_size = {x=3, y=3}, + makes_footstep_sound = false, + swim = true, + breathes_in_water = true, + jump = false, + view_range = 16, + runaway = true, + fear_height = 4, + on_rightclick = function(self, clicker) + if clicker:get_wielded_item():get_name() == "mcl_buckets:bucket_water" then + self.object:remove() + clicker:set_wielded_item("mcl_fishing:bucket_salmon") + awards.unlock(clicker:get_player_name(), "mcl:tacticalFishing") + end + end } mobs:register_mob("extra_mobs:salmon", salmon) diff --git a/mods/ENTITIES/extra_mobs/textures/cod_bucket.png b/mods/ENTITIES/extra_mobs/textures/cod_bucket1.png similarity index 100% rename from mods/ENTITIES/extra_mobs/textures/cod_bucket.png rename to mods/ENTITIES/extra_mobs/textures/cod_bucket1.png diff --git a/mods/ENTITIES/mcl_boats/init.lua b/mods/ENTITIES/mcl_boats/init.lua index 3a26c1b36..c848a858e 100644 --- a/mods/ENTITIES/mcl_boats/init.lua +++ b/mods/ENTITIES/mcl_boats/init.lua @@ -166,11 +166,13 @@ function boat.on_activate(self, staticdata, dtime_s) self._last_v = self._v self._itemstring = data.itemstring - while #data.textures < 5 do - table.insert(data.textures, data.textures[1]) - end + if data.textures then + while #data.textures < 5 do + table.insert(data.textures, data.textures[1]) + end - self.object:set_properties({textures = data.textures}) + self.object:set_properties({textures = data.textures}) + end end end diff --git a/mods/ENTITIES/mcl_boats/locale/mcl_boats.fr.tr b/mods/ENTITIES/mcl_boats/locale/mcl_boats.fr.tr index 91be07c32..922f5f069 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 +Obsidian Boat=Bateau en Obsidienne 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 diff --git a/mods/ENTITIES/mcl_boats/locale/mcl_boats.oc.tr b/mods/ENTITIES/mcl_boats/locale/mcl_boats.oc.tr new file mode 100644 index 000000000..ef27e1006 --- /dev/null +++ b/mods/ENTITIES/mcl_boats/locale/mcl_boats.oc.tr @@ -0,0 +1,13 @@ +# textdomain: mcl_boats +Acacia Boat=Barca de Cacièr +Birch Boat=Barca de Bèç +Boat=Barca +Boats are used to travel on the surface of water.= Las Barcas permetàn de vogar per l'aiga. +Dark Oak Boat=Barca de Jàrric +Jungle Boat=Barca de Jungla +Oak Boat=Barca de Ròure +Obsidian Boat=Barca d'Obsidiana +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.=Fasetz un clic dreit sobre una sorça d'aiga per botar la barca. Fasetz un clic dreit sobre la barca per ne'n dintrar. Utilisatz [Esquèrra] e [Dreita] per menar, [Davant] per accelerar, e [Darrèir] per alentir o recular. Utilizatz [S'acatar] per o quitar, picatz la barca per o faire tombar en objèct. +Spruce Boat=Barca de Sap +Water vehicle=Veïcule d'Aiga +Sneak to dismount=S'acatar per descendre \ No newline at end of file diff --git a/mods/ENTITIES/mcl_falling_nodes/locale/mcl_falling_nodes.oc.tr b/mods/ENTITIES/mcl_falling_nodes/locale/mcl_falling_nodes.oc.tr new file mode 100644 index 000000000..2fc9e42a3 --- /dev/null +++ b/mods/ENTITIES/mcl_falling_nodes/locale/mcl_falling_nodes.oc.tr @@ -0,0 +1,3 @@ +# textdomain: mcl_falling_nodes +@1 was smashed by a falling anvil.=@1 fuguèt espotit per una enclutge. +@1 was smashed by a falling block.=@1 fuguèt espotit per un blòc. \ No newline at end of file diff --git a/mods/ENTITIES/mcl_item_entity/init.lua b/mods/ENTITIES/mcl_item_entity/init.lua index e88f4dd80..099942be1 100644 --- a/mods/ENTITIES/mcl_item_entity/init.lua +++ b/mods/ENTITIES/mcl_item_entity/init.lua @@ -65,6 +65,8 @@ mcl_item_entity.register_pickup_achievement("tree", "mcl:mineWood") mcl_item_entity.register_pickup_achievement("mcl_mobitems:blaze_rod", "mcl:blazeRod") mcl_item_entity.register_pickup_achievement("mcl_mobitems:leather", "mcl:killCow") mcl_item_entity.register_pickup_achievement("mcl_core:diamond", "mcl:diamonds") +mcl_item_entity.register_pickup_achievement("mcl_core:crying_obsidian", "mcl:whosCuttingOnions") +mcl_item_entity.register_pickup_achievement("mcl_nether:ancient_debris", "mcl:hiddenInTheDepths") local function check_pickup_achievements(object, player) if has_awards then @@ -154,6 +156,10 @@ minetest.register_globalstep(function(dtime) object:set_velocity({x=0,y=0,z=0}) object:set_acceleration({x=0,y=0,z=0}) + if object._flowing then + object._flowing = false + end + object:move_to(checkpos) pool[name] = pool[name] + 1 @@ -793,6 +799,9 @@ minetest.register_entity(":__builtin:item", { local oldvel = self.object:get_velocity() -- v is vector, vel is velocity + -- apply gravity *before* drag computations + oldvel.y = oldvel.y - get_gravity() * dtime + -- drag local fluid_drag = item_drop_settings.fluid_drag @@ -806,12 +815,6 @@ minetest.register_entity(":__builtin:item", { newv.x = newv.x - (oldvel.x - newv.x) * fluid_drag * dtime newv.y = newv.y - (oldvel.y - newv.y) * fluid_drag * dtime newv.z = newv.z - (oldvel.z - newv.z) * fluid_drag * dtime - - newv.y = newv.y + -0.22 -- (keep slight downward thrust from previous version of code) - -- NOTE: is there any particular reason we have this, anyway? - -- since fluid drag is now on, we could as well just - -- apply gravity here; drag will slow down the fall - -- realistically self.object:set_velocity({x = oldvel.x + newv.x * dtime, y = oldvel.y + newv.y * dtime, z = oldvel.z + newv.z * dtime}) diff --git a/mods/ENTITIES/mcl_mobs/api.txt b/mods/ENTITIES/mcl_mobs/api.txt index 2d8cef5b0..6c61855aa 100644 --- a/mods/ENTITIES/mcl_mobs/api.txt +++ b/mods/ENTITIES/mcl_mobs/api.txt @@ -227,6 +227,11 @@ functions needed for the mob to work properly which contains the following: older mobs. 'pushable' Allows players, & other mobs to push the mob. + 'spawn_with_armor' If set to true, the mob has a small chance of spawning with + random matched armor. If set to a string, the string represents + the material type of the armor. Any materials used by + mcl_armor will work. Example: "gold" + It is assumed that the first texture is for armor. MineClone 2 extensions: diff --git a/mods/ENTITIES/mcl_mobs/api/api.lua b/mods/ENTITIES/mcl_mobs/api/api.lua index c72dca0bd..de21cf948 100644 --- a/mods/ENTITIES/mcl_mobs/api/api.lua +++ b/mods/ENTITIES/mcl_mobs/api/api.lua @@ -375,6 +375,7 @@ function mobs:register_mob(name, def) --moves the wrong way swap_y_with_x = def.swap_y_with_x or false, reverse_head_yaw = def.reverse_head_yaw or false, + _spawn_with_armor = def.spawn_with_armor, --END HEAD CODE VARIABLES @@ -401,6 +402,7 @@ function mobs:register_mob(name, def) ignited_by_sunlight = def.ignited_by_sunlight or false, eye_height = def.eye_height or 1.5, defuse_reach = def.defuse_reach or 4, + spawn = def.spawn, -- End of MCL2 extensions on_spawn = def.on_spawn, @@ -415,7 +417,7 @@ function mobs:register_mob(name, def) --on_breed = def.on_breed, - --on_grown = def.on_grown, + on_grown = def.on_grown, --on_detach_child = mob_detach_child, diff --git a/mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua b/mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua index ab91a0542..2532fdb55 100644 --- a/mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua +++ b/mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua @@ -88,7 +88,7 @@ local function land_state_switch(self, dtime) end --ignore everything else if following - if mobs.check_following(self) and + if mobs.check_following(self, dtime) and (not self.breed_lookout_timer or (self.breed_lookout_timer and self.breed_lookout_timer == 0)) and (not self.breed_timer or (self.breed_timer and self.breed_timer == 0)) then self.state = "follow" @@ -984,7 +984,7 @@ function mobs.mob_step(self, dtime) --go get the closest player if attacking then - + mobs.do_head_logic(self, dtime, attacking) self.memory = 6 --6 seconds of memory --set initial punch timer @@ -1040,6 +1040,7 @@ function mobs.mob_step(self, dtime) --don't break eye contact if self.hostile and self.attacking then mobs.set_yaw_while_attacking(self) + mobs.do_head_logic(self, dtime, self.attacking) end --perfectly reset pause_timer diff --git a/mods/ENTITIES/mcl_mobs/api/mob_functions/attack_type_instructions.lua b/mods/ENTITIES/mcl_mobs/api/mob_functions/attack_type_instructions.lua index ac10194e5..736e2429e 100644 --- a/mods/ENTITIES/mcl_mobs/api/mob_functions/attack_type_instructions.lua +++ b/mods/ENTITIES/mcl_mobs/api/mob_functions/attack_type_instructions.lua @@ -26,6 +26,8 @@ local math_random = math.random |_| ]]-- +local minetest_line_of_sight = minetest.line_of_sight + mobs.explode_attack_walk = function(self,dtime) --this needs an exception @@ -36,17 +38,27 @@ mobs.explode_attack_walk = function(self,dtime) mobs.set_yaw_while_attacking(self) - local distance_from_attacking = vector_distance(self.object:get_pos(), self.attacking:get_pos()) + local pos = self.object:get_pos() + local attack_pos = self.attacking:get_pos() + local distance_from_attacking = vector_distance(pos, attack_pos) --make mob walk up to player within 2 nodes distance then start exploding - if distance_from_attacking >= self.reach and - --don't allow explosion to cancel unless out of the reach boundary - not (self.explosion_animation and self.explosion_animation > 0 and distance_from_attacking <= self.defuse_reach) then + if ( + distance_from_attacking >= self.reach and + --don't allow explosion to cancel unless out of the reach boundary + not (self.explosion_animation and self.explosion_animation > 0 and distance_from_attacking <= self.defuse_reach) or + --don't allow creeper to finish exploding animation if can't see target + not minetest_line_of_sight( + {x = pos.x, y = pos.y + self.eye_height, z = pos.z}, + {x = attack_pos.x, y = attack_pos.y + (self.attacking.eye_height or 0), z = attack_pos.z} + ) + ) then mobs.set_velocity(self, self.run_velocity) mobs.set_mob_animation(self,"run") mobs.reverse_explosion_animation(self,dtime) + else mobs.set_velocity(self,0) @@ -344,4 +356,4 @@ mobs.projectile_attack_fly = function(self, dtime) mobs.shoot_projectile(self) end end -end \ No newline at end of file +end diff --git a/mods/ENTITIES/mcl_mobs/api/mob_functions/breeding.lua b/mods/ENTITIES/mcl_mobs/api/mob_functions/breeding.lua index c50fb6300..e911a816b 100644 --- a/mods/ENTITIES/mcl_mobs/api/mob_functions/breeding.lua +++ b/mods/ENTITIES/mcl_mobs/api/mob_functions/breeding.lua @@ -3,7 +3,7 @@ local minetest_get_objects_inside_radius = minetest.get_objects_inside_radius local vector = vector --check to see if someone nearby has some tasty food -mobs.check_following = function(self) -- returns true or false +mobs.check_following = function(self, dtime) -- returns true or false --ignore if not self.follow then self.following_person = nil @@ -15,6 +15,7 @@ mobs.check_following = function(self) -- returns true or false --check if the follower is a player incase they log out if follower and follower:is_player() then + mobs.do_head_logic(self, dtime, follower) local stack = follower:get_wielded_item() --safety check if not stack then @@ -145,11 +146,12 @@ end --make the baby grow up mobs.baby_grow_up = function(self) - self.baby = nil - self.visual_size = self.backup_visual_size - self.collisionbox = self.backup_collisionbox - self.selectionbox = self.backup_selectionbox - self.object:set_properties(self) + self.baby = nil + self.visual_size = self.backup_visual_size + self.collisionbox = self.backup_collisionbox + self.selectionbox = self.backup_selectionbox + self.object:set_properties(self) + if self.on_grown then self.on_grown(self) end end --makes the baby grow up faster with diminishing returns diff --git a/mods/ENTITIES/mcl_mobs/api/mob_functions/head_logic.lua b/mods/ENTITIES/mcl_mobs/api/mob_functions/head_logic.lua index 0f5615504..a2e264cd9 100644 --- a/mods/ENTITIES/mcl_mobs/api/mob_functions/head_logic.lua +++ b/mods/ENTITIES/mcl_mobs/api/mob_functions/head_logic.lua @@ -6,9 +6,9 @@ local degrees = function(yaw) return yaw*180.0/math.pi end -mobs.do_head_logic = function(self,dtime) +mobs.do_head_logic = function(self, dtime, player) - local player = minetest.get_player_by_name("singleplayer") + local player = player or minetest.get_player_by_name("singleplayer") local look_at = player:get_pos() look_at.y = look_at.y + player:get_properties().eye_height @@ -89,10 +89,21 @@ mobs.do_head_logic = function(self,dtime) head_pitch = head_pitch + self.head_pitch_modifier end - if self.swap_y_with_x then - self.object:set_bone_position(self.head_bone, bone_pos, vector.new(degrees(head_pitch),degrees(head_yaw),0)) + local head_bone = self.head_bone + if (type(head_bone) == "table") then + for _, v in pairs(head_bone) do + if self.swap_y_with_x then + self.object:set_bone_position(v, bone_pos, vector.new(degrees(head_pitch),degrees(head_yaw),0)) + else + self.object:set_bone_position(v, bone_pos, vector.new(degrees(head_pitch),0,degrees(head_yaw))) + end + end else - self.object:set_bone_position(self.head_bone, bone_pos, vector.new(degrees(head_pitch),0,degrees(head_yaw))) + if self.swap_y_with_x then + self.object:set_bone_position(head_bone, bone_pos, vector.new(degrees(head_pitch),degrees(head_yaw),0)) + else + self.object:set_bone_position(head_bone, bone_pos, vector.new(degrees(head_pitch),0,degrees(head_yaw))) + end end --set_bone_position([bone, position, rotation]) end \ No newline at end of file diff --git a/mods/ENTITIES/mcl_mobs/api/mob_functions/set_up.lua b/mods/ENTITIES/mcl_mobs/api/mob_functions/set_up.lua index d9cc4237c..971750293 100644 --- a/mods/ENTITIES/mcl_mobs/api/mob_functions/set_up.lua +++ b/mods/ENTITIES/mcl_mobs/api/mob_functions/set_up.lua @@ -13,8 +13,13 @@ mobs.can_despawn = function(self) if self.tamed or self.bred or self.nametag then return false end local mob_pos = self.object:get_pos() if not mob_pos then return true end + local players = minetest_get_connected_players() + if #players == 0 then return false end + -- If no players, probably this is being called from get_staticdata() at server shutdown time + -- Minetest is to buggy (as of 5.5) to delete entities at server shutdown time anyway + local distance = 999 - for _, player in pairs(minetest_get_connected_players()) do + for _, player in pairs(players) do if player and player:get_hp() > 0 then local player_pos = player:get_pos() local new_distance = vector_distance(player_pos, mob_pos) @@ -62,6 +67,102 @@ mobs.mob_staticdata = function(self) return minetest.serialize(tmp) end +mobs.armor_setup = function(self) + if not self._armor_items then + local armor = {} + -- Source: https://minecraft.fandom.com/wiki/Zombie + local materials = { + {name = "leather", chance = 0.3706}, + {name = "gold", chance = 0.4873}, + {name = "chain", chance = 0.129}, + {name = "iron", chance = 0.0127}, + {name = "diamond", chance = 0.0004} + } + local types = { + {name = "helmet", chance = 0.15}, + {name = "chestplate", chance = 0.75}, + {name = "leggings", chance = 0.75}, + {name = "boots", chance = 0.75} + } + + local material + if type(self._spawn_with_armor) == "string" then + material = self._spawn_with_armor + else + local chance = 0 + for i, m in pairs(materials) do + chance = chance + m.chance + if math.random() <= chance then + material = m.name + break + end + end + end + + for i, t in pairs(types) do + if math.random() <= t.chance then + armor[t.name] = material + else + break + end + end + + -- Save armor items in lua entity + self._armor_items = {} + for atype, material in pairs(armor) do + local item = "mcl_armor:" .. atype .. "_" .. material + self._armor_items[atype] = item + end + + -- Setup armor drops + for atype, material in pairs(armor) do + local wear = math.random(1, 65535) + local item = "mcl_armor:" .. atype .. "_" .. material .. " 1 " .. wear + self.drops = table.copy(self.drops) + table.insert(self.drops, { + name = item, + chance = 1/0.085, -- 8.5% + min = 1, + max = 1, + looting = "rare", + looting_factor = 0.01 / 3, + }) + end + + -- Configure textures + local t = "" + local first_image = true + for atype, material in pairs(armor) do + if not first_image then + t = t .. "^" + end + t = t .. "mcl_armor_" .. atype .. "_" .. material .. ".png" + first_image = false + end + if t ~= "" then + self.base_texture = table.copy(self.base_texture) + self.base_texture[1] = t + end + + -- Configure damage groups based on armor + -- Source: https://minecraft.fandom.com/wiki/Armor#Armor_points + local points = 2 + for atype, material in pairs(armor) do + local item_name = "mcl_armor:" .. atype .. "_" .. material + points = points + minetest.get_item_group(item_name, "mcl_armor_points") + end + local armor_strength = 100 - 4 * points + local armor_groups = self.object:get_armor_groups() + armor_groups.fleshy = armor_strength + self.armor = armor_groups + + -- Helmet protects mob from sun damage + if armor.helmet then + self.ignited_by_sunlight = false + end + end +end + -- activate mob and reload settings mobs.mob_activate = function(self, staticdata, def, dtime) @@ -104,6 +205,11 @@ mobs.mob_activate = function(self, staticdata, def, dtime) self.base_colbox = self.collisionbox self.base_selbox = self.selectionbox end + + -- Setup armor on mobs + if self._spawn_with_armor then + mobs.armor_setup(self) + end -- for current mobs that dont have this set if not self.base_selbox then diff --git a/mods/ENTITIES/mcl_mobs/api/spawning.lua b/mods/ENTITIES/mcl_mobs/api/spawning.lua index 424989426..7fb6983f4 100644 --- a/mods/ENTITIES/mcl_mobs/api/spawning.lua +++ b/mods/ENTITIES/mcl_mobs/api/spawning.lua @@ -267,6 +267,8 @@ function mobs:spawn_setup(def) local day_toggle = def.day_toggle local on_spawn = def.on_spawn local check_position = def.check_position + local group_size_min = def.group_size_min or 1 + local group_size_max = def.group_size_max or 1 -- chance/spawn number override in minetest.conf for registered mob local numbers = minetest.settings:get(name) @@ -300,10 +302,23 @@ function mobs:spawn_setup(def) day_toggle = day_toggle, check_position = check_position, on_spawn = on_spawn, + group_size_min = group_size_min, + group_size_max = group_size_max, } summary_chance = summary_chance + chance end +function mobs.spawn_mob(name, pos) + local def = minetest.registered_entities[name] + if not def then return end + if def.spawn then + return def.spawn(pos) + end + return minetest.add_entity(pos, name) +end + +local spawn_mob = mobs.spawn_mob + function mobs:spawn_specific(name, dimension, type_of_spawning, biomes, min_light, max_light, interval, chance, aoc, min_height, max_height, day_toggle, on_spawn) -- Do mobs spawn at all? @@ -341,6 +356,8 @@ function mobs:spawn_specific(name, dimension, type_of_spawning, biomes, min_ligh spawn_dictionary[key]["min_height"] = min_height spawn_dictionary[key]["max_height"] = max_height spawn_dictionary[key]["day_toggle"] = day_toggle + spawn_dictionary[key]["group_size_min"] = 1 + spawn_dictionary[key]["group_size_max"] = 3 summary_chance = summary_chance + chance end @@ -442,9 +459,9 @@ if mobs_spawn then and (mob_def.check_position and mob_def.check_position(spawning_position) or true) then --everything is correct, spawn mob - local object = minetest.add_entity(spawning_position, mob_def.name) + local object = spawn_mob(mob_def.name, spawning_position) if object then - return mob_def.on_spawn and mob_def.on_spawn(object, pos) + return mob_def.on_spawn and mob_def.on_spawn(object, spawning_position) end end current_summary_chance = current_summary_chance - mob_chance diff --git a/mods/ENTITIES/mcl_mobs/locale/mcl_mobs.fr.tr b/mods/ENTITIES/mcl_mobs/locale/mcl_mobs.fr.tr index 89b09ab10..808ebec4a 100644 --- a/mods/ENTITIES/mcl_mobs/locale/mcl_mobs.fr.tr +++ b/mods/ENTITIES/mcl_mobs/locale/mcl_mobs.fr.tr @@ -1,11 +1,11 @@ # textdomain: mcl_mobs -Peaceful mode active! No monsters will spawn.=Mode paisible actif! Aucun monstre n'apparaîtra. +Peaceful mode active! No monsters will spawn.=Mode paisible actif ! Aucun monstre n'apparaîtra. This allows you to place a single mob.=Cela vous permet de placer un seul mob. 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.=Placez-le là où vous voulez que le mob apparaisse. Les animaux apparaîtront apprivoisés, sauf si vous maintenez la touche furtive enfoncée pendant le placement. Si vous le placez sur un générateur de mob, vous changez le mob qu'il génère. You need the “maphack” privilege to change the mob spawner.=Vous avez besoin du privilège "maphack" pour changer le générateur de mob. Name Tag=Étiquette de nom A name tag is an item to name a mob.=Une étiquette de nom est un élément pour nommer un mob. 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.=Avant d'utiliser l'étiquette de nom, vous devez définir un nom sur une enclume. Ensuite, vous pouvez utiliser l'étiquette de nom pour nommer un mob. Cela utilise l'étiquette de nom. -Only peaceful mobs allowed!=Seuls les mobs pacifiques sont autorisés! +Only peaceful mobs allowed!=Seuls les mobs pacifiques sont autorisés ! Give names to mobs=Donne des noms aux mobs Set name at anvil=Définir le nom sur l'enclume diff --git a/mods/ENTITIES/mcl_paintings/locale/mcl_paintings.oc.tr b/mods/ENTITIES/mcl_paintings/locale/mcl_paintings.oc.tr new file mode 100644 index 000000000..24b198e49 --- /dev/null +++ b/mods/ENTITIES/mcl_paintings/locale/mcl_paintings.oc.tr @@ -0,0 +1,2 @@ +# textdomain:mcl_paintings +Painting=Pintura \ No newline at end of file diff --git a/mods/ENTITIES/mobs_mc/init.lua b/mods/ENTITIES/mobs_mc/init.lua index d7600e927..1e3481b93 100644 --- a/mods/ENTITIES/mobs_mc/init.lua +++ b/mods/ENTITIES/mobs_mc/init.lua @@ -61,6 +61,7 @@ dofile(path .. "/villager.lua") -- KrupnoPavel Mesh and animation by toby109tt --dofile(path .. "/agent.lua") -- Mesh and animation by toby109tt / https://github.com/22i -- Illagers and witch +dofile(path .. "/pillager.lua") -- Mesh by KrupnoPavel and MrRar, animation by MrRar dofile(path .. "/villager_evoker.lua") -- Mesh and animation by toby109tt / https://github.com/22i dofile(path .. "/villager_vindicator.lua") -- Mesh and animation by toby109tt / https://github.com/22i dofile(path .. "/villager_zombie.lua") -- Mesh and animation by toby109tt / https://github.com/22i diff --git a/mods/ENTITIES/mobs_mc/locale/mobs_mc.fr.tr b/mods/ENTITIES/mobs_mc/locale/mobs_mc.fr.tr index 74d664659..ef2e49b6e 100644 --- a/mods/ENTITIES/mobs_mc/locale/mobs_mc.fr.tr +++ b/mods/ENTITIES/mobs_mc/locale/mobs_mc.fr.tr @@ -74,3 +74,4 @@ Tool Smith=Fabriquant d'outil Cleric=Clerc Nitwit=Crétin Protects you from death while wielding it=Vous protège de la mort en le maniant +Pillager=Pillard \ No newline at end of file diff --git a/mods/ENTITIES/mobs_mc/locale/mobs_mc.oc.tr b/mods/ENTITIES/mobs_mc/locale/mobs_mc.oc.tr new file mode 100644 index 000000000..67cd9ef3b --- /dev/null +++ b/mods/ENTITIES/mobs_mc/locale/mobs_mc.oc.tr @@ -0,0 +1,77 @@ +# textdomain: mobs_mc +Totem of Undying=Totèm d'Imortalitat +A totem of undying is a rare artifact which may safe you from certain death.=Un totèm d'imortalitat es un artefacte rara que pòt vos sauvar d'una mòrt surada. +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.= +Agent=Agent +Bat=Ratapenada +Blaze=Blaze +Chicken=Pola +Cow=Vacha +Mooshroom=Champavacha +Creeper=Creeper +Ender Dragon=Drac de l'End +Enderman=Òme de l'End +Endermite=Endarna +Ghast=Trèva +Elder Guardian=Gardian Ainat +Guardian=Gardian +Horse=Ega +Skeleton Horse=Ega Esquelèta +Zombie Horse=Ega Mòrtaviva +Donkey=Asne +Mule=Miula +Iron Golem=Golèm de Fèrre +Llama=Lama +Ocelot=Ocelòt +Parrot=Papagai +Pig=Pòrc +Polar Bear=Ors Polar +Rabbit=Lapin +Killer Bunny=Lapin Tuaire +The Killer Bunny=Lo Lapin Tuaire +Sheep=Moton +Shulker= +Silverfish= +Skeleton= +Stray= +Wither Skeleton= +Magma Cube= +Slime= +Snow Golem= +Spider= +Cave Spider= +Squid= +Vex= +Evoker= +Illusioner= +Villager= +Vindicator= +Zombie Villager= +Witch= +Wither= +Wolf= +Husk= +Zombie= +Zombie Pigman= +Iron Horse Armor= +Iron horse armor can be worn by horses to increase their protection from harm a bit.= +Golden Horse Armor= +Golden horse armor can be worn by horses to increase their protection from harm.= +Diamond Horse Armor= +Diamond horse armor can be worn by horses to greatly increase their protection from harm.= +Place it on a horse to put on the horse armor. Donkeys and mules can't wear horse armor.= +Farmer= +Fisherman= +Fletcher= +Shepherd= +Librarian= +Cartographer= +Armorer= +Leatherworker= +Butcher= +Weapon Smith= +Tool Smith= +Cleric= +Nitwit= +Protects you from death while wielding it= +Pillager= diff --git a/mods/ENTITIES/mobs_mc/locale/template.txt b/mods/ENTITIES/mobs_mc/locale/template.txt index 7b55c1b89..d42f7ba08 100644 --- a/mods/ENTITIES/mobs_mc/locale/template.txt +++ b/mods/ENTITIES/mobs_mc/locale/template.txt @@ -74,3 +74,4 @@ Tool Smith= Cleric= Nitwit= Protects you from death while wielding it= +Pillager= diff --git a/mods/ENTITIES/mobs_mc/models/mobs_mc_pillager.b3d b/mods/ENTITIES/mobs_mc/models/mobs_mc_pillager.b3d new file mode 100644 index 000000000..14d791989 Binary files /dev/null and b/mods/ENTITIES/mobs_mc/models/mobs_mc_pillager.b3d differ diff --git a/mods/ENTITIES/mobs_mc/models/mobs_mc_pillager.blend b/mods/ENTITIES/mobs_mc/models/mobs_mc_pillager.blend new file mode 100644 index 000000000..57ef98221 Binary files /dev/null and b/mods/ENTITIES/mobs_mc/models/mobs_mc_pillager.blend differ diff --git a/mods/ENTITIES/mobs_mc/models/mobs_mc_sheepfur.b3d b/mods/ENTITIES/mobs_mc/models/mobs_mc_sheepfur.b3d index 1db15ddba..b909a5142 100644 Binary files a/mods/ENTITIES/mobs_mc/models/mobs_mc_sheepfur.b3d and b/mods/ENTITIES/mobs_mc/models/mobs_mc_sheepfur.b3d differ diff --git a/mods/ENTITIES/mobs_mc/models/mobs_mc_sheepfur.blend b/mods/ENTITIES/mobs_mc/models/mobs_mc_sheepfur.blend new file mode 100644 index 000000000..80db0c986 Binary files /dev/null and b/mods/ENTITIES/mobs_mc/models/mobs_mc_sheepfur.blend differ diff --git a/mods/ENTITIES/mobs_mc/pillager.lua b/mods/ENTITIES/mobs_mc/pillager.lua new file mode 100644 index 000000000..ca416d30a --- /dev/null +++ b/mods/ENTITIES/mobs_mc/pillager.lua @@ -0,0 +1,159 @@ +local S = minetest.get_translator("mobs_mc") + +local function reload(self) + if not self or not self.object then return end + minetest.sound_play("mcl_bows_crossbow_drawback_1", {object = self.object, max_hear_distance=16}, true) + local props = self.object:get_properties() + if not props then return end + props.textures[2] = "mcl_bows_crossbow_3.png^[resize:16x16" + self.object:set_properties(props) +end + +local function reset_animation(self, animation) + if not self or not self.object or self.current_animation ~= animation then return end + self.current_animation = "stand_reload" -- Mobs Redo won't set the animation unless we do this + mobs.set_mob_animation(self, animation) +end + +pillager = { + description = S("Pillager"), + type = "monster", + spawn_class = "hostile", + hostile = true, + rotate = 270, + hp_min = 24, + hp_max = 24, + xp_min = 6, + xp_max = 6, + breath_max = -1, + eye_height = 1.5, + projectile_cooldown = 3, -- Useless + shoot_interval = 3, -- Useless + shoot_offset = 1.5, + dogshoot_switch = 1, + dogshoot_count_max = 1.8, + projectile_cooldown_min = 3, + projectile_cooldown_max = 2.5, + armor = {fleshy = 100}, + collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.98, 0.3}, + pathfinding = 1, + group_attack = true, + visual = "mesh", + mesh = "mobs_mc_pillager.b3d", + + --head code + has_head = false, + head_bone = "head", + + swap_y_with_x = true, + reverse_head_yaw = true, + + head_bone_pos_y = 2.4, + head_bone_pos_z = 0, + + head_height_offset = 1.1, + head_direction_offset = 0, + head_pitch_modifier = 0, + --end head code + + visual_size = {x=2.75, y=2.75}, + makes_footstep_sound = true, + walk_velocity = 1.2, + run_velocity = 4, + damage = 2, + reach = 8, + view_range = 16, + fear_height = 4, + attack_type = "projectile", + arrow = "mcl_bows:arrow_entity", + sounds = { + random = "mobs_mc_pillager_grunt2", + war_cry = "mobs_mc_pillager_grunt1", + death = "mobs_mc_pillager_ow2", + damage = "mobs_mc_pillager_ow1", + distance = 16, + }, + textures = { + { + "mobs_mc_pillager.png", -- Skin + "mcl_bows_crossbow_3.png^[resize:16x16", -- Wielded item + } + }, + drops = { + { + name = "mcl_bows:arrow", + chance = 1, + min = 0, + max = 2, + looting = "common", + }, + { + name = "mcl_bows:crossbow", + chance = 100 / 8.5, + min = 1, + max = 1, + looting = "rare", + }, + }, + animation = { + unloaded_walk_start = 1, + unloaded_walk_end = 40, + unloaded_stand_start = 41, + unloaded_stand_end = 60, + + reload_stand_speed = 20, + reload_stand_start = 61, + reload_stand_end = 100, + + stand_speed = 6, + stand_start = 101, + stand_end = 109, + + walk_speed = 25, + walk_start = 111, + walk_end = 150, + run_speed = 40, + run_start = 111, + run_end = 150, + + reload_run_speed = 20, + reload_run_start = 151, + reload_run_end = 190, + + die_speed = 15, + die_start = 191, + die_end = 192, + die_loop = false, + + stand_unloaded_start = 40, + stand_unloaded_end = 59, + }, + shoot_arrow = function(self, pos, dir) + minetest.sound_play("mcl_bows_crossbow_shoot", {object = self.object, max_hear_distance=16}, true) + local props = self.object:get_properties() + props.textures[2] = "mcl_bows_crossbow_0.png^[resize:16x16" + self.object:set_properties(props) + local old_anim = self.current_animation + if old_anim == "run" then + mobs.set_mob_animation(self, "reload_run") + end + if old_anim == "stand" then + mobs.set_mob_animation(self, "reload_stand") + end + self.current_animation = old_anim -- Mobs Redo will imediately reset the animation otherwise + minetest.after(1, reload, self) + minetest.after(2, reset_animation, self, old_anim) + mobs.shoot_projectile_handling( + "mcl_bows:arrow", pos, dir, self.object:get_yaw(), + self.object, 30, math.random(3,4)) + + -- While we are at it, change the sounds since there is no way to do this in Mobs Redo + if self.sounds and self.sounds.random then + self.sounds = table.copy(self.sounds) + self.sounds.random = "mobs_mc_pillager_grunt" .. math.random(2) + end + end, +} + +mobs:register_mob("mobs_mc:pillager", pillager) +mobs:register_egg("mobs_mc:pillager", S("Pillager"), "mobs_mc_spawn_icon_pillager.png", 0) diff --git a/mods/ENTITIES/mobs_mc/rabbit.lua b/mods/ENTITIES/mobs_mc/rabbit.lua index 51235a3f9..e63c0d594 100644 --- a/mods/ENTITIES/mobs_mc/rabbit.lua +++ b/mods/ENTITIES/mobs_mc/rabbit.lua @@ -2,118 +2,27 @@ local S = minetest.get_translator(minetest.get_current_modname()) -local rabbit = { - description = S("Rabbit"), - type = "animal", - spawn_class = "passive", - passive = true, - reach = 1, - rotate = 270, - hp_min = 3, - hp_max = 3, - xp_min = 1, - xp_max = 3, - collisionbox = {-0.2, -0.01, -0.2, 0.2, 0.49, 0.2}, +local mob_name = "mobs_mc:rabbit" - visual = "mesh", - mesh = "mobs_mc_rabbit.b3d", - textures = { +local textures = { {"mobs_mc_rabbit_brown.png"}, {"mobs_mc_rabbit_gold.png"}, {"mobs_mc_rabbit_white.png"}, {"mobs_mc_rabbit_white_splotched.png"}, {"mobs_mc_rabbit_salt.png"}, {"mobs_mc_rabbit_black.png"}, - }, - visual_size = {x=1.5, y=1.5}, - sounds = { - random = "mobs_mc_rabbit_random", - damage = "mobs_mc_rabbit_hurt", - death = "mobs_mc_rabbit_death", - attack = "mobs_mc_rabbit_attack", - eat = "mobs_mc_animal_eat_generic", - distance = 16, - }, - makes_footstep_sound = false, - walk_velocity = 1, - run_velocity = 3.7, - follow_velocity = 1.1, - floats = 1, - runaway = true, - jump = true, - drops = { - {name = mobs_mc.items.rabbit_raw, chance = 1, min = 0, max = 1, looting = "common",}, - {name = mobs_mc.items.rabbit_hide, chance = 1, min = 0, max = 1, looting = "common",}, - {name = mobs_mc.items.rabbit_foot, chance = 10, min = 0, max = 1, looting = "rare", looting_factor = 0.03,}, - }, - fear_height = 4, - animation = { - speed_normal = 25, speed_run = 50, - stand_start = 0, stand_end = 0, - walk_start = 0, walk_end = 20, - run_start = 0, run_end = 20, - }, - -- Follow (yellow) dangelions, carrots and golden carrots - follow = mobs_mc.follow.rabbit, - view_range = 8, - -- Eat carrots and reduce their growth stage by 1 - replace_rate = 10, - replace_what = mobs_mc.replace.rabbit, - on_rightclick = function(self, clicker) - -- Feed, tame protect or capture - if mobs:feed_tame(self, clicker, 1, true, true) then return end - end, - do_custom = function(self) - -- Easter egg: Change texture if rabbit is named “Toast” - if self.nametag == "Toast" and not self._has_toast_texture then - self._original_rabbit_texture = self.base_texture - self.base_texture = { "mobs_mc_rabbit_toast.png" } - self.object:set_properties({ textures = self.base_texture }) - self._has_toast_texture = true - elseif self.nametag ~= "Toast" and self._has_toast_texture then - self.base_texture = self._original_rabbit_texture - self.object:set_properties({ textures = self.base_texture }) - self._has_toast_texture = false - end - end, } -mobs:register_mob("mobs_mc:rabbit", rabbit) +local sounds = { + random = "mobs_mc_rabbit_random", + damage = "mobs_mc_rabbit_hurt", + death = "mobs_mc_rabbit_death", + attack = "mobs_mc_rabbit_attack", + eat = "mobs_mc_animal_eat_generic", + distance = 16, +} --- The killer bunny (Only with spawn egg) -local killer_bunny = table.copy(rabbit) -killer_bunny.description = S("Killer Bunny") -killer_bunny.type = "monster" -killer_bunny.spawn_class = "hostile" -killer_bunny.attack_type = "dogfight" -killer_bunny.specific_attack = { "player", "mobs_mc:wolf", "mobs_mc:dog" } -killer_bunny.damage = 8 -killer_bunny.passive = false --- 8 armor points -killer_bunny.armor = 50 -killer_bunny.textures = { "mobs_mc_rabbit_caerbannog.png" } -killer_bunny.view_range = 16 -killer_bunny.replace_rate = nil -killer_bunny.replace_what = nil -killer_bunny.on_rightclick = nil -killer_bunny.run_velocity = 6 -killer_bunny.do_custom = function(self) - if not self._killer_bunny_nametag_set then - self.nametag = S("The Killer Bunny") - self._killer_bunny_nametag_set = true - end -end - -mobs:register_mob("mobs_mc:killer_bunny", killer_bunny) - --- Mob spawning rules. --- Different skins depending on spawn location <- we'll get to this when the spawning algorithm is fleshed out - -mobs:spawn_specific( -"mobs_mc:rabbit", -"overworld", -"ground", -{ +local biome_list = { "FlowerForest_beach", "Forest_beach", "StoneBeach", @@ -161,73 +70,149 @@ mobs:spawn_specific( "MesaBryce", "JungleEdge", "SavannaM", -}, -9, -minetest.LIGHT_MAX+1, -30, -15000, -8, -mobs_mc.spawn_height.overworld_min, -mobs_mc.spawn_height.overworld_max) - ---[[ -local spawn = { - name = "mobs_mc:rabbit", - neighbors = {"air"}, - chance = 15000, - active_object_count = 10, - min_light = 0, - max_light = minetest.LIGHT_MAX+1, - min_height = mobs_mc.spawn_height.overworld_min, - max_height = mobs_mc.spawn_height.overworld_max, } -local spawn_desert = table.copy(spawn) -spawn_desert.nodes = mobs_mc.spawn.desert -spawn_desert.on_spawn = function(self, pos) - local texture = "mobs_mc_rabbit_gold.png" - self.base_texture = { "mobs_mc_rabbit_gold.png" } - self.object:set_properties({textures = self.base_texture}) -end -mobs:spawn(spawn_desert) - -local spawn_snow = table.copy(spawn) -spawn_snow.nodes = mobs_mc.spawn.snow -spawn_snow.on_spawn = function(self, pos) +local function spawn_rabbit(pos) + local biome_data = minetest.get_biome_data(pos) + local biome_name = biome_data and minetest.get_biome_name(biome_data.biome) or "" + local mob = minetest.add_entity(pos, mob_name) + if not mob then return end + local self = mob:get_luaentity() local texture - local r = math.random(1, 100) - -- 80% white fur - if r <= 80 then - texture = "mobs_mc_rabbit_white.png" - -- 20% black and white fur + if biome_name:find("Desert") then + texture = "mobs_mc_rabbit_gold.png" else - texture = "mobs_mc_rabbit_white_splotched.png" + local r = math.random(1, 100) + if biome_name:find("Ice") or biome_name:find("snow") or biome_name:find("Cold") then + -- 80% white fur + if r <= 80 then + texture = "mobs_mc_rabbit_white.png" + -- 20% black and white fur + else + texture = "mobs_mc_rabbit_white_splotched.png" + end + else + -- 50% brown fur + if r <= 50 then + texture = "mobs_mc_rabbit_brown.png" + -- 40% salt fur + elseif r <= 90 then + texture = "mobs_mc_rabbit_salt.png" + -- 10% black fur + else + texture = "mobs_mc_rabbit_black.png" + end + end end - self.base_texture = { texture } - self.object:set_properties({textures = self.base_texture}) + self.base_texture = {texture} + self.object:set_properties({textures = {texture}}) end -mobs:spawn(spawn_snow) -local spawn_grass = table.copy(spawn) -spawn_grass.nodes = mobs_mc.spawn.grassland -spawn_grass.on_spawn = function(self, pos) - local texture - local r = math.random(1, 100) - -- 50% brown fur - if r <= 50 then - texture = "mobs_mc_rabbit_brown.png" - -- 40% salt fur - elseif r <= 90 then - texture = "mobs_mc_rabbit_salt.png" - -- 10% black fur - else - texture = "mobs_mc_rabbit_black.png" +local function do_custom_rabbit(self) + -- Easter egg: Change texture if rabbit is named “Toast” + if self.nametag == "Toast" and not self._has_toast_texture then + self._original_rabbit_texture = self.base_texture + self.base_texture = { "mobs_mc_rabbit_toast.png" } + self.object:set_properties({ textures = self.base_texture }) + self._has_toast_texture = true + elseif self.nametag ~= "Toast" and self._has_toast_texture then + self.base_texture = self._original_rabbit_texture + self.object:set_properties({ textures = self.base_texture }) + self._has_toast_texture = false end - self.base_texture = { texture } - self.object:set_properties({textures = self.base_texture}) end -mobs:spawn(spawn_grass) -]]-- + +local rabbit = { + description = S("Rabbit"), + type = "animal", + spawn_class = "passive", + passive = true, + reach = 1, + rotate = 270, + hp_min = 3, + hp_max = 3, + xp_min = 1, + xp_max = 3, + collisionbox = {-0.2, -0.01, -0.2, 0.2, 0.49, 0.2}, + visual = "mesh", + mesh = "mobs_mc_rabbit.b3d", + textures = textures, + visual_size = {x=1.5, y=1.5}, + sounds = sounds, + makes_footstep_sound = false, + walk_velocity = 1, + run_velocity = 3.7, + follow_velocity = 1.1, + floats = 1, + runaway = true, + jump = true, + drops = { + {name = mobs_mc.items.rabbit_raw, chance = 1, min = 0, max = 1, looting = "common",}, + {name = mobs_mc.items.rabbit_hide, chance = 1, min = 0, max = 1, looting = "common",}, + {name = mobs_mc.items.rabbit_foot, chance = 10, min = 0, max = 1, looting = "rare", looting_factor = 0.03,}, + }, + fear_height = 4, + animation = { + speed_normal = 25, speed_run = 50, + stand_start = 0, stand_end = 0, + walk_start = 0, walk_end = 20, + run_start = 0, run_end = 20, + }, + -- Follow (yellow) dangelions, carrots and golden carrots + follow = mobs_mc.follow.rabbit, + view_range = 8, + -- Eat carrots and reduce their growth stage by 1 + replace_rate = 10, + replace_what = mobs_mc.replace.rabbit, + on_rightclick = function(self, clicker) + -- Feed, tame protect or capture + if mobs:feed_tame(self, clicker, 1, true, true) then return end + end, + do_custom = do_custom_rabbit, + spawn = spawn_rabbit +} + +mobs:register_mob(mob_name, rabbit) + +-- The killer bunny (Only with spawn egg) +local killer_bunny = table.copy(rabbit) +killer_bunny.description = S("Killer Bunny") +killer_bunny.type = "monster" +killer_bunny.spawn_class = "hostile" +killer_bunny.attack_type = "dogfight" +killer_bunny.specific_attack = { "player", "mobs_mc:wolf", "mobs_mc:dog" } +killer_bunny.damage = 8 +killer_bunny.passive = false +-- 8 armor points +killer_bunny.armor = 50 +killer_bunny.textures = { "mobs_mc_rabbit_caerbannog.png" } +killer_bunny.view_range = 16 +killer_bunny.replace_rate = nil +killer_bunny.replace_what = nil +killer_bunny.on_rightclick = nil +killer_bunny.run_velocity = 6 +killer_bunny.do_custom = function(self) + if not self._killer_bunny_nametag_set then + self.nametag = S("The Killer Bunny") + self._killer_bunny_nametag_set = true + end +end + +mobs:register_mob("mobs_mc:killer_bunny", killer_bunny) + +-- Mob spawning rules. +-- Different skins depending on spawn location <- we customized spawn function + +mobs:spawn_setup({ + name = mob_name, + min_light = 9, + chance = 1000, + aoc = 8, + biomes = biome_list, + group_size_max = 1, + baby_min = 1, + baby_max = 2, +}) -- Spawn egg mobs:register_egg("mobs_mc:rabbit", S("Rabbit"), "mobs_mc_spawn_icon_rabbit.png", 0) diff --git a/mods/ENTITIES/mobs_mc/sheep.lua b/mods/ENTITIES/mobs_mc/sheep.lua index 76f933a6b..c074eb1f2 100644 --- a/mods/ENTITIES/mobs_mc/sheep.lua +++ b/mods/ENTITIES/mobs_mc/sheep.lua @@ -87,11 +87,11 @@ mobs:register_mob("mobs_mc:sheep", { swap_y_with_x = false, reverse_head_yaw = false, - head_bone_pos_y = 3.6, - head_bone_pos_z = -0.6, + head_bone_pos_y = 0, + head_bone_pos_z = 0, - head_height_offset = 1.0525, - head_direction_offset = 0.5, + head_height_offset = 1.2, + head_direction_offset = 0, head_pitch_modifier = 0, --end head code @@ -117,7 +117,7 @@ mobs:register_mob("mobs_mc:sheep", { }, animation = { speed_normal = 25, run_speed = 65, - stand_start = 40, stand_end = 80, + stand_start = 0, stand_end = 0, walk_start = 0, walk_end = 40, run_start = 0, run_end = 40, }, @@ -330,6 +330,24 @@ mobs:register_mob("mobs_mc:sheep", { return false end end, + on_spawn = function(self) + if self.baby then + self.animation = table.copy(self.animation) + self.animation.stand_start = 81 + self.animation.stand_end = 81 + self.animation.walk_start = 81 + self.animation.walk_end = 121 + self.animation.run_start = 81 + self.animation.run_end = 121 + end + return true + end, + on_grown = function(self) + self.animation = nil + local anim = self.current_animation + self.current_animation = nil -- Mobs Redo does nothing otherwise + mobs.set_mob_animation(self, anim) + end }) mobs:spawn_specific( "mobs_mc:sheep", diff --git a/mods/ENTITIES/mobs_mc/sounds/mobs_mc_pillager_grunt1.ogg b/mods/ENTITIES/mobs_mc/sounds/mobs_mc_pillager_grunt1.ogg new file mode 100644 index 000000000..38ef59445 Binary files /dev/null and b/mods/ENTITIES/mobs_mc/sounds/mobs_mc_pillager_grunt1.ogg differ diff --git a/mods/ENTITIES/mobs_mc/sounds/mobs_mc_pillager_grunt2.ogg b/mods/ENTITIES/mobs_mc/sounds/mobs_mc_pillager_grunt2.ogg new file mode 100644 index 000000000..b5766734e Binary files /dev/null and b/mods/ENTITIES/mobs_mc/sounds/mobs_mc_pillager_grunt2.ogg differ diff --git a/mods/ENTITIES/mobs_mc/sounds/mobs_mc_pillager_ow1.ogg b/mods/ENTITIES/mobs_mc/sounds/mobs_mc_pillager_ow1.ogg new file mode 100644 index 000000000..37e7620ef Binary files /dev/null and b/mods/ENTITIES/mobs_mc/sounds/mobs_mc_pillager_ow1.ogg differ diff --git a/mods/ENTITIES/mobs_mc/sounds/mobs_mc_pillager_ow2.ogg b/mods/ENTITIES/mobs_mc/sounds/mobs_mc_pillager_ow2.ogg new file mode 100644 index 000000000..0983ae4bb Binary files /dev/null and b/mods/ENTITIES/mobs_mc/sounds/mobs_mc_pillager_ow2.ogg differ diff --git a/mods/ENTITIES/mobs_mc/textures/mobs_mc_pillager.png b/mods/ENTITIES/mobs_mc/textures/mobs_mc_pillager.png new file mode 100644 index 000000000..772735c8d Binary files /dev/null and b/mods/ENTITIES/mobs_mc/textures/mobs_mc_pillager.png differ diff --git a/mods/ENTITIES/mobs_mc/textures/mobs_mc_sheep_fur.png b/mods/ENTITIES/mobs_mc/textures/mobs_mc_sheep_fur.png index fa447031d..9cff461b7 100644 Binary files a/mods/ENTITIES/mobs_mc/textures/mobs_mc_sheep_fur.png and b/mods/ENTITIES/mobs_mc/textures/mobs_mc_sheep_fur.png differ diff --git a/mods/ENTITIES/mobs_mc/textures/mobs_mc_spawn_icon_pillager.png b/mods/ENTITIES/mobs_mc/textures/mobs_mc_spawn_icon_pillager.png new file mode 100644 index 000000000..67dbfe418 Binary files /dev/null and b/mods/ENTITIES/mobs_mc/textures/mobs_mc_spawn_icon_pillager.png differ diff --git a/mods/ENTITIES/mobs_mc/villager.lua b/mods/ENTITIES/mobs_mc/villager.lua index 423f6c392..f038fc751 100644 --- a/mods/ENTITIES/mobs_mc/villager.lua +++ b/mods/ENTITIES/mobs_mc/villager.lua @@ -712,6 +712,11 @@ local trade_inventory = { elseif listname == "output" then if not trader_exists(player:get_player_name()) then return 0 + -- Begin Award Code + -- May need to be moved if award gets unlocked in the wrong cases. + elseif trader_exists(player:get_player_name()) then + awards.unlock(player:get_player_name(), "mcl:whatAdeal") + -- End Award Code end -- Only allow taking full stack local count = stack:get_count() diff --git a/mods/ENTITIES/mobs_mc/zombie.lua b/mods/ENTITIES/mobs_mc/zombie.lua index 3eb0122a7..7a5682d8f 100644 --- a/mods/ENTITIES/mobs_mc/zombie.lua +++ b/mods/ENTITIES/mobs_mc/zombie.lua @@ -204,6 +204,7 @@ local zombie = { attack_type = "punch", punch_timer_cooloff = 0.5, harmed_by_heal = true, + spawn_with_armor = true, } mobs:register_mob("mobs_mc:zombie", zombie) diff --git a/mods/ENVIRONMENT/lightning/init.lua b/mods/ENVIRONMENT/lightning/init.lua index 3579316e8..14d8f5176 100644 --- a/mods/ENVIRONMENT/lightning/init.lua +++ b/mods/ENVIRONMENT/lightning/init.lua @@ -238,8 +238,8 @@ after(5, function(dtime) end) minetest.register_chatcommand("lightning", { - params = "[ ]", - description = S("Let lightning strike at the specified position or yourself"), + params = "[ | ]", + description = S("Let lightning strike at the specified position or player. No parameter will strike yourself."), privs = { maphack = true }, func = function(name, param) local pos = {} @@ -247,21 +247,21 @@ minetest.register_chatcommand("lightning", { pos.x = tonumber(pos.x) pos.y = tonumber(pos.y) pos.z = tonumber(pos.z) + local player_to_strike if not (pos.x and pos.y and pos.z) then pos = nil + player_to_strike = minetest.get_player_by_name(param) + if not player_to_strike and param == "" then + player_to_strike = minetest.get_player_by_name(name) + end end - if name == "" and pos == nil then + if not player_to_strike and pos == nil then return false, "No position specified and unknown player" end if pos then lightning.strike(pos) - else - local player = minetest.get_player_by_name(name) - if player then - lightning.strike(player:get_pos()) - else - return false, S("No position specified and unknown player") - end + elseif player_to_strike then + lightning.strike(player_to_strike:get_pos()) end return true end, diff --git a/mods/ENVIRONMENT/lightning/locale/ lightning.oc.tr b/mods/ENVIRONMENT/lightning/locale/ lightning.oc.tr new file mode 100644 index 000000000..d9a62f661 --- /dev/null +++ b/mods/ENVIRONMENT/lightning/locale/ lightning.oc.tr @@ -0,0 +1,4 @@ +# textdomain: lightning +@1 was struck by lightning.=@1 fuguèt pica·t·da per lo tròn +Let lightning strike at the specified position or yourself=Pica lo tròn vès una posicion mencionada o sobre vosautr·e·a·s-mema +No position specified and unknown player=Pas de posicion mencionada e jogair·e·a pas conegu·t·da \ No newline at end of file diff --git a/mods/ENVIRONMENT/lightning/locale/lightning.fr.tr b/mods/ENVIRONMENT/lightning/locale/lightning.fr.tr index 96c5dc9fa..e61708066 100644 --- a/mods/ENVIRONMENT/lightning/locale/lightning.fr.tr +++ b/mods/ENVIRONMENT/lightning/locale/lightning.fr.tr @@ -1,4 +1,4 @@ # textdomain: lightning @1 was struck by lightning.=@1 a été frappé(e) par la foudre. -Let lightning strike at the specified position or yourself=Fait frapper la foudre à la position spécifiée ou sur vous-même +Let lightning strike at the specified position or player. No parameter will strike yourself.=Fait frapper la foudre sur la position ou le joueur indiqué. Sans paramètre, la foudre frappera sur vous-même. No position specified and unknown player=Aucune position spécifiée et joueur inconnu diff --git a/mods/ENVIRONMENT/lightning/locale/template.txt b/mods/ENVIRONMENT/lightning/locale/template.txt index 2c07393f6..897f295eb 100644 --- a/mods/ENVIRONMENT/lightning/locale/template.txt +++ b/mods/ENVIRONMENT/lightning/locale/template.txt @@ -1,4 +1,4 @@ # textdomain: lightning @1 was struck by lightning.= -Let lightning strike at the specified position or yourself= +Let lightning strike at the specified position or player. No parameter will strike yourself.= No position specified and unknown player= diff --git a/mods/ENVIRONMENT/mcl_void_damage/locale/mcl_void_damage.oc.tr b/mods/ENVIRONMENT/mcl_void_damage/locale/mcl_void_damage.oc.tr new file mode 100644 index 000000000..25b270d72 --- /dev/null +++ b/mods/ENVIRONMENT/mcl_void_damage/locale/mcl_void_damage.oc.tr @@ -0,0 +1,3 @@ +# textdomain: mcl_void_damage +The void is off-limits to you!=Lo voeida es defendut per vosautr·e·a·s ! +@1 fell into the endless void.=@1 es tombar dins la voeida infinida. \ No newline at end of file diff --git a/mods/ENVIRONMENT/mcl_weather/locale/mcl_weather.fr.tr b/mods/ENVIRONMENT/mcl_weather/locale/mcl_weather.fr.tr index 6fd0b4b53..41be9aec3 100644 --- a/mods/ENVIRONMENT/mcl_weather/locale/mcl_weather.fr.tr +++ b/mods/ENVIRONMENT/mcl_weather/locale/mcl_weather.fr.tr @@ -5,4 +5,4 @@ Error: No weather specified.=Erreur: Aucune météo spécifiée. Error: Invalid parameters.=Erreur: Paramètres non valides. Error: Duration can't be less than 1 second.=Erreur: La durée ne peut pas être inférieure à 1 seconde. Error: Invalid weather specified. Use “clear”, “rain”, “snow” or “thunder”.=Erreur: Météo non valide spécifiée. Utilisez "clear" (clair), "rain" (pluie), "snow" (neige) ou "thunder" (tonnerre). -Toggles between clear weather and weather with downfall (randomly rain, thunderstorm or snow)=Bascule entre temps clair et temps avec chute (au hasard entre pluie, orage ou neige) +Toggles between clear weather and weather with downfall (randomly rain, thunderstorm or snow)=Bascule entre temps clair et temps avec des précipitations (au hasard entre pluie, orage ou neige) diff --git a/mods/ENVIRONMENT/mcl_weather/skycolor.lua b/mods/ENVIRONMENT/mcl_weather/skycolor.lua index 6b89c33be..93e92defc 100644 --- a/mods/ENVIRONMENT/mcl_weather/skycolor.lua +++ b/mods/ENVIRONMENT/mcl_weather/skycolor.lua @@ -241,7 +241,7 @@ local function initsky(player) end -- MC-style clouds: Layer 127, thickness 4, fly to the “West” - player:set_clouds({height=mcl_worlds.layer_to_y(127), speed={x=-2, z=0}, thickness=4, color="#FFF0FEF"}) + player:set_clouds(mcl_worlds:get_cloud_parameters() or {height=mcl_worlds.layer_to_y(127), speed={x=-2, z=0}, thickness=4, color="#FFF0FEF"}) end minetest.register_on_joinplayer(initsky) diff --git a/mods/HELP/doc/doc/init.lua b/mods/HELP/doc/doc/init.lua index fc684246b..b3eeb7b61 100644 --- a/mods/HELP/doc/doc/init.lua +++ b/mods/HELP/doc/doc/init.lua @@ -611,11 +611,14 @@ do io.close(file) if string then local savetable = minetest.deserialize(string) - for name, players_stored_data in pairs(savetable.players_stored_data) do - doc.data.players[name] = {} - doc.data.players[name].stored_data = players_stored_data + local savetable_players_stored_data = savetable and savetable.players_stored_data + if savetable_players_stored_data then + for name, players_stored_data in pairs(savetable_players_stored_data) do + doc.data.players[name] = {} + doc.data.players[name].stored_data = players_stored_data + end + minetest.log("action", "[doc] doc.mt successfully read.") end - minetest.log("action", "[doc] doc.mt successfully read.") end end end diff --git a/mods/HELP/mcl_tt/locale/template.txt b/mods/HELP/mcl_tt/locale/template.txt index c8cf2908a..6fb735b13 100644 --- a/mods/HELP/mcl_tt/locale/template.txt +++ b/mods/HELP/mcl_tt/locale/template.txt @@ -17,7 +17,6 @@ Skeleton view range: -50%= Creeper view range: -50%= Damage: @1= Damage (@1): @2= -Durability: @1 Healing: @1= Healing (@1): @2= Full punch interval: @1s= diff --git a/mods/HUD/awards/locale/awards.fr.tr b/mods/HUD/awards/locale/awards.fr.tr index 2f2a78b68..2b00b2e3d 100644 --- a/mods/HUD/awards/locale/awards.fr.tr +++ b/mods/HUD/awards/locale/awards.fr.tr @@ -1,4 +1,4 @@ -# textdomain:awards +# textdomain: awards @1/@2 chat messages=@1/@2 chat messages @1/@2 crafted=@1/@2 fabrication @1/@2 deaths=@1/@2 Mort @@ -6,12 +6,11 @@ @1/@2 game joins=@1/@2 sessions @1/@2 placed=@1/@2 mis @1 (got)=@1 (obtenu) -@1: @1=@1: @1 +@1: @2=@1: @2 @1’s awards:=Récompenses de @1: (Secret Award)=(Récompense Secrètte) = = -A Cat in a Pop-Tart?!=Un chat beurré ?! Achievement gotten!=Succès obtenu ! Achievement gotten:=Succès obtenu : Achievement gotten: @1=Succès obtenu : @1 @@ -28,9 +27,9 @@ Join the game.=Rejoignez le jeu. List awards in chat (deprecated)=Liste des récompenses dans le chat (obsolète) Place a block: @1=Placer un bloc: @1 Place blocks: @1×@2=Placer des blocs: @1×@2 -Secret Achievement gotten!=Succès secret obtenu ! -Secret Achievement gotten:=Succès secret obtenu : -Secret Achievement gotten: @1=Succès secret obtenu : @1 +Secret achievement gotten!=Succès secret obtenu ! +Secret achievement gotten:=Succès secret obtenu : +Secret achievement gotten: @1=Succès secret obtenu : @1 Show details of an achievement=Afficher les détails d'un succès Show, clear, disable or enable your achievements=Affichez, effacez, désactivez ou activez vos succès Get this achievement to find out what it is.=Obtenez ce succès pour découvrir de quoi il s'agit. diff --git a/mods/HUD/awards/locale/template.txt b/mods/HUD/awards/locale/template.txt index ac6a1d752..ee833c53f 100644 --- a/mods/HUD/awards/locale/template.txt +++ b/mods/HUD/awards/locale/template.txt @@ -1,4 +1,4 @@ -# textdomain:awards +# textdomain: awards @1/@2 chat messages= @1/@2 crafted= @1/@2 deaths= diff --git a/mods/HUD/mcl_achievements/init.lua b/mods/HUD/mcl_achievements/init.lua index c963773d1..761888d16 100644 --- a/mods/HUD/mcl_achievements/init.lua +++ b/mods/HUD/mcl_achievements/init.lua @@ -101,6 +101,18 @@ awards.register_achievement("mcl:bookcase", { } }) +awards.register_achievement("mcl:buildIronPickaxe", { + title = S("Isn't It Iron Pick"), + -- TODO: This achievement should support all non-wood pickaxes + description = S("Craft a iron pickaxe using sticks and iron."), + icon = "default_tool_steelpick.png", + trigger = { + type = "craft", + item = "mcl_tools:pick_iron", + target = 1 + } +}) + -- Item pickup achievements: These are awarded when picking up a certain item. -- The achivements are manually given in the mod mcl_item_entity. awards.register_achievement("mcl:diamonds", { @@ -125,6 +137,24 @@ awards.register_achievement("mcl:mineWood", { icon = "default_tree.png", }) +awards.register_achievement("mcl:whosCuttingOnions", { + title = S("Who is Cutting Onions?"), + description = S("Pick up a crying obsidian from the floor."), + icon = "default_obsidian.png^mcl_core_crying_obsidian.png", +}) + +awards.register_achievement("mcl:hiddenInTheDepths", { + title = S("Hidden in the Depths"), + description = S("Pick up an Ancient Debris from the floor."), + icon = "mcl_nether_ancient_debris_side.png", +}) + +awards.register_achievement("mcl:notQuiteNineLives", { + title = S('Not Quite "Nine" Lives'), + description = S("Charge a Respawn Anchor to the maximum."), + icon = "respawn_anchor_side4.png", +}) + -- Smelting achivements: These are awarded when picking up an item from a furnace -- output. They are given in mcl_furnaces. awards.register_achievement("mcl:acquireIron", { @@ -163,6 +193,73 @@ awards.register_achievement("mcl:buildNetherPortal", { icon = "default_obsidian.png", }) +awards.register_achievement("mcl:enterEndPortal", { + title = S("The End?"), + description = S("Or the beginning?\nHint: Enter an end portal."), + icon = "mcl_end_end_stone.png", +}) + +-- Triggered in mcl_totems +awards.register_achievement("mcl:postMortal", { + title = S("Postmortal"), + description = S("Use a Totem of Undying to cheat death."), + icon = "mcl_totems_totem.png", +}) + +-- Triggered in mcl_beds +awards.register_achievement("mcl:sweetDreams", { + title = S("Sweet Dreams"), + description = S("Sleep in a bed to change your respawn point."), + icon = "mcl_beds_bed_red.png", +}) + +-- Triggered in mcl_smithing_table +awards.register_achievement("mcl:seriousDedication", { + title = S("Serious Dedication"), + description = S("Use a Netherite Ingot to upgrade a hoe, and then completely reevaluate your life choices."), + icon = "farming_tool_netheritehoe.png", +}) + +-- Triggered in mobs_mc +awards.register_achievement("mcl:whatAdeal", { + title = S("What A Deal!"), + description = S("Successfully trade with a Villager."), + icon = "mcl_core_emerald.png", +}) + +-- Triggered in mcl_fishing +awards.register_achievement("mcl:fishyBusiness", { + title = S("Fishy Business"), + description = S("Catch a fish. \nHint: Catch a fish, salmon, clownfish, or pufferfish."), + icon = "mcl_fishing_fishing_rod.png", +}) + +-- Armor Advancements +--[[awards.register_achievement("mcl:suitUp", { + title = S("Suit Up"), + description = S("Protect yourself with a piece of iron armor."), + icon = "mcl_armor_inv_chestplate_iron.png", +})]]-- + +--[[awards.register_achievement("mcl:coverMeDiamonds", { + title = S("Cover Me with Diamonds"), + description = S("Diamond armor saves lives."), + icon = "mcl_armor_inv_chestplate_diamond.png", +})]]-- + +--[[awards.register_achievement("mcl:coverMeDebris", { + title = S("Cover Me in Debris"), + description = S("Get a full suit of Netherite armor."), + icon = "mcl_armor_inv_chestplate_netherite.png", +})]]-- + +-- Triggered in extra_mobs +awards.register_achievement("mcl:tacticalFishing", { + title = S("Tactical Fishing"), + description = S("Catch a fish... without a fishing rod!"), + icon = "pufferfish_bucket.png", +}) + -- NON-PC ACHIEVEMENTS (XBox, Pocket Edition, etc.) if non_pc_achievements then diff --git a/mods/HUD/mcl_achievements/locale/mcl_achievements.fr.tr b/mods/HUD/mcl_achievements/locale/mcl_achievements.fr.tr index 0896bcf36..fdef74937 100644 --- a/mods/HUD/mcl_achievements/locale/mcl_achievements.fr.tr +++ b/mods/HUD/mcl_achievements/locale/mcl_achievements.fr.tr @@ -10,7 +10,7 @@ Craft a stone pickaxe using sticks and cobblestone.=Fabriquez une pioche en pier Craft a wooden sword using wooden planks and sticks on a crafting table.=Fabriquez une épée en bois à l'aide de planches et de bâtons en bois sur un établi. DIAMONDS!=DIAMANTS! Delicious Fish=Délicieux Poisson -Dispense With This=Dispenser de ça +Dispense With This=Dispensé de ça Eat a cooked porkchop.=Mangez du porc cuit. Eat a cooked rabbit.=Mangez du lapin cuit. Get really desperate and eat rotten flesh.=Soyez vraiment désespéré et mangez de la chair pourrie. @@ -47,3 +47,31 @@ Use a crafting table to craft a wooden hoe from wooden planks and sticks.=Utilis Use a crafting table to craft a wooden pickaxe from wooden planks and sticks.=Utilisez un établi pour fabriquer une pioche en bois à partir de planches et de bâtons en bois. Use obsidian and a fire starter to construct a Nether portal.=Utilisez de l'obsidienne et un briquet pour construire un portail du Nether. Use wheat to craft a bread.=Utilisez du blé pour fabriquer un pain. +Stone Age=L'Age de Pierre +Mine a stone with new pickaxe.=Miner de la roche avec une nouvelle pioche +Hot Stuff=Chaud Devant ! +Put lava in a bucket.=Remplir un Seau de lave +Ice Bucket Challenge=Le défi du seau d'eau glacée +Obtain an obsidian block.=Obtenir un bloc d'obsidienne +Isn't It Iron Pick=Bonne Pioche ! +Craft a iron pickaxe using sticks and iron.=Fabriquer une pioche de fer avec des batons et du fer +Who is Cutting Onions?=Qui épluche des oignons ? +Pick up a crying obsidian from the floor.=Ramasser une obsidienne pleureuse sur le sol. +Hidden in the Depths=Caché dans les profondeurs +Pick up an Ancient Debris from the floor.=Ramasser un Ancien Débris +Not Quite "Nine" Lives=Presque "neuf" vies +Charge a Respawn Anchor to the maximum.=Charger une Ancre de Réapparition au maximum. +The End?=L'End ? +Or the beginning?\nHint: Enter an end portal.=Ou le commencement ?\nAstuce : Entrer dans un portail de l'End. +Postmortal=Aux frontières de la mort +Use a Totem of Undying to cheat death.=Utiliser un Totem d'imortalité pour tromper la mort. +Sweet Dreams=Bonne nuit les petits +Sleep in a bed to change your respawn point.=Dormez dans un lit pour changer votre point de réapparition. +Serious Dedication=Sérieux dévouement +Use a Netherite Ingot to upgrade a hoe, and then completely reevaluate your life choices.=Utilisez un lingot de netherite pour améliorez une houe, puis réévaluez complètement vos choix de vie. +Fishy Business=Merci pour le poisson +Catch a fish. \nHint: Catch a fish, salmon, clownfish, or pufferfish.=Attrapez un poisson. \nAstuce : attrapez un poisson, saumon, poisson-clown, ou poisson-globe. +What A Deal!=Adjugé, Vendu ! +Successfully trade with a Villager.=Commercez avec succès avec un villageois. +Tactical Fishing=Pêche tactique +Catch a fish... without a fishing rod=Attrapez un poisson... sans canne à pêche \ No newline at end of file diff --git a/mods/HUD/mcl_achievements/locale/template.txt b/mods/HUD/mcl_achievements/locale/template.txt index eccec5225..61583a911 100644 --- a/mods/HUD/mcl_achievements/locale/template.txt +++ b/mods/HUD/mcl_achievements/locale/template.txt @@ -53,3 +53,25 @@ Hot Stuff= Put lava in a bucket.= Ice Bucket Challenge= Obtain an obsidian block.= +Isn't It Iron Pick= +Craft a iron pickaxe using sticks and iron.= +Who is Cutting Onions?= +Pick up a crying obsidian from the floor.= +Hidden in the Depths= +Pick up an Ancient Debris from the floor.= +Not Quite "Nine" Lives= +Charge a Respawn Anchor to the maximum.= +The End?= +Or the beginning?\nHint: Enter an end portal.= +Postmortal= +Use a Totem of Undying to cheat death.= +Sweet Dreams= +Sleep in a bed to change your respawn point.= +Serious Dedication= +Use a Netherite Ingot to upgrade a hoe, and then completely reevaluate your life choices.= +Fishy Business= +Catch a fish. \nHint: Catch a fish, salmon, clownfish, or pufferfish.= +What A Deal!= +Successfully trade with a Villager.= +Tactical Fishing= +Catch a fish... without a fishing rod= diff --git a/mods/HUD/mcl_credits/CONTRUBUTOR_LIST.txt b/mods/HUD/mcl_credits/CONTRUBUTOR_LIST.txt index 561952adc..520d18254 100644 --- a/mods/HUD/mcl_credits/CONTRUBUTOR_LIST.txt +++ b/mods/HUD/mcl_credits/CONTRUBUTOR_LIST.txt @@ -6,6 +6,7 @@ Alexander Minges aligator ArTee3 Artem Arbatsky +balazsszalab basxto Benjamin Schötz Blue Blancmange @@ -13,6 +14,7 @@ Booglejr Brandon Bu-Gee bzoss +CableGuy67 chmodsayshello Code-Sploit cora @@ -31,6 +33,7 @@ Emojigit epCode erlehmann FinishedFragment +FlamingRCCars Glaucos Ginez Gustavo Ramos Rehermann Guy Liner @@ -39,6 +42,7 @@ HimbeerserverDE iliekprogrammar j1233 Jared Moody +Johannes Fritz jordan4ibanez kabou kay27 @@ -46,13 +50,14 @@ Laurent Rocher Li0n marcin-serwin Marcin Serwin +Mark Roth Mental-Inferno Midgard MysticTempest Nicholas Niro nickolas360 Nicu -nikolaus-albinger +Niklp Nils Dagsson Moskopp NO11 NO411 @@ -60,6 +65,7 @@ Oil_boi pitchum PrairieAstronomer PrairieWind +River River Rocher Laurent rootyjr Rootyjr @@ -68,6 +74,7 @@ Sab Pyrope Saku Laesvuori sfan5 SmallJoker +Sumyjkl superfloh247 Sven792 Sydney Gems @@ -75,6 +82,7 @@ talamh TechDudie Thinking Tianyang Zhang +unknown U.N.Owen Wouters Dorian wuniversales diff --git a/mods/HUD/mcl_credits/README.md b/mods/HUD/mcl_credits/README.md index 3d76497d0..af422588e 100644 --- a/mods/HUD/mcl_credits/README.md +++ b/mods/HUD/mcl_credits/README.md @@ -1,8 +1,4 @@ -Please run the following command to update contributor list: - -```bash -# git log --pretty="%an" | sort | uniq >CONTRUBUTOR_LIST.txt -``` +Please run `./update_credits.sh` from [tools](../../../tools) folder to update contributor list. Please check that there is no error on execution, and `CONTRUBUTOR_LIST.txt` is updated. diff --git a/mods/HUD/mcl_death_messages/locale/mcl_death_messages.fr.tr b/mods/HUD/mcl_death_messages/locale/mcl_death_messages.fr.tr index 8c83238e7..884a4bb24 100644 --- a/mods/HUD/mcl_death_messages/locale/mcl_death_messages.fr.tr +++ b/mods/HUD/mcl_death_messages/locale/mcl_death_messages.fr.tr @@ -1,59 +1,56 @@ # textdomain: mcl_death_messages -@1 was fatally hit by an arrow.=@1 a été mortellement touché par une flèche. -@1 has been killed with an arrow.=@1 a été tué avec une flèche. -@1 was shot by an arrow from @2.=@1 a été abattu par une flèche de @2. -@1 was shot by an arrow from a skeleton.=@1 a été abattu par une flèche d'un squelette. -@1 was shot by an arrow from a stray.=@1 a été abattu par une flèche d'un vagabond. -@1 was shot by an arrow from an illusioner.=@1 a été abattu par une flèche d'un illusionniste. -@1 was shot by an arrow.=@1 a été abattu par une flèche. -@1 forgot to breathe.=@1 a oublié de respirer. -@1 drowned.=@1 s'est noyé. -@1 ran out of oxygen.=@1 a manqué d'oxygène. -@1 was killed by @2.=@1 a été tué par @2. -@1 was killed.=@1 a été tué. -@1 was killed by a mob.=@1 a été tué par un mob. -@1 was burned to death by a blaze's fireball.=@1 a été brûlé vif par la boule de feu d'un blaze. -@1 was killed by a fireball from a blaze.=@1 a été tué par une boule de feu lors d'un blaze. -@1 was burned by a fire charge.=@1 a été brûlé par un incendie. -A ghast scared @1 to death.=Un ghast a éffrayé @1 à mort. -@1 has been fireballed by a ghast.=@1 a été pétrifié par un ghast. -@1 fell from a high cliff.=@1 est tombé d'une haute falaise. -@1 took fatal fall damage.=@1 a succombé à un chute mortelle. -@1 fell victim to gravity.=@1 a été victime de la gravité. -@1 died.=@1 est mort. -@1 was killed by a zombie.=@1 a été tué par un zombie. -@1 was killed by a baby zombie.=@1 a été tué par un bébé zombie. -@1 was killed by a blaze.=@1 a été tué par un blaze. -@1 was killed by a slime.=@1 a été tué par un slime. -@1 was killed by a witch.=@1 a été tué par un sorcier. -@1 was killed by a magma cube.=@1 a été tué par un cube de magma. -@1 was killed by a wolf.=@1 a été tué par un loup. -@1 was killed by a cat.=@1 a été tué par un chat. -@1 was killed by an ocelot.=@1 a été tué par un ocelot. -@1 was killed by an ender dragon.=@1 a été tué par un ender dragon. -@1 was killed by a wither.=@1 a été tué par un wither. -@1 was killed by an enderman.=@1 a été tué par un enderman. -@1 was killed by an endermite.=@1 a été tué par un endermite. -@1 was killed by a ghast.=@1 a été tué par un ghast. -@1 was killed by an elder guardian.=@1 a été tué par un grand gardien. -@1 was killed by a guardian.=@1 a été tué par un gardien. -@1 was killed by an iron golem.=@1 a été tué par un golem de fer. -@1 was killed by a polar_bear.=@1 a été tué par un ours blanc. -@1 was killed by a killer bunny.=@1 a été tué par un lapin tueur. -@1 was killed by a shulker.=@1 a été tué par un shulker. -@1 was killed by a silverfish.=@1 a été tué par un poisson d'argent. -@1 was killed by a skeleton.=@1 a été tué par un squelette. -@1 was killed by a stray.=@1 a été tué par un vagabond. -@1 was killed by a slime.=@1 a été tué par un slime. -@1 was killed by a spider.=@1 a été tué par une araignée. -@1 was killed by a cave spider.=@1 a été tué par une araignée venimeuse. -@1 was killed by a vex.=@1 a été tué par un vex. -@1 was killed by an evoker.=@1 a été tué par un invocateur. -@1 was killed by an illusioner.=@1 a été tué par un illusionniste. -@1 was killed by a vindicator.=@1 a été tué par un vindicateur. -@1 was killed by a zombie villager.=@1 a été tué par un villageois zombie. -@1 was killed by a husk.=@1 a été tué par un zombie momie. -@1 was killed by a baby husk.=@1 a été tué par un bébé zombie momie. -@1 was killed by a zombie pigman.=@1 a été tué par un zombie-couchon. -@1 was killed by a baby zombie pigman.=@1 a été tué par un bébé zombie-couchon -@1 was slain by @2.=@1 a été tué par @2 +@1 went up in flames=@1 a marché dans les flammes +@1 walked into fire whilst fighting @2=@1 a marché dans les flammes en combattant @2 +@1 was struck by lightning=@1 a été frappé par la foudre +@1 was struck by lightning whilst fighting @2=@1 a été frappé par la foudre en combattant @2 +@1 burned to death=@1 a brûlé vif +@1 was burnt to a crisp whilst fighting @2=@1 a brûlé comme une saucisse en combattant @2 +@1 tried to swim in lava=@1 a tenté de nager dans la lave +@1 tried to swim in lava to escape @2=@1 a tenté de nager dans la lave pour échapper à @2 +@1 discovered the floor was lava=@1 a découvert que le sol était en lave +@1 walked into danger zone due to @2=@1 a marché dans la zone de danger à cause de @2 +@1 suffocated in a wall=@1 est mort asphyxié dans un mur +@1 suffocated in a wall whilst fighting @2=@1 est mort asphyxié dans un mur en combattant @2 +@1 drowned=@1 s'est noyé +@1 drowned whilst trying to escape @2=@1 s'est noyé en essayant d'échapper à @2 +@1 starved to death=@1 est mort de faim +@1 starved to death whilst fighting @2=@1 est mort de faim en combattant @2 +@1 was pricked to death=@1 a été piqué à mort +@1 walked into a cactus whilst trying to escape @2=@1 a marché dans un cactus en essayant d'échapper à @2 +@1 hit the ground too hard=@1 a heurté le sol trop fort +@1 hit the ground too hard whilst trying to escape @2=@1 a heurté le sol trop fort en essayant d'échapper à @2 +@1 experienced kinetic energy=@1 a expérimenté l'énergie cinétique +@1 experienced kinetic energy whilst trying to escape @2=@1 a expérimenté l'énergie cinétique en essayant d'échapper à @2 +@1 fell out of the world=@1 est tombé hors du monde +@1 didn't want to live in the same world as @2=@1 ne voulait vivre dans le même monde que @2 +@1 died=@1 est mort +@1 died because of @2=@1 est mort à cause de @2 +@1 was killed by magic=@1 a été tué par magie +@1 was killed by magic whilst trying to escape @2=@1 a été tué par magie en essayant d'échapper à @2 +@1 was killed by @2 using magic=@1 a été tué par @2 en utilisant la magie +@1 was killed by @2 using @3=@1 a été tué par @2 en utilisant @3 +@1 was roasted in dragon breath=@1 a été rôti dans le souffle du dragon +@1 was roasted in dragon breath by @2=@1 a été rôti dans le souffle du dragon par @2 +@1 withered away=@1 s'est flétri +@1 withered away whilst fighting @2=@1 s'est flétri en combattant @2 +@1 was shot by a skull from @2=@1 a été abattu par un crane de @2 +@1 was squashed by a falling anvil=@1 a été écrasé par une enclume +@1 was squashed by a falling anvil whilst fighting @2=@1 a été écrasé par une enclume en combattant @2 +@1 was squashed by a falling block=@1 a été écrasé par un bloc tombant +@1 was squashed by a falling block whilst fighting @2=@1 a été écrasé par un bloc tombant en combattant @2 +@1 was slain by @2=@1 a été tué par @2 +@1 was slain by @2 using @3=@1 a été tué par @2 avec @3 +@1 was shot by @2=@1 a été abattu par @2 +@1 was shot by @2 using @3=@1 a été abattu par @2 avec @3 +@1 was fireballed by @2=@1 a reçu une boule de feu de @2 +@1 was fireballed by @2 using @3=@1 a reçu une boule de feu de @2 en utilisant @3 +@1 was killed trying to hurt @2=@1 a été tué en essayant de blesser @2 +@1 was killed by @3 trying to hurt @2=@1 a été tué par @3 en essayant de blesser @2 +@1 blew up=@1 a explosé +@1 was blown up by @2=@1 a été explosé par @2 +@1 was blown up by @2 using @3=@1 a été explosé par @2 en utilisant @3 +@1 was squished too much=@1 a été trop écrabouillé +@1 was squashed by @2=@1 a été écrasé par @2 +@1 went off with a bang=@1 est parti avec un bang +@1 went off with a bang due to a firework fired from @3 by @2=@1 est parti avec un bang à cause d'un feu d'artifice tiré de @3 par @2 + diff --git a/mods/HUD/mcl_death_messages/locale/template.txt b/mods/HUD/mcl_death_messages/locale/template.txt index 67ba9fd1c..711dfb89b 100644 --- a/mods/HUD/mcl_death_messages/locale/template.txt +++ b/mods/HUD/mcl_death_messages/locale/template.txt @@ -33,7 +33,6 @@ @1 was roasted in dragon breath by @2= @1 withered away= @1 withered away whilst fighting @2= -@1 was killed by magic= @1 was shot by a skull from @2= @1 was squashed by a falling anvil= @1 was squashed by a falling anvil whilst fighting @2= @@ -41,8 +40,6 @@ @1 was squashed by a falling block whilst fighting @2= @1 was slain by @2= @1 was slain by @2 using @3= -@1 was slain by @2= -@1 was slain by @2 using @3= @1 was shot by @2= @1 was shot by @2 using @3= @1 was fireballed by @2= diff --git a/mods/HUD/mcl_experience/locale/mlc_experience.fr.tr b/mods/HUD/mcl_experience/locale/mlc_experience.fr.tr index 0644e2596..488af5006 100644 --- a/mods/HUD/mcl_experience/locale/mlc_experience.fr.tr +++ b/mods/HUD/mcl_experience/locale/mlc_experience.fr.tr @@ -5,3 +5,4 @@ Error: Too many parameters!=Erreur: Trop de paramètres! Error: Incorrect value of XP=Erreur: Valeur incorrecte de XP Error: Player not found=Erreur: Joueur introuvable Added @1 XP to @2, total: @3, experience level: @4=Ajout de @1 XP à @2, total: @3, niveau d'expérience: @4 +Bottle o' Enchanting=Fiole d'expérience \ No newline at end of file diff --git a/mods/HUD/mcl_info/init.lua b/mods/HUD/mcl_info/init.lua index 02af53fbc..122a1064e 100644 --- a/mods/HUD/mcl_info/init.lua +++ b/mods/HUD/mcl_info/init.lua @@ -1,14 +1,20 @@ local refresh_interval = .63 local huds = {} -local default_debug = 3 +local default_debug = 5 local after = minetest.after local get_connected_players = minetest.get_connected_players local get_biome_name = minetest.get_biome_name local get_biome_data = minetest.get_biome_data +local get_node = minetest.get_node local format = string.format +local table_concat = table.concat +local floor = math.floor +local minetest_get_gametime = minetest.get_gametime +local get_voxel_manip = minetest.get_voxel_manip local min1, min2, min3 = mcl_mapgen.overworld.min, mcl_mapgen.end_.min, mcl_mapgen.nether.min local max1, max2, max3 = mcl_mapgen.overworld.max, mcl_mapgen.end_.max, mcl_mapgen.nether.max + 128 +local CS = mcl_mapgen.CS_NODES local modname = minetest.get_current_modname() local modpath = minetest.get_modpath(modname) @@ -17,6 +23,7 @@ local storage = minetest.get_mod_storage() local player_dbg = minetest.deserialize(storage:get_string("player_dbg") or "return {}") or {} local function get_text(pos, bits) + local pos = pos local bits = bits if bits == 0 then return "" end local y = pos.y @@ -27,16 +34,42 @@ local function get_text(pos, bits) elseif y >= min2 and y <= max2 then y = y - min2 end - local biome_data = get_biome_data(pos) - local biome_name = biome_data and get_biome_name(biome_data.biome) or "No biome" - local text - if bits == 1 then - text = biome_name - elseif bits == 2 then - text = format("x:%.1f y:%.1f z:%.1f", pos.x, y, pos.z) - elseif bits == 3 then - text = format("%s x:%.1f y:%.1f z:%.1f", biome_name, pos.x, y, pos.z) + + local will_show_mapgen_status = bits % 8 > 3 + local will_show_coordinates = bits % 4 > 1 + local will_show_biome_name = bits % 2 > 0 + local will_be_shown = {} + + if will_show_biome_name then + local biome_data = get_biome_data(pos) + local biome_name = biome_data and get_biome_name(biome_data.biome) or "No biome" + will_be_shown[#will_be_shown + 1] = biome_name end + if will_show_coordinates then + local coordinates = format("x:%.1f y:%.1f z:%.1f", pos.x, y, pos.z) + will_be_shown[#will_be_shown + 1] = coordinates + end + if will_show_mapgen_status then + local pos_x = floor(pos.x) + local pos_y = floor(pos.y) + local pos_z = floor(pos.z) + local c = 0 + for x = pos_x - CS, pos_x + CS, CS do + for y = pos_y - CS, pos_y + CS, CS do + for z = pos_z - CS, pos_z + CS, CS do + local pos = {x = x, y = y, z = z} + get_voxel_manip():read_from_map(pos, pos) + local node = get_node(pos) + if node.name ~= "ignore" then c = c + 1 end + end + end + end + local p = floor(c / 27 * 100 + 0.5) + local status = format("Generated %u%% (%u/27 chunks)", p, c) + will_be_shown[#will_be_shown + 1] = status + end + + local text = table_concat(will_be_shown, ' ') return text end @@ -82,14 +115,14 @@ minetest.register_on_authplayer(function(name, ip, is_success) end) minetest.register_chatcommand("debug",{ - description = S("Set debug bit mask: 0 = disable, 1 = biome name, 2 = coordinates, 3 = all"), + description = S("Set debug bit mask: 0 = disable, 1 = biome name, 2 = coordinates, 4 = mapgen status, 7 = all"), func = function(name, params) local dbg = math.floor(tonumber(params) or default_debug) - if dbg < 0 or dbg > 3 then - minetest.chat_send_player(name, S("Error! Possible values are integer numbers from @1 to @2", 0, 3)) + if dbg < 0 or dbg > 7 then + minetest.chat_send_player(name, S("Error! Possible values are integer numbers from @1 to @2", 0, 7)) return end - if dbg == default_dbg then + if dbg == default_debug then player_dbg[name] = nil else player_dbg[name] = dbg diff --git a/mods/HUD/mcl_info/locale/mcl_info.fr.tr b/mods/HUD/mcl_info/locale/mcl_info.fr.tr new file mode 100644 index 000000000..14eaec287 --- /dev/null +++ b/mods/HUD/mcl_info/locale/mcl_info.fr.tr @@ -0,0 +1,4 @@ +# textdomain: mcl_info +Set debug bit mask: 0 @= disable, 1 @= biome name, 2 @= coordinates, 4 @= mapgen status, 7 @= all=Réglage du masque de débugage : 0 @= désactiver, 1 @= nom de biome, 2 @= coordonnées, 4 @= mapgen status, 7 @= tout= +Error! Possible values are integer numbers from @1 to @2=Erreur ! Les valeurs autorisées sont des nombres entiers de @1 à @2 +Debug bit mask set to @1=Masque de débugage réglé à @1 diff --git a/mods/HUD/mcl_info/locale/mcl_info.ru.tr b/mods/HUD/mcl_info/locale/mcl_info.ru.tr index 7f5b79fe1..e97ffda83 100644 --- a/mods/HUD/mcl_info/locale/mcl_info.ru.tr +++ b/mods/HUD/mcl_info/locale/mcl_info.ru.tr @@ -1,4 +1,4 @@ # textdomain: mcl_info -Set debug bit mask: 0 @= disable, 1 @= biome name, 2 @= coordinates, 3 @= all=Установка отладочной битовой маски: 0 @= отключить, 1 @= биом, 2 @= координаты, 3 @= всё +Set debug bit mask: 0 @= disable, 1 @= biome name, 2 @= coordinates, 4 @= mapgen status, 7 @= all=Установка отладочной битовой маски: 0 @= отключить, 1 @= биом, 2 @= координаты, 4 @= состояние мапгена, 7 @= всё Error! Possible values are integer numbers from @1 to @2=Ошибка! Допустимые значения - целые числа от @1 до @2 Debug bit mask set to @1=Отладочной битовой маске присвоено значение @1 diff --git a/mods/HUD/mcl_info/locale/template.txt b/mods/HUD/mcl_info/locale/template.txt index 1a0b70ebc..819901656 100644 --- a/mods/HUD/mcl_info/locale/template.txt +++ b/mods/HUD/mcl_info/locale/template.txt @@ -1,4 +1,4 @@ # textdomain: mcl_info -Set debug bit mask: 0 @= disable, 1 @= biome name, 2 @= coordinates, 3 @= all= +Set debug bit mask: 0 @= disable, 1 @= biome name, 2 @= coordinates, 4 @= mapgen status, 7 @= all= Error! Possible values are integer numbers from @1 to @2= Debug bit mask set to @1= diff --git a/mods/HUD/mcl_inventory/creative.lua b/mods/HUD/mcl_inventory/creative.lua index f2bd8076a..1bdd45a35 100644 --- a/mods/HUD/mcl_inventory/creative.lua +++ b/mods/HUD/mcl_inventory/creative.lua @@ -339,14 +339,6 @@ function mcl_inventory.set_creative_formspec(player, start_i, pagenum, inv_size, if name == "inv" then inv_bg = "crafting_inventory_creative_survival.png" - -- Show armor and player image - local player_preview - if minetest.settings:get_bool("3d_player_preview", true) then - player_preview = mcl_player.get_player_formspec_model(player, 3.9, 1.4, 1.2333, 2.4666, "") - else - player_preview = "image[3.9,1.4;1.2333,2.4666;"..mcl_player.player_get_preview(player).."]" - end - -- Background images for armor slots (hide if occupied) local armor_slot_imgs = "" local inv = player:get_inventory() @@ -386,8 +378,7 @@ function mcl_inventory.set_creative_formspec(player, start_i, pagenum, inv_size, armor_slot_imgs.. -- player preview - player_preview.. - + mcl_player.get_player_formspec_model(player, 3.9, 1.4, 1.2333, 2.4666, "").. -- crafting guide button "image_button[9,1;1,1;craftguide_book.png;__mcl_craftguide;]".. "tooltip[__mcl_craftguide;"..F(S("Recipe book")).."]".. diff --git a/mods/HUD/mcl_inventory/init.lua b/mods/HUD/mcl_inventory/init.lua index 0a8b9a7bc..1b841ba80 100644 --- a/mods/HUD/mcl_inventory/init.lua +++ b/mods/HUD/mcl_inventory/init.lua @@ -61,14 +61,6 @@ local function set_inventory(player, armor_change_only) inv:set_width("craft", 2) inv:set_size("craft", 4) - -- Show armor and player image - local player_preview - if minetest.settings:get_bool("3d_player_preview", true) then - player_preview = mcl_player.get_player_formspec_model(player, 1.0, 0.0, 2.25, 4.5, "") - else - player_preview = "image[1.1,0.2;2,4;"..mcl_player.player_get_preview(player).."]" - end - local armor_slots = {"helmet", "chestplate", "leggings", "boots"} local armor_slot_imgs = "" for a=1,4 do @@ -83,7 +75,7 @@ local function set_inventory(player, armor_change_only) local form = "size[9,8.75]".. "background[-0.19,-0.25;9.41,9.49;crafting_formspec_bg.png]".. - player_preview.. + mcl_player.get_player_formspec_model(player, 1.0, 0.0, 2.25, 4.5, "").. --armor "list[current_player;armor;0,0;1,1;1]".. "list[current_player;armor;0,1;1,1;2]".. diff --git a/mods/HUD/mcl_inventory/locale/mcl_inventory.fr.tr b/mods/HUD/mcl_inventory/locale/mcl_inventory.fr.tr index 208eb01dc..a99df1a66 100644 --- a/mods/HUD/mcl_inventory/locale/mcl_inventory.fr.tr +++ b/mods/HUD/mcl_inventory/locale/mcl_inventory.fr.tr @@ -3,6 +3,7 @@ Recipe book=Livre de recettes Help=Aide Select player skin=Sélectionnez l'apparence du joueur Achievements=Accomplissements +Switch stack size=Échanger les tailles de piles Building Blocks=Blocs de Construction Decoration Blocks=Blocs de Décoration Redstone=Redstone diff --git a/mods/ITEMS/REDSTONE/mcl_bells/init.lua b/mods/ITEMS/REDSTONE/mcl_bells/init.lua index 9a69e4353..4ce591d7d 100644 --- a/mods/ITEMS/REDSTONE/mcl_bells/init.lua +++ b/mods/ITEMS/REDSTONE/mcl_bells/init.lua @@ -17,6 +17,7 @@ minetest.register_node("mcl_bells:bell", { 4/16, 7/16, 4/16, }, }, + groups = { pickaxey = 1 } }) if has_mcl_wip then diff --git a/mods/ITEMS/REDSTONE/mcl_bells/locale/mcl_bells.fr.tr b/mods/ITEMS/REDSTONE/mcl_bells/locale/mcl_bells.fr.tr new file mode 100644 index 000000000..cfd5a65c9 --- /dev/null +++ b/mods/ITEMS/REDSTONE/mcl_bells/locale/mcl_bells.fr.tr @@ -0,0 +1,2 @@ +# textdomain: mcl_bells +Bell=Cloche diff --git a/mods/ITEMS/REDSTONE/mcl_bells/locale/template.txt b/mods/ITEMS/REDSTONE/mcl_bells/locale/template.txt index 2f554c2a0..c6475fb83 100644 --- a/mods/ITEMS/REDSTONE/mcl_bells/locale/template.txt +++ b/mods/ITEMS/REDSTONE/mcl_bells/locale/template.txt @@ -1,2 +1,2 @@ -# textdomain: mcl_observers +# textdomain: mcl_bells Bell= diff --git a/mods/ITEMS/REDSTONE/mcl_target/init.lua b/mods/ITEMS/REDSTONE/mcl_target/init.lua new file mode 100644 index 000000000..268c6ebe3 --- /dev/null +++ b/mods/ITEMS/REDSTONE/mcl_target/init.lua @@ -0,0 +1,70 @@ +local S = minetest.get_translator("mcl_target") + +local mod_farming = minetest.get_modpath("mcl_farming") + +mcl_target = {} + +function mcl_target.hit(pos, time) + minetest.set_node(pos, {name="mcl_target:target_on"}) + mesecon.receptor_on(pos, mesecon.rules.alldirs) + + local timer = minetest.get_node_timer(pos) + timer:start(time) +end + +minetest.register_node("mcl_target:target_off", { + description = S("Target"), + _doc_items_longdesc = S("A target is a block that provides a temporary redstone charge when hit by a projectile."), + _doc_items_usagehelp = S("Throw a projectile on the target to activate it."), + tiles = {"mcl_target_target_top.png", "mcl_target_target_top.png", "mcl_target_target_side.png"}, + groups = {hoey = 1}, + sounds = mcl_sounds.node_sound_dirt_defaults({ + footstep = {name="default_grass_footstep", gain=0.1}, + }), + mesecons = { + receptor = { + state = mesecon.state.off, + rules = mesecon.rules.alldirs, + }, + }, + _mcl_blast_resistance = 0.5, + _mcl_hardness = 0.5, +}) + +minetest.register_node("mcl_target:target_on", { + description = S("Target"), + _doc_items_create_entry = false, + tiles = {"mcl_target_target_top.png", "mcl_target_target_top.png", "mcl_target_target_side.png"}, + groups = {hoey = 1, not_in_creative_inventory = 1}, + drop = "mcl_target:target_off", + sounds = mcl_sounds.node_sound_dirt_defaults({ + footstep = {name="default_grass_footstep", gain=0.1}, + }), + on_timer = function(pos, elapsed) + local node = minetest.get_node(pos) + if node.name == "mcl_target:target_on" then --has not been dug + minetest.set_node(pos, {name="mcl_target:target_off"}) + mesecon.receptor_off(pos, mesecon.rules.alldirs) + end + end, + mesecons = { + receptor = { + state = mesecon.state.on, + rules = mesecon.rules.alldirs, + }, + }, + _mcl_blast_resistance = 0.5, + _mcl_hardness = 0.5, +}) + + +if mod_farming then + minetest.register_craft({ + output = "mcl_target:target_off", + recipe = { + {"", "mesecons:redstone", ""}, + {"mesecons:redstone", "mcl_farming:hay_block", "mesecons:redstone"}, + {"", "mesecons:redstone", ""}, + }, + }) +end \ No newline at end of file diff --git a/mods/ITEMS/REDSTONE/mcl_target/locale/mcl_target.fr.tr b/mods/ITEMS/REDSTONE/mcl_target/locale/mcl_target.fr.tr new file mode 100644 index 000000000..6c558683d --- /dev/null +++ b/mods/ITEMS/REDSTONE/mcl_target/locale/mcl_target.fr.tr @@ -0,0 +1,4 @@ +# textdomain: mcl_target +Target=Cible +A target is a block that provides a temporary redstone charge when hit by a projectile.=La cible est un bloc qui se comporte comme une source d'énergie temporaire quand elle est frappée par un projectile. +Throw a projectile on the target to activate it.=Lancer un projectile sur la cible pour l'activer. \ No newline at end of file diff --git a/mods/ITEMS/REDSTONE/mcl_target/locale/template.txt b/mods/ITEMS/REDSTONE/mcl_target/locale/template.txt new file mode 100644 index 000000000..18bc7708c --- /dev/null +++ b/mods/ITEMS/REDSTONE/mcl_target/locale/template.txt @@ -0,0 +1,4 @@ +# textdomain: mcl_target +Target= +A target is a block that provides a temporary redstone charge when hit by a projectile.= +Throw a projectile on the target to activate it.= \ No newline at end of file diff --git a/mods/ITEMS/REDSTONE/mcl_target/mod.conf b/mods/ITEMS/REDSTONE/mcl_target/mod.conf new file mode 100644 index 000000000..16f70ed12 --- /dev/null +++ b/mods/ITEMS/REDSTONE/mcl_target/mod.conf @@ -0,0 +1,3 @@ +name = mcl_target +author = AFCMS +depends = mesecons, mcl_sounds \ No newline at end of file diff --git a/mods/ITEMS/REDSTONE/mcl_target/textures/mcl_target_target_side.png b/mods/ITEMS/REDSTONE/mcl_target/textures/mcl_target_target_side.png new file mode 100644 index 000000000..286f7767e Binary files /dev/null and b/mods/ITEMS/REDSTONE/mcl_target/textures/mcl_target_target_side.png differ diff --git a/mods/ITEMS/REDSTONE/mcl_target/textures/mcl_target_target_top.png b/mods/ITEMS/REDSTONE/mcl_target/textures/mcl_target_target_top.png new file mode 100644 index 000000000..b55ef3ec8 Binary files /dev/null and b/mods/ITEMS/REDSTONE/mcl_target/textures/mcl_target_target_top.png differ diff --git a/mods/ITEMS/REDSTONE/mesecons_button/init.lua b/mods/ITEMS/REDSTONE/mesecons_button/init.lua index 2812b2758..b324fcf6d 100644 --- a/mods/ITEMS/REDSTONE/mesecons_button/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_button/init.lua @@ -216,6 +216,18 @@ mesecon.register_button( S("A stone button is a redstone component made out of stone which can be pushed to provide redstone power. When pushed, it powers adjacent redstone components for 1 second."), "mesecons_button_push") +mesecon.register_button( + "polished_blackstone", + S("Polished Blackstone Button"), + "mcl_blackstone_polished.png", + "mcl_blackstone:blackstone_polished", + mcl_sounds.node_sound_stone_defaults(), + {material_stone=1,handy=1,pickaxey=1}, + 1, + false, + S("A polished blackstone button is a redstone component made out of polished blackstone which can be pushed to provide redstone power. When pushed, it powers adjacent redstone components for 1 second."), + "mesecons_button_push") + local woods = { { "wood", "mcl_core:wood", "default_wood.png", S("Oak Button") }, { "acaciawood", "mcl_core:acaciawood", "default_acacia_wood.png", S("Acacia Button") }, @@ -223,6 +235,8 @@ local woods = { { "darkwood", "mcl_core:darkwood", "mcl_core_planks_big_oak.png", S("Dark Oak Button") }, { "sprucewood", "mcl_core:sprucewood", "mcl_core_planks_spruce.png", S("Spruce Button") }, { "junglewood", "mcl_core:junglewood", "default_junglewood.png", S("Jungle Button") }, + { "warped_hyphae_wood", "mcl_mushroom:warped_hyphae_wood", "warped_hyphae_wood.png", S("Warped Hyphae Button") }, + { "crimson_hyphae_wood", "mcl_mushroom:crimson_hyphae_wood", "crimson_hyphae_wood.png", S("Crimson Hyphae Button") }, } for w=1, #woods do diff --git a/mods/ITEMS/REDSTONE/mesecons_button/locale/mesecons_button.fr.tr b/mods/ITEMS/REDSTONE/mesecons_button/locale/mesecons_button.fr.tr index 96f963b4b..03d78b50d 100644 --- a/mods/ITEMS/REDSTONE/mesecons_button/locale/mesecons_button.fr.tr +++ b/mods/ITEMS/REDSTONE/mesecons_button/locale/mesecons_button.fr.tr @@ -1,6 +1,7 @@ # textdomain: mesecons_button Use the button to push it.=Utilisez le bouton pour le pousser. Stone Button=Bouton de pierre +Polished Blackstone Button=Bouton de Pierre Noire Polie A stone button is a redstone component made out of stone which can be pushed to provide redstone power. When pushed, it powers adjacent redstone components for 1 second.=Un bouton en pierre est un composant Redstone en pierre qui peut être poussé pour fournir de la puissance Redstone. Lorsqu'il est poussé, il alimente les composants Redstone adjacents pendant 1 seconde. Oak Button=Bouton en Chêne Acacia Button=Bouton en Acacia @@ -8,6 +9,8 @@ Birch Button=Bouton en Bouleau Dark Oak Button=Bouton en Chêne Noir Spruce Button=Bouton en Sapin Jungle Button=Bouton en Acajou +Warped Hyphae Button=Bouton en Hyphae Tordu +Crimson Hyphae Button=Bouton en Hyphae Ecarlate A wooden button is a redstone component made out of wood which can be pushed to provide redstone power. When pushed, it powers adjacent redstone components for 1.5 seconds. Wooden buttons may also be pushed by arrows.=Un bouton en bois est un composant de redstone en bois qui peut être poussé pour fournir une puissance de redstone. Lorsqu'il est poussé, il alimente les composants Redstone adjacents pendant 1,5 seconde. Les boutons en bois peuvent également être poussés par des flèches. Provides redstone power when pushed=Fournit une puissance de redstone lorsqu'il est poussé Push duration: @1s=Durée de poussée: @1s diff --git a/mods/ITEMS/REDSTONE/mesecons_button/locale/template.txt b/mods/ITEMS/REDSTONE/mesecons_button/locale/template.txt index 4c352b878..41d404101 100644 --- a/mods/ITEMS/REDSTONE/mesecons_button/locale/template.txt +++ b/mods/ITEMS/REDSTONE/mesecons_button/locale/template.txt @@ -1,6 +1,7 @@ # textdomain: mesecons_button Use the button to push it.= Stone Button= +Polished Blackstone Button= A stone button is a redstone component made out of stone which can be pushed to provide redstone power. When pushed, it powers adjacent redstone components for 1 second.= Oak Button= Acacia Button= @@ -8,6 +9,8 @@ Birch Button= Dark Oak Button= Spruce Button= Jungle Button= +Warped Hyphae Button= +Crimson Hyphae Button= A wooden button is a redstone component made out of wood which can be pushed to provide redstone power. When pushed, it powers adjacent redstone components for 1.5 seconds. Wooden buttons may also be pushed by arrows.= Provides redstone power when pushed= Push duration: @1s= diff --git a/mods/ITEMS/REDSTONE/mesecons_pressureplates/init.lua b/mods/ITEMS/REDSTONE/mesecons_pressureplates/init.lua index d040c8666..b3d7a4de8 100644 --- a/mods/ITEMS/REDSTONE/mesecons_pressureplates/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_pressureplates/init.lua @@ -164,6 +164,8 @@ local woods = { { "darkwood", "mcl_core:darkwood", "mcl_core_planks_big_oak.png", S("Dark Oak Pressure Plate" )}, { "sprucewood", "mcl_core:sprucewood", "mcl_core_planks_spruce.png", S("Spruce Pressure Plate") }, { "junglewood", "mcl_core:junglewood", "default_junglewood.png", S("Jungle Pressure Plate") }, + { "warped_hyphae_wood", "mcl_mushrooom:warped_hyphae_wood", "warped_hyphae_wood.png", S("Warped Hyphae Pressure Plate")}, + { "crimson_hyphae_wood", "mcl_mushrooom:crimson_hyphae_wood", "crimson_hyphae_wood.png", S("Crimson Hyphae Pressure Plate")}, } for w=1, #woods do @@ -201,6 +203,19 @@ mesecon.register_pressure_plate( { player = true, mob = true }, S("A stone pressure plate is a redstone component which supplies its surrounding blocks with redstone power while a player or mob stands on top of it. It is not triggered by anything else.")) +mesecon.register_pressure_plate( + "mesecons_pressureplates:pressure_plate_polished_blackstone", + S("Polished Blackstone Pressure Plate"), + {"mcl_blackstone_polished.png"}, + {"mcl_blackstone_polished.png"}, + "default_stone.png", + nil, + {{"mcl_blackstone:blackstone_polished", "mcl_blackstone:blackstone_polished"}}, + mcl_sounds.node_sound_stone_defaults(), + {pickaxey=1, material_stone=1}, + { player = true, mob = true }, + S("A polished blackstone pressure plate is a redstone component which supplies its surrounding blocks with redstone power while a player or mob stands on top of it. It is not triggered by anything else.")) + mesecon.register_pressure_plate( "mesecons_pressureplates:pressure_plate_gold", S("Light-Weighted Pressure Plate"), @@ -211,5 +226,18 @@ mesecon.register_pressure_plate( {{"mcl_core:gold_ingot", "mcl_core:gold_ingot"}}, mcl_sounds.node_sound_metal_defaults(), {pickaxey=1}, - { player = true, mob = true }, - S("A light-weighted pressure plate is a redstone component which supplies its surrounding blocks with redstone power while a player or mob stands on top of it. It is not triggered by anything else.")) + nil, + S("A light-weighted pressure plate is a redstone component which supplies its surrounding blocks with redstone power while any movable object (including dropped items, players and mobs) rests on top of it.")) + +mesecon.register_pressure_plate( + "mesecons_pressureplates:pressure_plate_iron", + S("Heavy-Weighted Pressure Plate"), + {"default_steel_block.png"}, + {"default_steel_block.png"}, + "default_steel_block.png", + nil, + {{"mcl_core:iron_ingot", "mcl_core:iron_ingot"}}, + mcl_sounds.node_sound_metal_defaults(), + {pickaxey=1}, + nil, + S("A heavy-weighted pressure plate is a redstone component which supplies its surrounding blocks with redstone power while any movable object (including dropped items, players and mobs) rests on top of it.")) diff --git a/mods/ITEMS/REDSTONE/mesecons_pressureplates/locale/mesecons_pressureplates.fr.tr b/mods/ITEMS/REDSTONE/mesecons_pressureplates/locale/mesecons_pressureplates.fr.tr index ef145de56..f82d3f552 100644 --- a/mods/ITEMS/REDSTONE/mesecons_pressureplates/locale/mesecons_pressureplates.fr.tr +++ b/mods/ITEMS/REDSTONE/mesecons_pressureplates/locale/mesecons_pressureplates.fr.tr @@ -6,10 +6,18 @@ Birch Pressure Plate=Plaque de pression en Bouleau Dark Oak Pressure Plate=Plaque de pression en Chêne Noir Spruce Pressure Plate=Plaque de pression en Sapin Jungle Pressure Plate=Plaque de pression en Acajou +Warped Hyphae Pressure Plate=Plaque de pression en Hyphae Tordue +Crimson Hyphae Pressure Plate=Plaque de pression en Hyphae Ecarlate A wooden pressure plate is a redstone component which supplies its surrounding blocks with redstone power while any movable object (including dropped items, players and mobs) rests on top of it.=Une plaque de pression en bois est un composant de redstone qui alimente ses blocs environnants en puissance de redstone tandis que tout objet mobile (y compris les objets lâchés, les joueurs et les mobs) repose dessus. Stone Pressure Plate=Plaque de pression en pierre A stone pressure plate is a redstone component which supplies its surrounding blocks with redstone power while a player or mob stands on top of it. It is not triggered by anything else.=Une plaque de pression en pierre est un composant de redstone qui alimente ses blocs environnants en puissance de redstone pendant qu'un joueur ou un mob se tient au-dessus. Il n'est déclenché par rien d'autre. -Provides redstone power when pushed=Fournit une puissance de redstone lorsqu'il est poussé +Polished Blackstone Pressure Plate=Plaque de pression en pierre noire polie +A polished blackstone pressure plate is a redstone component which supplies its surrounding blocks with redstone power while a player or mob stands on top of it. It is not triggered by anything else.=Une plaque de pression en pierre noire polie est un composant de redstone qui alimente ses blocs environnants en puissance de redstone pendant qu'un joueur ou un mob se tient au-dessus. Il n'est déclenché par rien d'autre. +Light-Weighted Pressure Plate=Plaque de pression pondérée légère +A light-weighted pressure plate is a redstone component which supplies its surrounding blocks with redstone power while any movable object (including dropped items, players and mobs) rests on top of it.=Une plaque de pression pondérée légère est un composant de redstone qui alimente ses blocs environnants en puissance de redstone tandis que tout objet mobile (y compris les objets lâchés, les joueurs et les mobs) repose dessus. +Heavy-Weighted Pressure Plate=Plaque de pression pondérée lourde +A heavy-weighted pressure plate is a redstone component which supplies its surrounding blocks with redstone power while any movable object (including dropped items, players and mobs) rests on top of it.=Une plaque de pression pondérée lourde est un composant de redstone qui alimente ses blocs environnants en puissance de redstone tandis que tout objet mobile (y compris les objets lâchés, les joueurs et les mobs) repose dessus. +Provides redstone power when pushed=Fournit une puissance de redstone lorsque poussé Pushable by players, mobs and objects=Poussable par les joueurs, les mobs et les objets Pushable by players and mobs=Poussable par les joueurs et les mobs Pushable by players=Poussable par les joueurs diff --git a/mods/ITEMS/REDSTONE/mesecons_pressureplates/locale/template.txt b/mods/ITEMS/REDSTONE/mesecons_pressureplates/locale/template.txt index 96eb3f922..a118f727a 100644 --- a/mods/ITEMS/REDSTONE/mesecons_pressureplates/locale/template.txt +++ b/mods/ITEMS/REDSTONE/mesecons_pressureplates/locale/template.txt @@ -6,9 +6,17 @@ Birch Pressure Plate= Dark Oak Pressure Plate= Spruce Pressure Plate= Jungle Pressure Plate= +Warped Hyphae Pressure Plate= +Crimson Hyphae Pressure Plate= A wooden pressure plate is a redstone component which supplies its surrounding blocks with redstone power while any movable object (including dropped items, players and mobs) rests on top of it.= Stone Pressure Plate= A stone pressure plate is a redstone component which supplies its surrounding blocks with redstone power while a player or mob stands on top of it. It is not triggered by anything else.= +Polished Blackstone Pressure Plate= +A polished blackstone pressure plate is a redstone component which supplies its surrounding blocks with redstone power while a player or mob stands on top of it. It is not triggered by anything else.= +Light-Weighted Pressure Plate= +A light-weighted pressure plate is a redstone component which supplies its surrounding blocks with redstone power while any movable object (including dropped items, players and mobs) rests on top of it.= +Heavy-Weighted Pressure Plate= +A heavy-weighted pressure plate is a redstone component which supplies its surrounding blocks with redstone power while any movable object (including dropped items, players and mobs) rests on top of it.= Provides redstone power when pushed= Pushable by players, mobs and objects= Pushable by players and mobs= diff --git a/mods/ITEMS/mcl_amethyst/locale/ mcl_amethyst.oc.tr b/mods/ITEMS/mcl_amethyst/locale/ mcl_amethyst.oc.tr new file mode 100644 index 000000000..f68cecae9 --- /dev/null +++ b/mods/ITEMS/mcl_amethyst/locale/ mcl_amethyst.oc.tr @@ -0,0 +1,19 @@ +# textdomain: mcl_amethyst +Amethyst Cluster= Abarolada d'Ametista +Amethyst Cluster is the final growth of amethyst bud.= L'Abarolada d'Ametista es l'etapa fin finala de creissança dau borron d'ametista. +Amethyst Shard= Esclap d'Ametista +An amethyst shard is a crystalline mineral.= Un Esclap d'Ametista es un minerau cristallin. +Block of Amethyst= Blòc d'Ametista +Budding Amethyst= Ametista Borronanta +Calcite= Calcita +Calcite can be found as part of amethyst geodes.= La Calcita pòt se trobar dins una geòda d'ametista. +Large Amethyst Bud= Borron d'Ametista Bèl +Large Amethyst Bud is the third growth of amethyst bud.= Lo Borron d'Ametista Bèl es la tresèima etapa de creissança dau borron d'ametista. +Medium Amethyst Bud= Borron d'Ametista Mejan +Medium Amethyst Bud is the second growth of amethyst bud.= Lo Borron d'Ametista Mejan es la segonda etapa de creissança dau borron d'ametista. +Small Amethyst Bud= Borron d'Ametista Pichòt +Small Amethyst Bud is the first growth of amethyst bud.= Lo Borron d'Ametista Pichòt es la pormèira etapa de creissança dau borron d'ametista. +The Block of Amethyst is a decoration block crafted from amethyst shards.= Lo Blòc d'Ametista es un blòc de decoracion fabricat dempuèi d'esclaps d'ametista. +The Budding Amethyst can grow amethyst= L'Ametista Borronanta pòt créisser l'ametista. +Tinted Glass= Veire Tintat +Tinted Glass is a type of glass which blocks lights while it is visually transparent.= Lo Veire Tintat es un tipe de veire que barra la lutz en estant clarent. \ No newline at end of file diff --git a/mods/ITEMS/mcl_armor/API.md b/mods/ITEMS/mcl_armor/API.md new file mode 100644 index 000000000..06292aab4 --- /dev/null +++ b/mods/ITEMS/mcl_armor/API.md @@ -0,0 +1,288 @@ +# mcl_armor + +This mod implements the ability of registering armors. + +## Registering an Armor Set + +The `mcl_armor.register_set()` function aims to simplify the process of registering a full set of armor. + +This function register four pieces of armor (head, torso, leggings, feets) based on a definition table: + +```lua +mcl_armor.register_set({ + --name of the armor material (used for generating itemstrings) + name = "dummy_armor", + + --description of the armor material + --do NOT translate this string, it will be concatenated will each piece of armor's description and result will be automatically fetched from your mod's translation files + description = "Dummy Armor", + + --overide description of each armor piece + --do NOT localize this string + descriptions = { + head = "Cap", --default: "Helmet" + torso = "Tunic", --default: "Chestplate" + legs = "Pants", --default: "Leggings" + feet = "Shoes", --default: "Boots" + }, + + --this is used to calculate each armor piece durability with the minecraft algorithm + --head durability = durability * 0.6857 + 1 + --torso durability = durability * 1.0 + 1 + --legs durability = durability * 0.9375 + 1 + --feet durability = durability * 0.8125 + 1 + durability = 80, + + --this is used then you need to specify the durability of each piece of armor + --this field have the priority over the durability one + --if the durability of some pieces of armor isn't specified in this field, the durability field will be used insteed + durabilities = { + head = 200, + torso = 500, + legs = 400, + feet = 300, + }, + + --this define how good enchants you will get then enchanting one piece of the armor in an enchanting table + --if set to zero or nil, the armor will not be enchantable + enchantability = 15, + + --this define how much each piece of armor protect the player + --these points will be shown in the HUD (chestplate bar above the health bar) + points = { + head = 1, + torso = 3, + legs = 2, + feet = 1, + }, + + --this attribute reduce strong damage even more + --See https://minecraft.fandom.com/wiki/Armor#Armor_toughness for more explanations + --default: 0 + toughness = 2, + + --this field is used to specify some items groups that will be added to each piece of armor + --please note that some groups do NOT need to be added by hand, because they are already handeled by the register function: + --(armor, combat_armor, armor_, combat_armor_, mcl_armor_points, mcl_armor_toughness, mcl_armor_uses, enchantability) + groups = {op_armor = 1}, + + --specify textures that will be overlayed on the entity wearing the armor + --these fields have default values and its recommanded to keep the code clean by just using the default name for your textures + textures = { + head = "dummy_texture.png", --default: "_helmet_.png" + torso = "dummy_texture.png", --default: "_chestplate_.png" + legs = "dummy_texture.png", --default: "_leggings_.png" + feet = "dummy_texture.png", --default: "_boots_.png" + }, + --you can also define these fields as functions, that will be called each time the API function mcl_armor.update(obj) is called (every time you equip/unequip some armor piece, take damage, and more) + --note that the enchanting overlay will not appear unless you implement it in the function + --this allow to make armors where the textures change whitout needing to register many other armors with different textures + textures = { + head = function(obj, itemstack) + if mcl_enchanting.is_enchanted(itemstack) then + return "dummy_texture.png^"..mcl_enchanting.overlay + else + return "dummy_texture.png" + end + end, + }, + + --inventory textures aren't definable using a table similar to textures or previews + --you are forced to use the default texture names which are: + --head: "_inv_helmet_.png + --torso: "_inv_chestplate_.png + --legs: "_inv_leggings_.png + --feet: "_inv_boots_.png + + --this callback table allow you to define functions that will be called each time an entity equip an armor piece or the mcl_armor.on_equip() function is called + --the functions accept two arguments: obj and itemstack + on_equip_callbacks = { + head = function(obj, itemstack) + --do stuff + end, + }, + + --this callback table allow you to define functions that will be called each time an entity unequip an armor piece or the mcl_armor.on_unequip() function is called + --the functions accept two arguments: obj and itemstack + on_unequip_callbacks = { + head = function(obj, itemstack) + --do stuff + end, + }, + + --this callback table allow you to define functions that will be called then an armor piece break + --the functions accept one arguments: obj + --the itemstack isn't sended due to how minetest handle items which have a zero durability + on_break_callbacks = { + head = function(obj) + --do stuff + end, + }, + + --this is used to generate automaticaly armor crafts based on each element type folowing the regular minecraft pattern + --if set to nil no craft will be added + craft_material = "mcl_mobitems:leather", + + --this is used to generate cooking crafts for each piece of armor + --if set to nil no craft will be added + cook_material = "mcl_core:gold_nugget", --cooking any piece of this armor will output a gold nugged + + --this is used for allowing each piece of the armor to be repaired by using an anvil with repair_material as aditionnal material + --it basicaly set the _repair_material item field of each piece of the armor + --if set to nil no repair material will be added + repair_material = "mcl_core:iron_ingot", +}) +``` + +## Creating an Armor Piece + +If you don't want to register a full set of armor, then you will need to manually register your own single item. + +```lua +minetest.register_tool("dummy_mod:random_armor", { + description = S("Random Armor"), + + --these two item fields are used for ingame documentation + --the mcl_armor.longdesc and mcl_armor.usage vars contains the basic usage and purpose of a piece of armor + --these vars may not be enough for that you want to do, so you may add some extra informations like that: + --_doc_items_longdesc = mcl_armor.longdesc.." "..S("Some extra informations.") + _doc_items_longdesc = mcl_armor.longdesc, + _doc_items_usagehelp = mcl_armor.usage, + + --this field is similar to any item definition in minetest + --it just set the image shown then the armor is dropped as an item or inside an inventory + inventory_image = "mcl_armor_inv_elytra.png", + + --this field is used by minetest internally and also by some helper functions + --in order for the tool to be shown is the right creative inventory tab, the right groups should be added + --"mcl_armor_uses" is required to give your armor a durability + --in that case, the armor can be worn by 10 points before breaking + --if you want the armor to be enchantable, you should also add the "enchantability" group, with the highest number the better enchants you can apply + groups = {armor = 1, non_combat_armor = 1, armor_torso = 1, non_combat_torso = 1, mcl_armor_uses = 10}, + + --this table is used by minetest for seraching item specific sounds + --the _mcl_armor_equip and _mcl_armor_unequip are used by the armor implementation to play sounds on equip and unequip + --note that you don't need to provide any file extention + sounds = { + _mcl_armor_equip = "mcl_armor_equip_leather", + _mcl_armor_unequip = "mcl_armor_unequip_leather", + }, + + --these fields should be initialised like that in most cases + --mcl_armor.equip_on_use is a function that try to equip the piece of armor you have in hand inside the right armor slot if the slot is empty + on_place = mcl_armor.equip_on_use, + on_secondary_use = mcl_armor.equip_on_use, + + --this field define that the tool is ACTUALLY an armor piece and in which armor slot you can put it + --it should be set to "head", "torso", "legs" or "feet" + _mcl_armor_element = "torso", + + + --this field is used to provide the texture that will be overlayed on the object (player or mob) skin + --this field can be a texture name or a function that will be called each time the mcl_armor.update(obj) function is called + --see the mcl_armor.register_set() documentation for more explanations + _mcl_armor_texture = "mcl_armor_elytra.png" + + --callbacks + --see the mcl_armor.register_set() documentation for more explanations + + _on_equip = function(obj, itemstack) + end, + _on_unequip = function(obj, itemstack) + end, + _on_break = function(obj) + end, +}) +``` + +## Interacting with Armor of an Entity + +Mods may want to interact with armor of an entity. + +Most global functions not described here may not be stable or may be for internal use only. + +You can equip a piece of armor on an entity inside a mod by using `mcl_armor.equip()`. + +```lua +--itemstack: an itemstack containing the armor piece to equip +--obj: the entity you want to equip the armor on +--swap: boolean, force equiping the armor piece, even if the entity already have one of the same type +mcl_armor.equip(itemstack, obj, swap) +``` + +You can update the entity apparence by using `mcl_armor.update()`. + +This function put the armor overlay on the object's base texture. +If the object is player it will update his displayed armor points count in HUD. + +This function will work both on players and mobs. + +```lua +--obj: the entity you want the apparence to be updated +mcl_armor.update(obj) +``` + +## Handling Enchantments + +Armors can be enchanted in most cases. + +The enchanting part of MineClone2 is separated from the armor part, but closely linked. + +Existing armor enchantments in Minecraft improve most of the time how the armor protect the entity from damage. + +The `mcl_armor.register_protection_enchantment()` function aims to simplificate the creation of such enchants. + +```lua +mcl_armor.register_protection_enchantment({ + --this field is the id that will be used for registering enchanted book and store the enchant inside armor metadata. + --(his internal name) + id = "magic_protection", + + --visible name of the enchant + --this field is used as the name of registered enchanted book and inside armor tooltip + --translation should be added + name = S("Magic Protection"), + + --this field is used to know that the enchant currently do + --translation should be added + description = S("Reduces magic damage."), + + --how many levels can the enchant have + --ex: 4 => I, II, III, IV + --default: 4 + max_level = 4, + + --which enchants this enchant will not be compatible with + --each of these values is a enchant id + incompatible = {blast_protection = true, fire_protection = true, projectile_protection = true}, + + --how much will the enchant consume from the enchantability group of the armor item + --default: 5 + weight = 5, + + --false => the enchant can be obtained in an enchanting table + --true => the enchant isn't obtainable in the enchanting table + --is true, you will probably need to implement some ways to obtain it + --even it the field is named "treasure", it will be no way to find it + --default: false + treasure = false, + + --how much will damage be reduced + --see Minecraft Wiki for more informations + --https://minecraft.gamepedia.com/Armor#Damage_protection + --https://minecraft.gamepedia.com/Armor#Enchantments + factor = 1, + + --restrict damage to one type + --allow the enchant to only protect of one type of damage + damage_type = "magic", + + --restrict damage to one category + --allow to protect from many type of damage at once + --this is much less specific than damage_type and also much more customisable + --the "is_magic" flag is used in the "magic", "dragon_breath", "wither_skull" and "thorns" damage types + --you can checkout the mcl_damage source code for a list of availlable damage types and associated flags + --but be warned that mods can register additionnal damage types + damage_flag = "is_magic", +}) +``` diff --git a/mods/ITEMS/mcl_armor/api.lua b/mods/ITEMS/mcl_armor/api.lua index 8e295827c..2fb56a02f 100644 --- a/mods/ITEMS/mcl_armor/api.lua +++ b/mods/ITEMS/mcl_armor/api.lua @@ -94,7 +94,6 @@ function mcl_armor.register_set(def) local on_unequip_callbacks = def.on_unequip_callbacks or {} local on_break_callbacks = def.on_break_callbacks or {} local textures = def.textures or {} - local previews = def.previews or {} local durabilities = def.durabilities or {} local element_groups = def.element_groups or {} @@ -134,8 +133,7 @@ function mcl_armor.register_set(def) _on_break = on_break_callbacks[name] or def.on_break, _mcl_armor_element = name, _mcl_armor_texture = textures[name] or modname .. "_" .. itemname .. ".png", - _mcl_armor_preview = previews[name] or modname .. "_" .. itemname .. "_preview.png", - _mcl_upgradable = def.upgradable, + _mcl_upgradable = def.upgradable }) if def.craft_material then @@ -222,17 +220,6 @@ function mcl_armor.update(obj) end end - local preview = def._mcl_armor_preview - - if obj:is_player() and preview then - if type(preview) == "function" then - preview = preview(obj, itemstack) - end - if preview then - info.preview = "(player.png^[opacity:0^" .. def._mcl_armor_preview .. ")" .. (info.preview and "^" .. info.preview or "" ) - end - end - info.points = info.points + minetest.get_item_group(itemname, "mcl_armor_points") local mob_range_mob = def._mcl_armor_mob_range_mob @@ -255,8 +242,6 @@ function mcl_armor.update(obj) info.texture = info.texture or "blank.png" if obj:is_player() then - info.preview = info.preview or "blank.png" - mcl_armor.update_player(obj, info) else local luaentity = obj:get_luaentity() diff --git a/mods/ITEMS/mcl_armor/locale/mcl_armor.fr.tr b/mods/ITEMS/mcl_armor/locale/mcl_armor.fr.tr index 6f55a73fe..1fe4f7f5f 100644 --- a/mods/ITEMS/mcl_armor/locale/mcl_armor.fr.tr +++ b/mods/ITEMS/mcl_armor/locale/mcl_armor.fr.tr @@ -6,18 +6,44 @@ Iron Helmet=Casque de Fer Golden Helmet=Casque d'Or Diamond Helmet=Casque de Diamant Chain Helmet=Casque de Mailles +Netherite Helmet=Casque de Netherite Leather Tunic=Tunique en Cuir Iron Chestplate=Plastron de Fer Golden Chestplate=Plastron d'Or Diamond Chestplate=Plastron de Diamant Chain Chestplate=Cotte de Mailles +Netherite Chestplate=Plastron de Netherite Leather Pants=Pantalon de Cuir Iron Leggings=Jambières de Fer Golden Leggings=Jambières d'Or Diamond Leggings=Jambières de Diamant Chain Leggings=Jambières de Mailles +Netherite Leggings=Jambières de Netherite Leather Boots=Bottes de Cuir Iron Boots=Bottes de Fer Golden Boots=Bottes d'Or Diamond Boots=Bottes de Diamant Chain Boots=Bottes de Mailles +Netherite Boots=Bottes de Netherite +Elytra=Élytres + +#Translations of enchantements +Increases underwater mining speed.=Augmente la vitesse de minage sous-marine. +Blast Protection=Protection contre les explosions +Reduces explosion damage and knockback.=Réduit les dégâts d'explosion et de recul. +Curse of Binding=Malédiction du lien éternel +Item cannot be removed from armor slots except due to death, breaking or in Creative Mode.=L'objet ne peut pas être retiré des emplacements d'armure sauf en cas de mort, de rupture ou en mode créatif. +Feather Falling=Chute amortie +Reduces fall damage.=Réduit les dégats de chute. +Fire Protection=Protection contre le feu +Reduces fire damage.=Reduit les dégats de feu. +Shooting consumes no regular arrows.=Le tir ne consomme pas de flèches standard. +Shoot 3 arrows at the cost of one.=Tirez sur 3 flèches au prix d'une. +Projectile Protection=Protection contre les projectiles +Reduces projectile damage.=Réduit les dommages causés par les projectiles. +Protection=Protection +Reduces most types of damage by 4% for each level.=Réduit la plupart des types de dégâts de 4% pour chaque niveau. +Thorns=Épines +Reflects some of the damage taken when hit, at the cost of reducing durability with each proc.=Reflète une partie des dégâts subis lors de la frappe, au prix d'une réduction de la durabilité à chaque déclenchement. +Aqua Affinity=Affinité aquatique + diff --git a/mods/ITEMS/mcl_armor/locale/template.txt b/mods/ITEMS/mcl_armor/locale/template.txt index 1500587ec..4b4ad8385 100644 --- a/mods/ITEMS/mcl_armor/locale/template.txt +++ b/mods/ITEMS/mcl_armor/locale/template.txt @@ -6,19 +6,43 @@ Iron Helmet= Golden Helmet= Diamond Helmet= Chain Helmet= +Netherite Helmet= Leather Tunic= Iron Chestplate= Golden Chestplate= Diamond Chestplate= Chain Chestplate= +Netherite Chestplate= Leather Pants= Iron Leggings= Golden Leggings= Diamond Leggings= Chain Leggings= +Netherite Leggings= Leather Boots= Iron Boots= Golden Boots= Diamond Boots= Chain Boots= +Netherite Boots= Elytra= + +#Translations of enchantements +Increases underwater mining speed.= +Blast Protection= +Reduces explosion damage and knockback.= +Curse of Binding=Malédiction du lien éternel +Item cannot be removed from armor slots except due to death, breaking or in Creative Mode.= +Feather Falling= +Reduces fall damage.= +Fire Protection= +Reduces fire damage.= +Shooting consumes no regular arrows.= +Shoot 3 arrows at the cost of one.= +Projectile Protection= +Reduces projectile damage.= +Protection= +Reduces most types of damage by 4% for each level.= +Thorns= +Reflects some of the damage taken when hit, at the cost of reducing durability with each proc.= +Aqua Affinity= \ No newline at end of file diff --git a/mods/ITEMS/mcl_armor/models/mcl_armor_character.b3d b/mods/ITEMS/mcl_armor/models/mcl_armor_character.b3d index b3a943f46..9c1b290a6 100644 Binary files a/mods/ITEMS/mcl_armor/models/mcl_armor_character.b3d and b/mods/ITEMS/mcl_armor/models/mcl_armor_character.b3d differ diff --git a/mods/ITEMS/mcl_armor/models/mcl_armor_character.blend b/mods/ITEMS/mcl_armor/models/mcl_armor_character.blend index a613eef89..b41b3c575 100644 Binary files a/mods/ITEMS/mcl_armor/models/mcl_armor_character.blend and b/mods/ITEMS/mcl_armor/models/mcl_armor_character.blend differ diff --git a/mods/ITEMS/mcl_armor/models/mcl_armor_character_female.b3d b/mods/ITEMS/mcl_armor/models/mcl_armor_character_female.b3d index 4e17ee341..15a131e94 100644 Binary files a/mods/ITEMS/mcl_armor/models/mcl_armor_character_female.b3d and b/mods/ITEMS/mcl_armor/models/mcl_armor_character_female.b3d differ diff --git a/mods/ITEMS/mcl_armor/models/mcl_armor_character_female.blend b/mods/ITEMS/mcl_armor/models/mcl_armor_character_female.blend index b0494efbf..8c16536b2 100644 Binary files a/mods/ITEMS/mcl_armor/models/mcl_armor_character_female.blend and b/mods/ITEMS/mcl_armor/models/mcl_armor_character_female.blend differ diff --git a/mods/ITEMS/mcl_armor/models/mcl_armor_character_female.blend1 b/mods/ITEMS/mcl_armor/models/mcl_armor_character_female.blend1 deleted file mode 100644 index 1a13f1c92..000000000 Binary files a/mods/ITEMS/mcl_armor/models/mcl_armor_character_female.blend1 and /dev/null differ diff --git a/mods/ITEMS/mcl_armor/player.lua b/mods/ITEMS/mcl_armor/player.lua index 48fdb381f..99e23efdd 100644 --- a/mods/ITEMS/mcl_armor/player.lua +++ b/mods/ITEMS/mcl_armor/player.lua @@ -63,7 +63,7 @@ mcl_player.player_register_model("mcl_armor_character_female.b3d", { }) function mcl_armor.update_player(player, info) - mcl_player.player_set_armor(player, info.texture, info.preview) + mcl_player.player_set_armor(player, info.texture) local meta = player:get_meta() meta:set_int("mcl_armor:armor_points", info.points) diff --git a/mods/ITEMS/mcl_armor/register.lua b/mods/ITEMS/mcl_armor/register.lua index 6f89200b1..4e5c20ee6 100644 --- a/mods/ITEMS/mcl_armor/register.lua +++ b/mods/ITEMS/mcl_armor/register.lua @@ -209,11 +209,12 @@ minetest.register_tool("mcl_armor:elytra", { _doc_items_longdesc = mcl_armor.longdesc, _doc_items_usagehelp = mcl_armor.usage, inventory_image = "mcl_armor_inv_elytra.png", - groups = {armor = 1, non_combat_armor = 1, armor_torso = 1, non_combat_torso = 1, mcl_armor_uses = 10, enchantability = 1}, + groups = {armor = 1, non_combat_torso = 1, armor_torso = 1, mcl_armor_uses = 10, enchantability = 1}, sounds = { _mcl_armor_equip = "mcl_armor_equip_leather", _mcl_armor_unequip = "mcl_armor_unequip_leather", }, + _repair_material = "mcl_mobitems:leather", on_place = mcl_armor.equip_on_use, on_secondary_use = mcl_armor.equip_on_use, _mcl_armor_element = "torso", diff --git a/mods/ITEMS/mcl_armor/textures/mcl_armor_boots_chain_preview.png b/mods/ITEMS/mcl_armor/textures/mcl_armor_boots_chain_preview.png deleted file mode 100644 index bf028c272..000000000 Binary files a/mods/ITEMS/mcl_armor/textures/mcl_armor_boots_chain_preview.png and /dev/null differ diff --git a/mods/ITEMS/mcl_armor/textures/mcl_armor_boots_diamond_preview.png b/mods/ITEMS/mcl_armor/textures/mcl_armor_boots_diamond_preview.png deleted file mode 100644 index 768d7bcde..000000000 Binary files a/mods/ITEMS/mcl_armor/textures/mcl_armor_boots_diamond_preview.png and /dev/null differ diff --git a/mods/ITEMS/mcl_armor/textures/mcl_armor_boots_gold_preview.png b/mods/ITEMS/mcl_armor/textures/mcl_armor_boots_gold_preview.png deleted file mode 100644 index f384a602c..000000000 Binary files a/mods/ITEMS/mcl_armor/textures/mcl_armor_boots_gold_preview.png and /dev/null differ diff --git a/mods/ITEMS/mcl_armor/textures/mcl_armor_boots_iron_preview.png b/mods/ITEMS/mcl_armor/textures/mcl_armor_boots_iron_preview.png deleted file mode 100644 index 18cecdf55..000000000 Binary files a/mods/ITEMS/mcl_armor/textures/mcl_armor_boots_iron_preview.png and /dev/null differ diff --git a/mods/ITEMS/mcl_armor/textures/mcl_armor_boots_leather_preview.png b/mods/ITEMS/mcl_armor/textures/mcl_armor_boots_leather_preview.png deleted file mode 100644 index d0457ce9a..000000000 Binary files a/mods/ITEMS/mcl_armor/textures/mcl_armor_boots_leather_preview.png and /dev/null differ diff --git a/mods/ITEMS/mcl_armor/textures/mcl_armor_chestplate_chain_preview.png b/mods/ITEMS/mcl_armor/textures/mcl_armor_chestplate_chain_preview.png deleted file mode 100644 index af9c982fe..000000000 Binary files a/mods/ITEMS/mcl_armor/textures/mcl_armor_chestplate_chain_preview.png and /dev/null differ diff --git a/mods/ITEMS/mcl_armor/textures/mcl_armor_chestplate_diamond_preview.png b/mods/ITEMS/mcl_armor/textures/mcl_armor_chestplate_diamond_preview.png deleted file mode 100644 index d43b3cede..000000000 Binary files a/mods/ITEMS/mcl_armor/textures/mcl_armor_chestplate_diamond_preview.png and /dev/null differ diff --git a/mods/ITEMS/mcl_armor/textures/mcl_armor_chestplate_gold_preview.png b/mods/ITEMS/mcl_armor/textures/mcl_armor_chestplate_gold_preview.png deleted file mode 100644 index 746ddda0a..000000000 Binary files a/mods/ITEMS/mcl_armor/textures/mcl_armor_chestplate_gold_preview.png and /dev/null differ diff --git a/mods/ITEMS/mcl_armor/textures/mcl_armor_chestplate_iron_preview.png b/mods/ITEMS/mcl_armor/textures/mcl_armor_chestplate_iron_preview.png deleted file mode 100644 index 200e51d9c..000000000 Binary files a/mods/ITEMS/mcl_armor/textures/mcl_armor_chestplate_iron_preview.png and /dev/null differ diff --git a/mods/ITEMS/mcl_armor/textures/mcl_armor_chestplate_leather_preview.png b/mods/ITEMS/mcl_armor/textures/mcl_armor_chestplate_leather_preview.png deleted file mode 100644 index 9d5a5a097..000000000 Binary files a/mods/ITEMS/mcl_armor/textures/mcl_armor_chestplate_leather_preview.png and /dev/null differ diff --git a/mods/ITEMS/mcl_armor/textures/mcl_armor_helmet_chain_preview.png b/mods/ITEMS/mcl_armor/textures/mcl_armor_helmet_chain_preview.png deleted file mode 100644 index c76cd9d61..000000000 Binary files a/mods/ITEMS/mcl_armor/textures/mcl_armor_helmet_chain_preview.png and /dev/null differ diff --git a/mods/ITEMS/mcl_armor/textures/mcl_armor_helmet_diamond_preview.png b/mods/ITEMS/mcl_armor/textures/mcl_armor_helmet_diamond_preview.png deleted file mode 100644 index 1b8c5b117..000000000 Binary files a/mods/ITEMS/mcl_armor/textures/mcl_armor_helmet_diamond_preview.png and /dev/null differ diff --git a/mods/ITEMS/mcl_armor/textures/mcl_armor_helmet_gold_preview.png b/mods/ITEMS/mcl_armor/textures/mcl_armor_helmet_gold_preview.png deleted file mode 100644 index 4201916ca..000000000 Binary files a/mods/ITEMS/mcl_armor/textures/mcl_armor_helmet_gold_preview.png and /dev/null differ diff --git a/mods/ITEMS/mcl_armor/textures/mcl_armor_helmet_iron_preview.png b/mods/ITEMS/mcl_armor/textures/mcl_armor_helmet_iron_preview.png deleted file mode 100644 index 00584e8de..000000000 Binary files a/mods/ITEMS/mcl_armor/textures/mcl_armor_helmet_iron_preview.png and /dev/null differ diff --git a/mods/ITEMS/mcl_armor/textures/mcl_armor_helmet_leather_preview.png b/mods/ITEMS/mcl_armor/textures/mcl_armor_helmet_leather_preview.png deleted file mode 100644 index 9f27bacb5..000000000 Binary files a/mods/ITEMS/mcl_armor/textures/mcl_armor_helmet_leather_preview.png and /dev/null differ diff --git a/mods/ITEMS/mcl_armor/textures/mcl_armor_leggings_chain_preview.png b/mods/ITEMS/mcl_armor/textures/mcl_armor_leggings_chain_preview.png deleted file mode 100644 index 06a29c3c7..000000000 Binary files a/mods/ITEMS/mcl_armor/textures/mcl_armor_leggings_chain_preview.png and /dev/null differ diff --git a/mods/ITEMS/mcl_armor/textures/mcl_armor_leggings_diamond_preview.png b/mods/ITEMS/mcl_armor/textures/mcl_armor_leggings_diamond_preview.png deleted file mode 100644 index cbc9e032c..000000000 Binary files a/mods/ITEMS/mcl_armor/textures/mcl_armor_leggings_diamond_preview.png and /dev/null differ diff --git a/mods/ITEMS/mcl_armor/textures/mcl_armor_leggings_gold_preview.png b/mods/ITEMS/mcl_armor/textures/mcl_armor_leggings_gold_preview.png deleted file mode 100644 index 449eb5e1a..000000000 Binary files a/mods/ITEMS/mcl_armor/textures/mcl_armor_leggings_gold_preview.png and /dev/null differ diff --git a/mods/ITEMS/mcl_armor/textures/mcl_armor_leggings_iron_preview.png b/mods/ITEMS/mcl_armor/textures/mcl_armor_leggings_iron_preview.png deleted file mode 100644 index 452447fd7..000000000 Binary files a/mods/ITEMS/mcl_armor/textures/mcl_armor_leggings_iron_preview.png and /dev/null differ diff --git a/mods/ITEMS/mcl_armor/textures/mcl_armor_leggings_leather_preview.png b/mods/ITEMS/mcl_armor/textures/mcl_armor_leggings_leather_preview.png deleted file mode 100644 index 6c032d690..000000000 Binary files a/mods/ITEMS/mcl_armor/textures/mcl_armor_leggings_leather_preview.png and /dev/null differ diff --git a/mods/ITEMS/mcl_banners/locale/mcl_banners.fr.tr b/mods/ITEMS/mcl_banners/locale/mcl_banners.fr.tr index fbfd935a5..3823aae9d 100644 --- a/mods/ITEMS/mcl_banners/locale/mcl_banners.fr.tr +++ b/mods/ITEMS/mcl_banners/locale/mcl_banners.fr.tr @@ -75,3 +75,4 @@ You can copy the pattern of a banner by placing two banners of the same color in And one additional layer=Et une couche supplémentaire And @1 additional layers=Et @1 couches supplémentaires Paintable decoration=Décoration à peindre +Preview Banner= Aperçu de la Bannière \ No newline at end of file diff --git a/mods/ITEMS/mcl_beds/functions.lua b/mods/ITEMS/mcl_beds/functions.lua index b8478fc1f..820c3c4d0 100644 --- a/mods/ITEMS/mcl_beds/functions.lua +++ b/mods/ITEMS/mcl_beds/functions.lua @@ -76,6 +76,7 @@ local function lay_down(player, pos, bed_pos, state, skip) -- save respawn position when entering bed if spawn_mod and mcl_spawn.set_spawn_pos(player, bed_pos, nil) then minetest.chat_send_player(name, S("New respawn position set!")) + awards.unlock(player:get_player_name(), "mcl:sweetDreams") end -- No sleeping if too far away diff --git a/mods/ITEMS/mcl_beds/init.lua b/mods/ITEMS/mcl_beds/init.lua index ad9dbdded..b07b591dd 100644 --- a/mods/ITEMS/mcl_beds/init.lua +++ b/mods/ITEMS/mcl_beds/init.lua @@ -4,6 +4,7 @@ mcl_beds.pos = {} mcl_beds.bed_pos = {} local modpath = minetest.get_modpath("mcl_beds") +local S = minetest.get_translator(minetest.get_current_modname()) -- Load files diff --git a/mods/ITEMS/mcl_beds/locale/mcl_beds.fr.tr b/mods/ITEMS/mcl_beds/locale/mcl_beds.fr.tr index d85d48bf1..6f369dacd 100644 --- a/mods/ITEMS/mcl_beds/locale/mcl_beds.fr.tr +++ b/mods/ITEMS/mcl_beds/locale/mcl_beds.fr.tr @@ -37,5 +37,7 @@ Players in bed: @1/@2=Joueurs au lit: @1/@2 Note: Night skip is disabled.=Remarque: Le saut de nuit est désactivé. You're sleeping.=Tu dors. You will fall asleep when all players are in bed.=Vous vous endormirez lorsque tous les joueurs seront au lit. +You will fall asleep when @1% of all players are in bed.=Vous vous endormirez lorsque @1% des joueurs seront au lit. You're in bed.=Tu es au lit. Allows you to sleep=Vous permet de dormir +Respawn Anchor=Ancre de Réapparition \ No newline at end of file diff --git a/mods/ITEMS/mcl_beds/locale/template.txt b/mods/ITEMS/mcl_beds/locale/template.txt index 5525bd91b..69c493880 100644 --- a/mods/ITEMS/mcl_beds/locale/template.txt +++ b/mods/ITEMS/mcl_beds/locale/template.txt @@ -40,3 +40,4 @@ You will fall asleep when all players are in bed.= You will fall asleep when @1% of all players are in bed.= You're in bed.= Allows you to sleep= +Respawn Anchor= diff --git a/mods/ITEMS/mcl_beds/respawn_anchor.lua b/mods/ITEMS/mcl_beds/respawn_anchor.lua index 0e96ce25d..19c2c67d9 100644 --- a/mods/ITEMS/mcl_beds/respawn_anchor.lua +++ b/mods/ITEMS/mcl_beds/respawn_anchor.lua @@ -2,17 +2,18 @@ --Nether ends at y -29077 --Nether roof at y -28933 - +local S = minetest.get_translator(minetest.get_current_modname()) +--local mod_doc = minetest.get_modpath("doc") -> maybe add documentation ? minetest.register_node("mcl_beds:respawn_anchor",{ - description="respawn anchor", - tiles = { + description=S("Respawn Anchor"), + tiles = { "respawn_anchor_top_off.png", "respawn_anchor_bottom.png", "respawn_anchor_side0.png" }, - drawtype = "nodebox", - node_box= { --Reused the composter nodebox, since it is basicly the same + drawtype = "nodebox", + node_box= { --Reused the composter nodebox, since it is basicly the same type = "fixed", fixed = { {-0.5, -0.5, -0.5, -0.375, 0.5, 0.5}, -- Left wall @@ -22,28 +23,28 @@ minetest.register_node("mcl_beds:respawn_anchor",{ {-0.5, -0.5, -0.5, 0.5, -0.47, 0.5}, -- Bottom level, -0.47 because -0.5 is so low that you can see the texture of the block below through } }, - on_rightclick = function(pos, node, player, itemstack) - if itemstack.get_name(itemstack) == "mcl_nether:glowstone" then - minetest.set_node(pos, {name="mcl_beds:respawn_anchor_charged_1"}) - itemstack:take_item() - else - if pos.y < -29077 or pos.y > -28933 then - mcl_explosions.explode(pos, 5, {drop_chance = 0, fire = true}) - end - end + on_rightclick = function(pos, node, player, itemstack) + if itemstack.get_name(itemstack) == "mcl_nether:glowstone" then + minetest.set_node(pos, {name="mcl_beds:respawn_anchor_charged_1"}) + itemstack:take_item() + else + if pos.y < -29077 or pos.y > -28933 then + mcl_explosions.explode(pos, 5, {drop_chance = 0, fire = true}) + end + end end, - groups = {pickaxey=1, material_stone=1}, - _mcl_hardness = 22.5 + groups = {pickaxey=1, material_stone=1}, + _mcl_hardness = 22.5 }) minetest.register_node("mcl_beds:respawn_anchor_charged_1",{ - description="respawn anchor", - tiles = { + description=S("Respawn Anchor"), + tiles = { "portal.png", "respawn_anchor_bottom.png", "respawn_anchor_side1.png" }, - drawtype = "nodebox", - node_box= { --Reused the composter nodebox, since it is basicly the same + drawtype = "nodebox", + node_box= { --Reused the composter nodebox, since it is basicly the same type = "fixed", fixed = { {-0.5, -0.5, -0.5, -0.375, 0.5, 0.5}, -- Left wall @@ -53,31 +54,31 @@ minetest.register_node("mcl_beds:respawn_anchor_charged_1",{ {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, -- Bottom level } }, - on_rightclick = function(pos, node, player, itemstack) - if itemstack.get_name(itemstack) == "mcl_nether:glowstone" then - minetest.set_node(pos, {name="mcl_beds:respawn_anchor_charged_2"}) - itemstack:take_item() - else - if pos.y < -29077 or pos.y > -28933 then - mcl_explosions.explode(pos, 5, {drop_chance = 0, fire = true}) - else - mcl_spawn.set_spawn_pos(player, pos, nil) - end - end - end, - groups = {pickaxey=1, material_stone=1, not_in_creative_inventory=1}, - _mcl_hardness = 22.5 + on_rightclick = function(pos, node, player, itemstack) + if itemstack.get_name(itemstack) == "mcl_nether:glowstone" then + minetest.set_node(pos, {name="mcl_beds:respawn_anchor_charged_2"}) + itemstack:take_item() + else + if pos.y < -29077 or pos.y > -28933 then + mcl_explosions.explode(pos, 5, {drop_chance = 0, fire = true}) + else + mcl_spawn.set_spawn_pos(player, pos, nil) + end + end + end, + groups = {pickaxey=1, material_stone=1, not_in_creative_inventory=1}, + _mcl_hardness = 22.5 }) minetest.register_node("mcl_beds:respawn_anchor_charged_2",{ - description="respawn anchor", - tiles = { + description=S("Respawn Anchor"), + tiles = { "portal.png", "respawn_anchor_bottom.png", "respawn_anchor_side2.png" }, - drawtype = "nodebox", - node_box= { --Reused the composter nodebox, since it is basicly the same + drawtype = "nodebox", + node_box= { --Reused the composter nodebox, since it is basicly the same type = "fixed", fixed = { {-0.5, -0.5, -0.5, -0.375, 0.5, 0.5}, -- Left wall @@ -87,31 +88,31 @@ minetest.register_node("mcl_beds:respawn_anchor_charged_2",{ {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, -- Bottom level } }, - on_rightclick = function(pos, node, player, itemstack) - if itemstack.get_name(itemstack) == "mcl_nether:glowstone" then - minetest.set_node(pos, {name="mcl_beds:respawn_anchor_charged_3"}) - itemstack:take_item() - else - if pos.y < -29077 or pos.y > -28933 then - mcl_explosions.explode(pos, 5, {drop_chance = 0, fire = true}) - else - mcl_spawn.set_spawn_pos(player, pos, nil) - end - end - end, - groups = {pickaxey=1, material_stone=1, not_in_creative_inventory=1}, - _mcl_hardness = 22.5 + on_rightclick = function(pos, node, player, itemstack) + if itemstack.get_name(itemstack) == "mcl_nether:glowstone" then + minetest.set_node(pos, {name="mcl_beds:respawn_anchor_charged_3"}) + itemstack:take_item() + else + if pos.y < -29077 or pos.y > -28933 then + mcl_explosions.explode(pos, 5, {drop_chance = 0, fire = true}) + else + mcl_spawn.set_spawn_pos(player, pos, nil) + end + end + end, + groups = {pickaxey=1, material_stone=1, not_in_creative_inventory=1}, + _mcl_hardness = 22.5 }) minetest.register_node("mcl_beds:respawn_anchor_charged_3",{ - description="respawn anchor", - tiles = { + description=S("Respawn Anchor"), + tiles = { "portal.png", "respawn_anchor_bottom.png", "respawn_anchor_side3.png" }, - drawtype = "nodebox", - node_box= { --Reused the composter nodebox, since it is basicly the same + drawtype = "nodebox", + node_box= { --Reused the composter nodebox, since it is basicly the same type = "fixed", fixed = { {-0.5, -0.5, -0.5, -0.375, 0.5, 0.5}, -- Left wall @@ -121,52 +122,56 @@ minetest.register_node("mcl_beds:respawn_anchor_charged_3",{ {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, -- Bottom level } }, - on_rightclick = function(pos, node, player, itemstack) - if itemstack.get_name(itemstack) == "mcl_nether:glowstone" then - minetest.set_node(pos, {name="mcl_beds:respawn_anchor_charged_4"}) - itemstack:take_item() - else - if pos.y < -29077 or pos.y > -28933 then - mcl_explosions.explode(pos, 5, {drop_chance = 0, fire = true}) - else - mcl_spawn.set_spawn_pos(player, pos, nil) - end - end - end, - groups = {pickaxey=1, material_stone=1, not_in_creative_inventory=1}, - _mcl_hardness = 22.5 + on_rightclick = function(pos, node, player, itemstack) + if itemstack.get_name(itemstack) == "mcl_nether:glowstone" then + minetest.set_node(pos, {name="mcl_beds:respawn_anchor_charged_4"}) + itemstack:take_item() + else + if pos.y < -29077 or pos.y > -28933 then + mcl_explosions.explode(pos, 5, {drop_chance = 0, fire = true}) + else + mcl_spawn.set_spawn_pos(player, pos, nil) + end + end + end, + groups = {pickaxey=1, material_stone=1, not_in_creative_inventory=1}, + _mcl_hardness = 22.5 }) minetest.register_node("mcl_beds:respawn_anchor_charged_4",{ - description="respawn anchor", - tiles = { + description=S("Respawn Anchor"), + tiles = { "portal.png", "respawn_anchor_bottom.png", "respawn_anchor_side4.png" }, - drawtype = "nodebox", - node_box= { --Reused the composter nodebox, since it is basicly the same + drawtype = "nodebox", + node_box= { --Reused the composter nodebox, since it is basicly the same type = "fixed", fixed = { - {-0.5, -0.5, -0.5, -0.375, 0.5, 0.5}, -- Left wall + {-0.5, -0.5, -0.5, -0.375, 0.5, 0.5}, -- Left wall { 0.375, -0.5, -0.5, 0.5, 0.5, 0.5}, -- Right wall {-0.375, -0.5, 0.375, 0.375, 0.5, 0.5}, -- Back wall {-0.375, -0.5, -0.5, 0.375, 0.5, -0.375}, -- Front wall {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, -- Bottom level } }, - on_rightclick = function(pos, node, player, itemstack) - if pos.y < -29077 or pos.y > -28933 then - mcl_explosions.explode(pos, 5, {drop_chance = 0, fire = true}) - else - mcl_spawn.set_spawn_pos(player, pos, nil) - end - end, - groups = {pickaxey=1, material_stone=1, not_in_creative_inventory=1}, - _mcl_hardness = 22.5 + on_rightclick = function(pos, node, player, itemstack) + if pos.y < -29077 or pos.y > -28933 then + mcl_explosions.explode(pos, 5, {drop_chance = 0, fire = true}) + else + mcl_spawn.set_spawn_pos(player, pos, nil) + awards.unlock(player:get_player_name(), "mcl:notQuiteNineLives") + end + end, + groups = {pickaxey=1, material_stone=1, not_in_creative_inventory=1}, + _mcl_hardness = 22.5 }) minetest.register_craft({ output = "mcl_beds:respawn_anchor", - recipe = { {"mcl_core:crying_obsidian", "mcl_core:crying_obsidian", "mcl_core:crying_obsidian"}, - {"mcl_nether:glowstone", "mcl_nether:glowstone", "mcl_nether:glowstone"}, - {"mcl_core:crying_obsidian", "mcl_core:crying_obsidian", "mcl_core:crying_obsidian"} } }) \ No newline at end of file + recipe = { + {"mcl_core:crying_obsidian", "mcl_core:crying_obsidian", "mcl_core:crying_obsidian"}, + {"mcl_nether:glowstone", "mcl_nether:glowstone", "mcl_nether:glowstone"}, + {"mcl_core:crying_obsidian", "mcl_core:crying_obsidian", "mcl_core:crying_obsidian"} + } + }) diff --git a/mods/ITEMS/mcl_blackstone/init.lua b/mods/ITEMS/mcl_blackstone/init.lua index e1592d72c..163c43cf2 100644 --- a/mods/ITEMS/mcl_blackstone/init.lua +++ b/mods/ITEMS/mcl_blackstone/init.lua @@ -4,36 +4,11 @@ local LIGHT_TORCH = 10 stairs = {} -local fire_enabled = minetest.settings:get_bool("enable_fire", true) - -local fire_help, eternal_fire_help -if fire_enabled then - fire_help = S("Fire is a damaging and destructive but short-lived kind of block. It will destroy and spread towards near flammable blocks, but fire will disappear when there is nothing to burn left. It will be extinguished by nearby water and rain. Fire can be destroyed safely by punching it, but it is hurtful if you stand directly in it. If a fire is started above netherrack or a magma block, it will immediately turn into an eternal fire.") -else - fire_help = S("Fire is a damaging but non-destructive short-lived kind of block. It will disappear when there is no flammable block around. Fire does not destroy blocks, at least not in this world. It will be extinguished by nearby water and rain. Fire can be destroyed safely by punching it, but it is hurtful if you stand directly in it. If a fire is started above netherrack or a magma block, it will immediately turn into an eternal fire.") -end - -if fire_enabled then - eternal_fire_help = S("Eternal fire is a damaging block that might create more fire. It will create fire around it when flammable blocks are nearby. Eternal fire can be extinguished by punches and nearby water blocks. Other than (normal) fire, eternal fire does not get extinguished on its own and also continues to burn under rain. Punching eternal fire is safe, but it hurts if you stand inside.") -else - eternal_fire_help = S("Eternal fire is a damaging block. Eternal fire can be extinguished by punches and nearby water blocks. Other than (normal) fire, eternal fire does not get extinguished on its own and also continues to burn under rain. Punching eternal fire is safe, but it hurts if you stand inside.") -end - - -local fire_death_messages = { - N("@1 has been cooked crisp."), - N("@1 felt the burn."), - N("@1 died in the flames."), - N("@1 died in a fire."), -} --nodes - - - local mod_screwdriver = minetest.get_modpath("screwdriver") ~= nil local on_rotate if mod_screwdriver then @@ -194,7 +169,7 @@ minetest.register_node("mcl_blackstone:soul_soil", { minetest.register_node("mcl_blackstone:soul_fire", { description = S("Eternal Soul Fire"), - _doc_items_longdesc = eternal_fire_help, + _doc_items_longdesc = minetest.registered_nodes["mcl_fire:eternal_fire"]._doc_items_longdesc , drawtype = "firelike", tiles = { { @@ -213,8 +188,8 @@ minetest.register_node("mcl_blackstone:soul_fire", { walkable = false, buildable_to = true, sunlight_propagates = true, - damage_per_second = 2, - _mcl_node_death_message = fire_death_messages, + damage_per_second = 1, + _mcl_node_death_message = minetest.registered_nodes["mcl_fire:fire"]._mcl_node_death_message, groups = {fire = 1, dig_immediate = 3, not_in_creative_inventory = 1, dig_by_piston = 1, destroys_items = 1, set_on_fire=8}, floodable = true, on_flood = function(pos, oldnode, newnode) @@ -222,7 +197,25 @@ minetest.register_node("mcl_blackstone:soul_fire", { minetest.sound_play("fire_extinguish_flame", {pos = pos, gain = 0.25, max_hear_distance = 16}, true) end end, + on_construct=function(pos) + local under = minetest.get_node(vector.offset(pos,0,-1,0)).name + if under ~= "mcl_nether:soul_sand" and under ~= "mcl_blackstone:soul_soil" then + minetest.swap_node(pos, {name = "air"}) + end + end, + drop="", + _mcl_blast_resistance = 0, }) + +local old_onconstruct=minetest.registered_nodes["mcl_fire:fire"].on_construct +minetest.registered_nodes["mcl_fire:fire"].on_construct=function(pos) + local under = minetest.get_node(vector.offset(pos,0,-1,0)).name + if under == "mcl_nether:soul_sand" or under == "mcl_blackstone:soul_soil" then + minetest.swap_node(pos, {name = "mcl_blackstone:soul_fire"}) + end + old_onconstruct(pos) +end + --[[ minetest.register_node("mcl_blackstone:chain", { description = S("Chain"), @@ -252,16 +245,16 @@ minetest.register_node("mcl_blackstone:chain", { --slabs/stairs -mcl_stairs.register_stair_and_slab_simple("blackstone", "mcl_blackstone:blackstone", "Blackstone Stair", "Blackstone Slab", "Double Blackstone Slab") +mcl_stairs.register_stair_and_slab_simple("blackstone", "mcl_blackstone:blackstone", S("Blackstone Stair"), S("Blackstone Slab"), S("Double Blackstone Slab")) -mcl_stairs.register_stair_and_slab_simple("blackstone_polished", "mcl_blackstone:blackstone_polished", "Polished Blackstone Stair", "Polished Blackstone Slab", "Polished Double Blackstone Slab") +mcl_stairs.register_stair_and_slab_simple("blackstone_polished", "mcl_blackstone:blackstone_polished", S("Polished Blackstone Stair"), S("Polished Blackstone Slab"), S("Polished Double Blackstone Slab")) -mcl_stairs.register_stair_and_slab_simple("blackstone_chiseled_polished", "mcl_blackstone:blackstone_chiseled_polished", "Polished Chiseled Blackstone Stair", "Chiseled Polished Blackstone Slab", "Double Polished Chiseled Blackstone Slab") +mcl_stairs.register_stair_and_slab_simple("blackstone_chiseled_polished", "mcl_blackstone:blackstone_chiseled_polished", S("Polished Chiseled Blackstone Stair"), S("Chiseled Polished Blackstone Slab"), S("Double Polished Chiseled Blackstone Slab")) -mcl_stairs.register_stair_and_slab_simple("blackstone_brick_polished", "mcl_blackstone:blackstone_brick_polished", "Polished Blackstone Brick Stair", "Polished Blackstone Brick Slab", "Double Polished Blackstone Brick Slab") +mcl_stairs.register_stair_and_slab_simple("blackstone_brick_polished", "mcl_blackstone:blackstone_brick_polished", S("Polished Blackstone Brick Stair"), S("Polished Blackstone Brick Slab"), S("Double Polished Blackstone Brick Slab")) --Wall @@ -823,4 +816,4 @@ minetest.register_craft({ { "mcl_nether:soul_sand" }, { "mcl_core:stick" }, } -}) \ No newline at end of file +}) diff --git a/mods/ITEMS/mcl_blackstone/locale/mcl_blackstone.fr.tr b/mods/ITEMS/mcl_blackstone/locale/mcl_blackstone.fr.tr index 2f70e45c8..beaa543ca 100644 --- a/mods/ITEMS/mcl_blackstone/locale/mcl_blackstone.fr.tr +++ b/mods/ITEMS/mcl_blackstone/locale/mcl_blackstone.fr.tr @@ -1,18 +1,18 @@ # textdomain: mcl_blackstone Blackstone=Roche noire Polished Blackstone=Pierre noire -Chieseled Polished Blackstone=Pierre noire sculptée +Chiseled Polished Blackstone=Pierre noire sculptée Polished Blackstone Bricks=Briques de pierre noire Basalt=Basalte Polished Basalt=Basalte taillé Blackstone Slab=Dalle de roche noire Polished Blackstone Slab=Dalle de pierre noire -Chieseled Polished Blackstone Slab=Dalle de pierre noire sculptée +Chiseled Polished Blackstone Slab=Dalle de pierre noire sculptée Polished Blackstone Brick Slab=Dalle de briques de pierre noire -Blackstone Stairs=Escalier de roche noire -Polished Blackstone Stairs=Escalier de pierre noire -Chieseled Polished Blackstone Stairs=Escalier de pierre noire sculptée -Polished Blackstone Brick Stairs=Escalier de briques de pierre noire +Blackstone Stair=Escalier de roche noire +Polished Blackstone Stair=Escalier de pierre noire +Chiseled Polished Blackstone Stair=Escalier de pierre noire sculptée +Polished Blackstone Brick Stair=Escalier de briques de pierre noire Quartz Bricks=Briques de quartz Soul Torch=Torche des âmes Soul Lantern=Lanterne des âmes @@ -21,3 +21,8 @@ Eternal Soul Fire=Feux éternel des âmes Gilded Blackstone=Roche noire dorée Nether Gold Ore=Minerai d'or du Nether Smooth Basalt=Basalte lisse +Blackstone Wall=Muret de Roche noire +Double Blackstone Slab=Double dalle de roche noire +Polished Double Blackstone Slab=Double dalle de pierre noire +Double Polished Chiseled Blackstone Slab=Double dalle de pierre noire sculptée +Double Polished Blackstone Brick Slab=Double dalle de briques de pierre noire \ No newline at end of file diff --git a/mods/ITEMS/mcl_blackstone/locale/template.txt b/mods/ITEMS/mcl_blackstone/locale/template.txt index ec7e561ba..025fb471c 100644 --- a/mods/ITEMS/mcl_blackstone/locale/template.txt +++ b/mods/ITEMS/mcl_blackstone/locale/template.txt @@ -7,12 +7,12 @@ Basalt= Polished Basalt= Blackstone Slab= Polished Blackstone Slab= -Chieseled Polished Blackstone Slab= +Chiseled Polished Blackstone Slab= Polished Blackstone Brick Slab= -Blackstone Stairs= -Polished Blackstone Stairs= -Chieseled Polished Blackstone Stairs= -Polished Blackstone Brick Stairs= +Blackstone Stair= +Polished Blackstone Stair= +Chiseled Polished Blackstone Stair= +Polished Blackstone Brick Stair= Quartz Bricks= Soul Torch= Soul Lantern= @@ -22,3 +22,7 @@ Gilded Blackstone= Nether Gold Ore= Smooth Basalt= Blackstone Wall= +Double Blackstone Slab= +Polished Double Blackstone Slab= +Double Polished Chiseled Blackstone Slab= +Double Polished Blackstone Brick Slab= \ No newline at end of file diff --git a/mods/ITEMS/mcl_blackstone/mod.conf b/mods/ITEMS/mcl_blackstone/mod.conf index 99c247024..a46b4b35d 100644 --- a/mods/ITEMS/mcl_blackstone/mod.conf +++ b/mods/ITEMS/mcl_blackstone/mod.conf @@ -1,2 +1,2 @@ name = mcl_blackstone -depends = mcl_core,screwdriver,mcl_stairs,mclx_stairs,mcl_walls,mclx_fences,mcl_torches \ No newline at end of file +depends = mcl_core,screwdriver,mcl_stairs,mclx_stairs,mcl_walls,mclx_fences,mcl_torches, mcl_fire diff --git a/mods/ITEMS/mcl_blackstone/schematics/mcl_blackstone_nether_fossil_1.mts b/mods/ITEMS/mcl_blackstone/schematics/mcl_blackstone_nether_fossil_1.mts new file mode 100644 index 000000000..7ec39bacf Binary files /dev/null and b/mods/ITEMS/mcl_blackstone/schematics/mcl_blackstone_nether_fossil_1.mts differ diff --git a/mods/ITEMS/mcl_blackstone/schematics/mcl_blackstone_nether_fossil_2.mts b/mods/ITEMS/mcl_blackstone/schematics/mcl_blackstone_nether_fossil_2.mts new file mode 100644 index 000000000..bafc88993 Binary files /dev/null and b/mods/ITEMS/mcl_blackstone/schematics/mcl_blackstone_nether_fossil_2.mts differ diff --git a/mods/ITEMS/mcl_blackstone/schematics/mcl_blackstone_nether_fossil_3.mts b/mods/ITEMS/mcl_blackstone/schematics/mcl_blackstone_nether_fossil_3.mts new file mode 100644 index 000000000..39809dda9 Binary files /dev/null and b/mods/ITEMS/mcl_blackstone/schematics/mcl_blackstone_nether_fossil_3.mts differ diff --git a/mods/ITEMS/mcl_blackstone/schematics/mcl_blackstone_nether_fossil_4.mts b/mods/ITEMS/mcl_blackstone/schematics/mcl_blackstone_nether_fossil_4.mts new file mode 100644 index 000000000..2acfefe70 Binary files /dev/null and b/mods/ITEMS/mcl_blackstone/schematics/mcl_blackstone_nether_fossil_4.mts differ diff --git a/mods/ITEMS/mcl_blast_furnace/README.md b/mods/ITEMS/mcl_blast_furnace/README.md new file mode 100644 index 000000000..38b415670 --- /dev/null +++ b/mods/ITEMS/mcl_blast_furnace/README.md @@ -0,0 +1,13 @@ +Blast Furnaces for MineClone 5. +Heavily based on Minetest Game (default/furnace.lua) and the MineClone 5 Furnaces. + +License of source code +---------------------- +LGPLv2.1 +Based on code from Minetest Game. +Modified by Wuzzy. +MCl 2 Furances modified by PrairieWind. + +License of media +---------------- +See the main MineClone 5 README.md file. diff --git a/mods/ITEMS/mcl_furnaces/blast_furnace.lua b/mods/ITEMS/mcl_blast_furnace/init.lua similarity index 89% rename from mods/ITEMS/mcl_furnaces/blast_furnace.lua rename to mods/ITEMS/mcl_blast_furnace/init.lua index 4e14d9305..a23a211d9 100644 --- a/mods/ITEMS/mcl_furnaces/blast_furnace.lua +++ b/mods/ITEMS/mcl_blast_furnace/init.lua @@ -198,7 +198,7 @@ local function swap_node(pos, name) end node.name = name minetest.swap_node(pos, node) - if name == "mcl_furnaces:blast_furnace_active" then + if name == "mcl_blast_furnace:blast_furnace_active" then spawn_flames(pos, node.param2) else mcl_particles.delete_node_particlespawners(pos) @@ -244,16 +244,7 @@ local function furnace_node_timer(pos, elapsed) -- Check if we have cookable content: cookable local aftercooked cooked, aftercooked = minetest.get_craft_result({method = "cooking", width = 1, items = srclist}) - cookable = false - cookableItems = {"mcl_raw_ores:raw_iron", "mcl_raw_ores:raw_gold", "mcl_copper:raw_copper", "mcl_nether:ancient_debris"} - cookable = false - --for _, item in ipairs(cookableItems) do - for _,item in ipairs(cookableItems) do - local stack = inv:get_stack("src",1) - if stack:get_name() == item then - cookable = true - end - end + cookable = minetest.get_item_group(inv:get_stack("src", 1):get_name(), "blast_furnace_smeltable") == 1 if cookable then -- Successful cooking requires space in dst slot and time if not inv:room_for_item("dst", cooked.item) then @@ -289,13 +280,13 @@ local function furnace_node_timer(pos, elapsed) elseif active then el = math.min(el, fuel_totaltime - fuel_time) -- The furnace is currently active and has enough fuel - fuel_time = fuel_time + el + fuel_time = (fuel_time + el)*2 end -- If there is a cookable item then check if it is ready yet if cookable and active then - -- in the src_time variable, the *1.5 is the multiplication that makes the blast furnace work faster than a normal furnace. I (PrairieWind) have it at 1.5 times faster, but it can be OP and 2 times faster, or 1.2 times faster. All are good numbers. - src_time = (src_time + el)*1.5 + -- in the src_time variable, the *2 is the multiplication that makes the blast furnace work faster than a normal furnace. + src_time = (src_time + el)*2 -- Place result in dst list if done if src_time >= cooked.time then inv:add_item("dst", cooked.item) @@ -335,11 +326,11 @@ local function furnace_node_timer(pos, elapsed) fuel_percent = math.floor(fuel_time / fuel_totaltime * 100) end formspec = active_formspec(fuel_percent, item_percent) - swap_node(pos, "mcl_furnaces:blast_furnace_active") + swap_node(pos, "mcl_blast_furnace:blast_furnace_active") -- make sure timer restarts automatically result = true else - swap_node(pos, "mcl_furnaces:blast_furnace") + swap_node(pos, "mcl_blast_furnace:blast_furnace") -- stop timer on the inactive furnace minetest.get_node_timer(pos):stop() end @@ -366,17 +357,17 @@ if minetest.get_modpath("screwdriver") then after_rotate_active = function(pos) local node = minetest.get_node(pos) mcl_particles.delete_node_particlespawners(pos) - if node.name == "mcl_furnaces:blast_furnace" then + if node.name == "mcl_blast_furnace:blast_furnace" then return end spawn_flames(pos, node.param2) end end -minetest.register_node("mcl_furnaces:blast_furnace", { +minetest.register_node("mcl_blast_furnace:blast_furnace", { description = S("Blast Furnace"), - _tt_help = S("Uses fuel to smelt or cook items"), - _doc_items_longdesc = S("Blast Furnaces cook or smelt several items, using a furnace fuel, into something else, but faster than a normal furnace."), + _tt_help = S("Smelts ores faster than furnace"), + _doc_items_longdesc = S("Blast Furnaces smelt several items, mainly ores and armor, using a furnace fuel, into something else."), _doc_items_usagehelp = S([[ Use the furnace to open the furnace menu. @@ -456,7 +447,7 @@ minetest.register_node("mcl_furnaces:blast_furnace", { on_rotate = on_rotate, }) -minetest.register_node("mcl_furnaces:blast_furnace_active", { +minetest.register_node("mcl_blast_furnace:blast_furnace_active", { description = S("Active Blast Furnace"), _doc_items_create_entry = false, tiles = { @@ -468,7 +459,7 @@ minetest.register_node("mcl_furnaces:blast_furnace_active", { paramtype2 = "facedir", paramtype = "light", light_source = LIGHT_ACTIVE_FURNACE, - drop = "mcl_furnaces:blast_furnace", + drop = "mcl_blast_furnace:blast_furnace", groups = {pickaxey=1, container=4, deco_block=1, not_in_creative_inventory=1, material_stone=1}, is_ground_content = false, sounds = mcl_sounds.node_sound_stone_defaults(), @@ -511,7 +502,7 @@ minetest.register_node("mcl_furnaces:blast_furnace_active", { }) minetest.register_craft({ - output = "mcl_furnaces:blast_furnace", + output = "mcl_blast_furnace:blast_furnace", recipe = { { "mcl_core:iron_ingot", "mcl_core:iron_ingot", "mcl_core:iron_ingot" }, { "mcl_core:iron_ingot", "mcl_furnaces:furnace", "mcl_core:iron_ingot" }, @@ -519,30 +510,21 @@ minetest.register_craft({ } }) +minetest.register_alias("mcl_blast_furnace:blast_furnace", "mcl_furnaces:blast_furnace") +minetest.register_alias("mcl_blast_furnace:blast_furnace_active", "mcl_furnaces:blast_furnace_active") + -- Add entry alias for the Help if minetest.get_modpath("doc") then - doc.add_entry_alias("nodes", "mcl_furnaces:blast_furnace", "nodes", "mcl_furnaces:blast_furnace_active") + doc.add_entry_alias("nodes", "mcl_blast_furnace:blast_furnace", "nodes", "mcl_blast_furnace:blast_furnace_active") end minetest.register_lbm({ label = "Active furnace flame particles", - name = "mcl_furnaces:flames", - nodenames = {"mcl_furnaces:blast_furnace_active"}, + name = "mcl_blast_furnace:flames", + nodenames = {"mcl_blast_furnace:blast_furnace_active"}, run_at_every_load = true, action = function(pos, node) spawn_flames(pos, node.param2) end, }) --- Legacy -minetest.register_lbm({ - label = "Update furnace formspecs (0.60.0)", - name = "mcl_furnaces:update_formspecs_0_60_0", - -- Only update inactive furnaces because active ones should update themselves - nodenames = { "mcl_furnaces:blast_furnace" }, - run_at_every_load = false, - action = function(pos, node) - local meta = minetest.get_meta(pos) - meta:set_string("formspec", inactive_formspec) - end, -}) diff --git a/mods/ITEMS/mcl_blast_furnace/locale/mcl_blast_furnace.fr.tr b/mods/ITEMS/mcl_blast_furnace/locale/mcl_blast_furnace.fr.tr new file mode 100644 index 000000000..16484251a --- /dev/null +++ b/mods/ITEMS/mcl_blast_furnace/locale/mcl_blast_furnace.fr.tr @@ -0,0 +1,8 @@ +# textdomain: mcl_blast_furnace +Inventory=Inventaire +Blast Furnace=Haut Fourneau +Smelts ores faster than furnace=fond le minerai plus vite que le fourneau +Use the recipe book to see what you can smelt, what you can use as fuel and how long it will burn.=Utiliser le livre de recettes pour voir ce que vous pouvez fondre, ce que vous pouvez utiliser comme combustible et combien de temps ça va brûler. +Use the furnace to open the furnace menu.\nPlace a furnace fuel in the lower slot and the source material in the upper slot.\nThe furnace will slowly use its fuel to smelt the item.\nThe result will be placed into the output slot at the right side.=Utiliser le fourneau pour ouvrir le menu.\nPlacer le combustible dans la case en bas et le matériau source dans la case du haut.\nLe fourneau utilisera son combustible pour fondre lentement l'objet.\nLe résultat sera placé dans la case de sortie à droite. +Blast Furnaces smelt several items, mainly ores and armor, using a furnace fuel, into something else.=Les hauts fourneaux fondent plusieurs objets, principalement du minerai et des pièces d'armure, en quelque chose d'autre. +Active Blast Furnace=Haut Fourneau Actif diff --git a/mods/ITEMS/mcl_blast_furnace/locale/template.txt b/mods/ITEMS/mcl_blast_furnace/locale/template.txt new file mode 100644 index 000000000..1c30844d8 --- /dev/null +++ b/mods/ITEMS/mcl_blast_furnace/locale/template.txt @@ -0,0 +1,8 @@ +# textdomain: mcl_blast_furnace +Inventory= +Blast Furnace= +Smelts ores faster than furnace= +Use the recipe book to see what you can smelt, what you can use as fuel and how long it will burn.= +Use the furnace to open the furnace menu.\nPlace a furnace fuel in the lower slot and the source material in the upper slot.\nThe furnace will slowly use its fuel to smelt the item.\nThe result will be placed into the output slot at the right side.= +Blast Furnaces smelt several items, mainly ores and armor, using a furnace fuel, into something else.= +Active Blast Furnace= \ No newline at end of file diff --git a/mods/ITEMS/mcl_blast_furnace/mod.conf b/mods/ITEMS/mcl_blast_furnace/mod.conf new file mode 100644 index 000000000..e330e80e4 --- /dev/null +++ b/mods/ITEMS/mcl_blast_furnace/mod.conf @@ -0,0 +1,3 @@ +name = mcl_blast_furnace +depends = mcl_init, mcl_formspec, mcl_core, mcl_furnaces, mcl_sounds, mcl_craftguide, mcl_achievements, mcl_particles +optional_depends = doc, screwdriver diff --git a/mods/ITEMS/mcl_furnaces/textures/blast_furnace_front.png b/mods/ITEMS/mcl_blast_furnace/textures/blast_furnace_front.png similarity index 100% rename from mods/ITEMS/mcl_furnaces/textures/blast_furnace_front.png rename to mods/ITEMS/mcl_blast_furnace/textures/blast_furnace_front.png diff --git a/mods/ITEMS/mcl_furnaces/textures/blast_furnace_front_on.png b/mods/ITEMS/mcl_blast_furnace/textures/blast_furnace_front_on.png similarity index 100% rename from mods/ITEMS/mcl_furnaces/textures/blast_furnace_front_on.png rename to mods/ITEMS/mcl_blast_furnace/textures/blast_furnace_front_on.png diff --git a/mods/ITEMS/mcl_furnaces/textures/blast_furnace_front_on_e.png b/mods/ITEMS/mcl_blast_furnace/textures/blast_furnace_front_on_e.png similarity index 100% rename from mods/ITEMS/mcl_furnaces/textures/blast_furnace_front_on_e.png rename to mods/ITEMS/mcl_blast_furnace/textures/blast_furnace_front_on_e.png diff --git a/mods/ITEMS/mcl_furnaces/textures/blast_furnace_front_on_e_s.png b/mods/ITEMS/mcl_blast_furnace/textures/blast_furnace_front_on_e_s.png similarity index 100% rename from mods/ITEMS/mcl_furnaces/textures/blast_furnace_front_on_e_s.png rename to mods/ITEMS/mcl_blast_furnace/textures/blast_furnace_front_on_e_s.png diff --git a/mods/ITEMS/mcl_furnaces/textures/blast_furnace_side.png b/mods/ITEMS/mcl_blast_furnace/textures/blast_furnace_side.png similarity index 100% rename from mods/ITEMS/mcl_furnaces/textures/blast_furnace_side.png rename to mods/ITEMS/mcl_blast_furnace/textures/blast_furnace_side.png diff --git a/mods/ITEMS/mcl_furnaces/textures/blast_furnace_top.png b/mods/ITEMS/mcl_blast_furnace/textures/blast_furnace_top.png similarity index 100% rename from mods/ITEMS/mcl_furnaces/textures/blast_furnace_top.png rename to mods/ITEMS/mcl_blast_furnace/textures/blast_furnace_top.png diff --git a/mods/ITEMS/mcl_bows/locale/mcl_bows.fr.tr b/mods/ITEMS/mcl_bows/locale/mcl_bows.fr.tr index 6cbe098f5..6328b7998 100644 --- a/mods/ITEMS/mcl_bows/locale/mcl_bows.fr.tr +++ b/mods/ITEMS/mcl_bows/locale/mcl_bows.fr.tr @@ -13,3 +13,6 @@ Ammunition=Munition Damage from bow: 1-10=Dégâts de l'arc: 1-10 Damage from dispenser: 3=Dégâts du distributeur: 3 Launches arrows=Lance des flèches +Crossbow=Arbalète +Crossbow is a ranged weapon to shoot arrows at your foes.=L'arbalète est une arme à distance qui tire des flèches sur vos ennemis. +To use the crossbow, you first need to have at least one arrow anywhere in your inventory (unless in Creative Mode). Hold down the right mouse button to charge, release to load an arrow into the chamber, then to shoot press left mouse.=Pour utiliser l'arbalète, il faut avoir au moins une flèche quelque part dans l'inventaire (sauf en mode créatif). Appuyez sur le bouton droit de la souris pour charger, relacher pour charger la flèche dans la chambre, puis pour tirer appuyer sur le bouton gauche de la souris. diff --git a/mods/ITEMS/mcl_cartography_table/README.md b/mods/ITEMS/mcl_cartography_table/README.md new file mode 100644 index 000000000..4818b6784 --- /dev/null +++ b/mods/ITEMS/mcl_cartography_table/README.md @@ -0,0 +1,13 @@ +mcl_cartography_table +------------------- +Cartography Tables, by PrairieWind + +Adds Cartography Tables to MineClone 2/5. + +License of source code +---------------------- +LGPLv2.1 + +License of media +---------------- +See the main MineClone 2 README.md file. \ No newline at end of file diff --git a/mods/ITEMS/mcl_cartography_table/init.lua b/mods/ITEMS/mcl_cartography_table/init.lua new file mode 100644 index 000000000..a7c66b4e2 --- /dev/null +++ b/mods/ITEMS/mcl_cartography_table/init.lua @@ -0,0 +1,27 @@ +local S = minetest.get_translator(minetest.get_current_modname()) +-- Cartography Table Code. Used to create and copy maps. Needs a GUI still. + +minetest.register_node("mcl_cartography_table:cartography_table", { + description = S("Cartography Table"), + _tt_help = S("Used to create or copy maps"), + _doc_items_longdesc = S("Is used to create or copy maps for use.."), + tiles = { + "cartography_table_top.png", "cartography_table_side3.png", + "cartography_table_side3.png", "cartography_table_side2.png", + "cartography_table_side3.png", "cartography_table_side1.png" + }, + paramtype2 = "facedir", + groups = { axey = 2, handy = 1, deco_block = 1, material_wood = 1, flammable = 1 }, + _mcl_blast_resistance = 2.5, + _mcl_hardness = 2.5 + }) + + +minetest.register_craft({ + output = "mcl_cartography_table:cartography_table", + recipe = { + { "mcl_core:paper", "mcl_core:paper", "" }, + { "group:wood", "group:wood", "" }, + { "group:wood", "group:wood", "" }, + } +}) \ No newline at end of file diff --git a/mods/ITEMS/mcl_cartography_table/locale/mcl_cartography_table.fr.tr b/mods/ITEMS/mcl_cartography_table/locale/mcl_cartography_table.fr.tr new file mode 100644 index 000000000..5229d087d --- /dev/null +++ b/mods/ITEMS/mcl_cartography_table/locale/mcl_cartography_table.fr.tr @@ -0,0 +1,4 @@ +# textdomain: mcl_cartography_table +Cartography Table=Table de Cartographie +Used to create or copy maps=Utilisée pour créer ou copier des cartes +Is used to create or copy maps for use..=Est utilisée pour créer ou copier des cartes.. \ No newline at end of file diff --git a/mods/ITEMS/mcl_cartography_table/locale/template.txt b/mods/ITEMS/mcl_cartography_table/locale/template.txt new file mode 100644 index 000000000..e85502e31 --- /dev/null +++ b/mods/ITEMS/mcl_cartography_table/locale/template.txt @@ -0,0 +1,4 @@ +# textdomain: mcl_cartography_table +Cartography Table= +Used to create or copy maps= +Is used to create or copy maps for use..= diff --git a/mods/ITEMS/mcl_cartography_table/mod.conf b/mods/ITEMS/mcl_cartography_table/mod.conf new file mode 100644 index 000000000..ebea16197 --- /dev/null +++ b/mods/ITEMS/mcl_cartography_table/mod.conf @@ -0,0 +1,3 @@ +name = mcl_cartography_table +author = PrairieWind +description = Adds the cartography table villager workstation to MineClone 2/5. Used to copy and create maps. \ No newline at end of file diff --git a/mods/ITEMS/mcl_cartography_table/textures/cartography_table_side1.png b/mods/ITEMS/mcl_cartography_table/textures/cartography_table_side1.png new file mode 100644 index 000000000..7573d6b98 Binary files /dev/null and b/mods/ITEMS/mcl_cartography_table/textures/cartography_table_side1.png differ diff --git a/mods/ITEMS/mcl_cartography_table/textures/cartography_table_side2.png b/mods/ITEMS/mcl_cartography_table/textures/cartography_table_side2.png new file mode 100644 index 000000000..f5dbd7ce5 Binary files /dev/null and b/mods/ITEMS/mcl_cartography_table/textures/cartography_table_side2.png differ diff --git a/mods/ITEMS/mcl_cartography_table/textures/cartography_table_side3.png b/mods/ITEMS/mcl_cartography_table/textures/cartography_table_side3.png new file mode 100644 index 000000000..740303ba1 Binary files /dev/null and b/mods/ITEMS/mcl_cartography_table/textures/cartography_table_side3.png differ diff --git a/mods/ITEMS/mcl_cartography_table/textures/cartography_table_top.png b/mods/ITEMS/mcl_cartography_table/textures/cartography_table_top.png new file mode 100644 index 000000000..cefff1fbd Binary files /dev/null and b/mods/ITEMS/mcl_cartography_table/textures/cartography_table_top.png differ diff --git a/mods/ITEMS/mcl_cauldrons/init.lua b/mods/ITEMS/mcl_cauldrons/init.lua index 55866f5cc..4b6fcd318 100644 --- a/mods/ITEMS/mcl_cauldrons/init.lua +++ b/mods/ITEMS/mcl_cauldrons/init.lua @@ -128,8 +128,9 @@ minetest.register_craft({ minetest.register_abm({ label = "cauldrons", nodenames = {"group:cauldron_filled"}, - interval = 0.5, + interval = 1, chance = 1, + -- TODO: Move to playerinfo/playerplus/mob api action = function(pos, node) for _, obj in pairs(minetest.get_objects_inside_radius(pos, 0.4)) do if mcl_burning.is_burning(obj) then diff --git a/mods/ITEMS/mcl_cauldrons/locale/mcl_cauldrons.fr.tr b/mods/ITEMS/mcl_cauldrons/locale/mcl_cauldrons.fr.tr index ea920874b..76c85e8e9 100644 --- a/mods/ITEMS/mcl_cauldrons/locale/mcl_cauldrons.fr.tr +++ b/mods/ITEMS/mcl_cauldrons/locale/mcl_cauldrons.fr.tr @@ -1,5 +1,5 @@ # textdomain: mcl_cauldrons -Cauldron=Chaudrons +Cauldron=Chaudron Cauldrons are used to store water and slowly fill up under rain. They can also be used to wash off banners.=Les chaudrons sont utilisés pour stocker l'eau et se remplissent lentement sous la pluie. Ils peuvent également être utilisés pour laver les bannières. Place a water bucket into the cauldron to fill it with water. Place an empty bucket on a full cauldron to retrieve the water. Place a water bottle into the cauldron to fill the cauldron to one third with water. Place a glass bottle in a cauldron with water to retrieve one third of the water. Use an emblazoned banner on a cauldron with water to wash off its top layer.=Placez une marmite d'eau dans le chaudron pour le remplir d'eau. Placez un seau vide sur un chaudron plein pour récupérer l'eau. Placez une bouteille d'eau dans le chaudron pour remplir le chaudron au tiers avec de l'eau. Placez une bouteille en verre dans un chaudron avec de l'eau pour récupérer un tiers de l'eau. Utilisez une bannière blasonnée sur un chaudron avec de l'eau pour laver sa couche supérieure. Cauldron (1/3 Water)=Chaudron (1/3 d'eau) diff --git a/mods/ITEMS/mcl_chests/init.lua b/mods/ITEMS/mcl_chests/init.lua index 2ad6518a7..bf02e16f6 100644 --- a/mods/ITEMS/mcl_chests/init.lua +++ b/mods/ITEMS/mcl_chests/init.lua @@ -18,6 +18,30 @@ local entity_animations = { } } +-- Returns position of the neighbor of a double chest node +-- or nil if node is invalid. +-- This function assumes that the large chest is actually intact +-- * pos: Position of the node to investigate +-- * param2: param2 of that node +-- * side: Which "half" the investigated node is. "left" or "right" +local function get_double_container_neighbor_pos(pos, param2, side) + local pos = pos + local param2 = param2 + if side == "right" then + if param2 == 0 then return {x=pos.x-1, y=pos.y, z=pos.z} + elseif param2 == 1 then return {x=pos.x, y=pos.y, z=pos.z+1} + elseif param2 == 2 then return {x=pos.x+1, y=pos.y, z=pos.z} + elseif param2 == 3 then return {x=pos.x, y=pos.y, z=pos.z-1} + end + else + if param2 == 0 then return {x=pos.x+1, y=pos.y, z=pos.z} + elseif param2 == 1 then return {x=pos.x, y=pos.y, z=pos.z-1} + elseif param2 == 2 then return {x=pos.x-1, y=pos.y, z=pos.z} + elseif param2 == 3 then return {x=pos.x, y=pos.y, z=pos.z+1} + end + end +end + minetest.register_entity("mcl_chests:chest", { initial_properties = { visual = "mesh", @@ -217,14 +241,14 @@ local function chest_update_after_close(pos) find_or_create_entity(pos, "mcl_chests:trapped_chest_left", {"mcl_chests_trapped_double.png"}, node.param2, true, "default_chest", "mcl_chests_chest", "chest"):reinitialize("mcl_chests:trapped_chest_left") mesecon.receptor_off(pos, trapped_chest_mesecons_rules) - local pos_other = mcl_util.get_double_container_neighbor_pos(pos, node.param2, "left") + local pos_other = get_double_container_neighbor_pos(pos, node.param2, "left") minetest.swap_node(pos_other, {name="mcl_chests:trapped_chest_right", param2 = node.param2}) mesecon.receptor_off(pos_other, trapped_chest_mesecons_rules) elseif node.name == "mcl_chests:trapped_chest_on_right" then minetest.swap_node(pos, {name="mcl_chests:trapped_chest_right", param2 = node.param2}) mesecon.receptor_off(pos, trapped_chest_mesecons_rules) - local pos_other = mcl_util.get_double_container_neighbor_pos(pos, node.param2, "right") + local pos_other = get_double_container_neighbor_pos(pos, node.param2, "right") minetest.swap_node(pos_other, {name="mcl_chests:trapped_chest_left", param2 = node.param2}) find_or_create_entity(pos_other, "mcl_chests:trapped_chest_left", {"mcl_chests_trapped_double.png"}, node.param2, true, "default_chest", "mcl_chests_chest", "chest"):reinitialize("mcl_chests:trapped_chest_left") mesecon.receptor_off(pos_other, trapped_chest_mesecons_rules) @@ -438,15 +462,15 @@ local function register_chest(basename, desc, longdesc, usagehelp, tt_help, tile -- BEGIN OF LISTRING WORKAROUND inv:set_size("input", 1) -- END OF LISTRING WORKAROUND - if minetest.get_node(mcl_util.get_double_container_neighbor_pos(pos, param2, "right")).name == "mcl_chests:"..canonical_basename.."_small" then + if minetest.get_node(get_double_container_neighbor_pos(pos, param2, "right")).name == "mcl_chests:"..canonical_basename.."_small" then minetest.swap_node(pos, {name="mcl_chests:"..canonical_basename.."_right",param2=param2}) - local p = mcl_util.get_double_container_neighbor_pos(pos, param2, "right") + local p = get_double_container_neighbor_pos(pos, param2, "right") minetest.swap_node(p, { name = "mcl_chests:"..canonical_basename.."_left", param2 = param2 }) create_entity(p, "mcl_chests:"..canonical_basename.."_left", left_textures, param2, true, "default_chest", "mcl_chests_chest", "chest") - elseif minetest.get_node(mcl_util.get_double_container_neighbor_pos(pos, param2, "left")).name == "mcl_chests:"..canonical_basename.."_small" then + elseif minetest.get_node(get_double_container_neighbor_pos(pos, param2, "left")).name == "mcl_chests:"..canonical_basename.."_small" then minetest.swap_node(pos, {name="mcl_chests:"..canonical_basename.."_left",param2=param2}) create_entity(pos, "mcl_chests:"..canonical_basename.."_left", left_textures, param2, true, "default_chest", "mcl_chests_chest", "chest") - local p = mcl_util.get_double_container_neighbor_pos(pos, param2, "left") + local p = get_double_container_neighbor_pos(pos, param2, "left") minetest.swap_node(p, { name = "mcl_chests:"..canonical_basename.."_right", param2 = param2 }) else minetest.swap_node(pos, { name = "mcl_chests:"..canonical_basename.."_small", param2 = param2 }) @@ -541,7 +565,7 @@ local function register_chest(basename, desc, longdesc, usagehelp, tt_help, tile on_construct = function(pos) local n = minetest.get_node(pos) local param2 = n.param2 - local p = mcl_util.get_double_container_neighbor_pos(pos, param2, "left") + local p = get_double_container_neighbor_pos(pos, param2, "left") if not p or minetest.get_node(p).name ~= "mcl_chests:"..canonical_basename.."_right" then n.name = "mcl_chests:"..canonical_basename.."_small" minetest.swap_node(pos, n) @@ -560,7 +584,7 @@ local function register_chest(basename, desc, longdesc, usagehelp, tt_help, tile close_forms(canonical_basename, pos) local param2 = n.param2 - local p = mcl_util.get_double_container_neighbor_pos(pos, param2, "left") + local p = get_double_container_neighbor_pos(pos, param2, "left") if not p or minetest.get_node(p).name ~= "mcl_chests:"..basename.."_right" then return end @@ -581,7 +605,7 @@ local function register_chest(basename, desc, longdesc, usagehelp, tt_help, tile -- BEGIN OF LISTRING WORKAROUND elseif listname == "input" then local inv = minetest.get_inventory({type="node", pos=pos}) - local other_pos = mcl_util.get_double_container_neighbor_pos(pos, minetest.get_node(pos).param2, "left") + local other_pos = get_double_container_neighbor_pos(pos, minetest.get_node(pos).param2, "left") local other_inv = minetest.get_inventory({type="node", pos=other_pos}) return limit_put(stack, inv, other_inv) --[[if inv:room_for_item("main", stack) then @@ -609,7 +633,7 @@ local function register_chest(basename, desc, longdesc, usagehelp, tt_help, tile -- BEGIN OF LISTRING WORKAROUND if listname == "input" then local inv = minetest.get_inventory({type="node", pos=pos}) - local other_pos = mcl_util.get_double_container_neighbor_pos(pos, minetest.get_node(pos).param2, "left") + local other_pos = get_double_container_neighbor_pos(pos, minetest.get_node(pos).param2, "left") local other_inv = minetest.get_inventory({type="node", pos=other_pos}) inv:set_stack("input", 1, nil) @@ -626,7 +650,7 @@ local function register_chest(basename, desc, longdesc, usagehelp, tt_help, tile _mcl_hardness = 2.5, on_rightclick = function(pos, node, clicker) - local pos_other = mcl_util.get_double_container_neighbor_pos(pos, node.param2, "left") + local pos_other = get_double_container_neighbor_pos(pos, node.param2, "left") local above_def = minetest.registered_nodes[minetest.get_node({x = pos.x, y = pos.y + 1, z = pos.z}).name] local above_def_other = minetest.registered_nodes[minetest.get_node({x = pos_other.x, y = pos_other.y + 1, z = pos_other.z}).name] @@ -692,7 +716,7 @@ local function register_chest(basename, desc, longdesc, usagehelp, tt_help, tile on_construct = function(pos) local n = minetest.get_node(pos) local param2 = n.param2 - local p = mcl_util.get_double_container_neighbor_pos(pos, param2, "right") + local p = get_double_container_neighbor_pos(pos, param2, "right") if not p or minetest.get_node(p).name ~= "mcl_chests:"..canonical_basename.."_left" then n.name = "mcl_chests:"..canonical_basename.."_small" minetest.swap_node(pos, n) @@ -710,7 +734,7 @@ local function register_chest(basename, desc, longdesc, usagehelp, tt_help, tile close_forms(canonical_basename, pos) local param2 = n.param2 - local p = mcl_util.get_double_container_neighbor_pos(pos, param2, "right") + local p = get_double_container_neighbor_pos(pos, param2, "right") if not p or minetest.get_node(p).name ~= "mcl_chests:"..basename.."_left" then return end @@ -730,7 +754,7 @@ local function register_chest(basename, desc, longdesc, usagehelp, tt_help, tile return 0 -- BEGIN OF LISTRING WORKAROUND elseif listname == "input" then - local other_pos = mcl_util.get_double_container_neighbor_pos(pos, minetest.get_node(pos).param2, "right") + local other_pos = get_double_container_neighbor_pos(pos, minetest.get_node(pos).param2, "right") local other_inv = minetest.get_inventory({type="node", pos=other_pos}) local inv = minetest.get_inventory({type="node", pos=pos}) --[[if other_inv:room_for_item("main", stack) then @@ -757,7 +781,7 @@ local function register_chest(basename, desc, longdesc, usagehelp, tt_help, tile " moves stuff to chest at "..minetest.pos_to_string(pos)) -- BEGIN OF LISTRING WORKAROUND if listname == "input" then - local other_pos = mcl_util.get_double_container_neighbor_pos(pos, minetest.get_node(pos).param2, "right") + local other_pos = get_double_container_neighbor_pos(pos, minetest.get_node(pos).param2, "right") local other_inv = minetest.get_inventory({type="node", pos=other_pos}) local inv = minetest.get_inventory({type="node", pos=pos}) @@ -775,7 +799,7 @@ local function register_chest(basename, desc, longdesc, usagehelp, tt_help, tile _mcl_hardness = 2.5, on_rightclick = function(pos, node, clicker) - local pos_other = mcl_util.get_double_container_neighbor_pos(pos, node.param2, "right") + local pos_other = get_double_container_neighbor_pos(pos, node.param2, "right") if minetest.registered_nodes[minetest.get_node({x = pos.x, y = pos.y + 1, z = pos.z}).name].groups.opaque == 1 or minetest.registered_nodes[minetest.get_node({x = pos_other.x, y = pos_other.y + 1, z = pos_other.z}).name].groups.opaque == 1 then -- won't open if there is no space from the top @@ -892,12 +916,12 @@ register_chest("trapped_chest", find_or_create_entity(pos, "mcl_chests:trapped_chest_on_left", {"mcl_chests_trapped_double.png"}, node.param2, true, "default_chest", "mcl_chests_chest", "chest"):reinitialize("mcl_chests:trapped_chest_on_left") mesecon.receptor_on(pos, trapped_chest_mesecons_rules) - local pos_other = mcl_util.get_double_container_neighbor_pos(pos, node.param2, "left") + local pos_other = get_double_container_neighbor_pos(pos, node.param2, "left") minetest.swap_node(pos_other, {name="mcl_chests:trapped_chest_on_right", param2 = node.param2}) mesecon.receptor_on(pos_other, trapped_chest_mesecons_rules) end, function(pos, node, clicker) - local pos_other = mcl_util.get_double_container_neighbor_pos(pos, node.param2, "right") + local pos_other = get_double_container_neighbor_pos(pos, node.param2, "right") minetest.swap_node(pos, {name="mcl_chests:trapped_chest_on_right", param2 = node.param2}) mesecon.receptor_on(pos, trapped_chest_mesecons_rules) diff --git a/mods/ITEMS/mcl_compass/init.lua b/mods/ITEMS/mcl_compass/init.lua index 812c2345f..dbb2e8358 100644 --- a/mods/ITEMS/mcl_compass/init.lua +++ b/mods/ITEMS/mcl_compass/init.lua @@ -206,7 +206,7 @@ mcl_compass.stereotype = "mcl_compass:"..tostring(stereotype_frame) minetest.register_node("mcl_compass:lodestone",{ - description="Lodestone", + description=S("Lodestone"), on_rightclick = function(pos, node, player, itemstack) if itemstack.get_name(itemstack).match(itemstack.get_name(itemstack),"mcl_compass:") then if itemstack.get_name(itemstack) ~= "mcl_compass:lodestone" then diff --git a/mods/ITEMS/mcl_compass/locale/mcl_compass.fr.tr b/mods/ITEMS/mcl_compass/locale/mcl_compass.fr.tr index 89299fde7..8ad4bda79 100644 --- a/mods/ITEMS/mcl_compass/locale/mcl_compass.fr.tr +++ b/mods/ITEMS/mcl_compass/locale/mcl_compass.fr.tr @@ -2,3 +2,5 @@ Compasses are tools which point to the world origin (X@=0, Z@=0) or the spawn point in the Overworld.=Les boussoles sont des outils qui pointent vers l'origine du monde (X@=0,Z@=0) ou le point d'apparition dans l'Overworld. Compass=Boussole Points to the world origin=Pointe vers l'origine mondiale +Lodestone Compass=Boussole magnétisée +Lodestone=Magnétite diff --git a/mods/ITEMS/mcl_compass/locale/template.txt b/mods/ITEMS/mcl_compass/locale/template.txt index 462a08bc4..48157aa14 100644 --- a/mods/ITEMS/mcl_compass/locale/template.txt +++ b/mods/ITEMS/mcl_compass/locale/template.txt @@ -2,3 +2,5 @@ Compasses are tools which point to the world origin (X@=0, Z@=0) or the spawn point in the Overworld.= Compass= Points to the world origin= +Lodestone Compass= +Lodestone= \ No newline at end of file diff --git a/mods/ITEMS/mcl_composters/locale/mcl_composters.fr.tr b/mods/ITEMS/mcl_composters/locale/mcl_composters.fr.tr index 7e0b9c8b1..413e5bd43 100644 --- a/mods/ITEMS/mcl_composters/locale/mcl_composters.fr.tr +++ b/mods/ITEMS/mcl_composters/locale/mcl_composters.fr.tr @@ -1,7 +1,7 @@ # textdomain: mcl_composters Composter=Composteur Composters can convert various organic items into bonemeal.=Les composteurs convertissent divers éléments organiques en farine d'os. -Use organic items on the composter to fill it with layers of compost. Every time an item is put in the composter, there is a chance that the composter adds another layer of compost. Some items have a bigger chance of adding an extra layer than other items. After filling up with 7 layers of compost, the composter is full and bone meal can be retrieved from it. Taking out the bone meal empties the composter.=Utiliser des éléments organiques sur le composteur le remplit de couches de compost. Chaque fois qu'un élément est mis dans le composteur, il y a une chance que le composteur rajoute une couche de compost. Certains élémnets ont de plus grandes chances que d'autres d'ajouter une couche de compost. Une fois le composteur rempli de 7 couche de compost, il est plein et on peut récupérer la farine d'os. +Use organic items on the composter to fill it with layers of compost. Every time an item is put in the composter, there is a chance that the composter adds another layer of compost. Some items have a bigger chance of adding an extra layer than other items. After filling up with 7 layers of compost, the composter is full. After a delay of approximately one second the composter becomes ready and bone meal can be retrieved from it. Right-clicking the composter takes out the bone meal empties the composter.=Utiliser des éléments organiques sur le composteur le remplit de couches de compost. Chaque fois qu'un élément est mis dans le composteur, il y a une chance que le composteur rajoute une couche de compost. Certains élémnets ont de plus grandes chances que d'autres d'ajouter une couche de compost. Une fois le composteur rempli de 7 couche de compost, il est plein. Après un délai d'à peu près une seconde le composteur est prêt et on peut y récupérer la farine d'os. Cliquez droit le composteur le vide et récupère la farine d'os. filled=plain ready for harvest=prêt pour la récolte Converts organic items into bonemeal=Convertit les éléments organiques en farine d'os diff --git a/mods/ITEMS/mcl_composters/locale/template.txt b/mods/ITEMS/mcl_composters/locale/template.txt index c5f9bb858..6d4904144 100644 --- a/mods/ITEMS/mcl_composters/locale/template.txt +++ b/mods/ITEMS/mcl_composters/locale/template.txt @@ -1,7 +1,7 @@ # textdomain: mcl_composters Composter= Composters can convert various organic items into bonemeal.= -Use organic items on the composter to fill it with layers of compost. Every time an item is put in the composter, there is a chance that the composter adds another layer of compost. Some items have a bigger chance of adding an extra layer than other items. After filling up with 7 layers of compost, the composter is full. After a delay of approximately one second the composter becomes ready and bone meal can be retrieved from it. Right-clicking the composter takes out the bone meal empties the composter."= +Use organic items on the composter to fill it with layers of compost. Every time an item is put in the composter, there is a chance that the composter adds another layer of compost. Some items have a bigger chance of adding an extra layer than other items. After filling up with 7 layers of compost, the composter is full. After a delay of approximately one second the composter becomes ready and bone meal can be retrieved from it. Right-clicking the composter takes out the bone meal empties the composter.= filled= ready for harvest= Converts organic items into bonemeal= diff --git a/mods/ITEMS/mcl_copper/functions.lua b/mods/ITEMS/mcl_copper/functions.lua index c553d5927..deacf711c 100644 --- a/mods/ITEMS/mcl_copper/functions.lua +++ b/mods/ITEMS/mcl_copper/functions.lua @@ -63,40 +63,42 @@ local function add_wear(placer, itemstack) end local function anti_oxidation(itemstack, placer, pointed_thing) - if pointed_thing.type ~= "node" then return end + local pointed_thing = pointed_thing + if pointed_thing.type ~= "node" then return end - local node = minetest.get_node(pointed_thing.under) - local noddef = minetest.registered_nodes[minetest.get_node(pointed_thing.under).name] + local pointed_thing_under = pointed_thing.under + local node = minetest.get_node(pointed_thing_under) + local node_def = minetest.registered_nodes[node.name] + if not node_def then return end - if not placer:get_player_control().sneak and noddef.on_rightclick then - return minetest.item_place(itemstack, placer, pointed_thing) - end + if not placer:get_player_control().sneak and node_def.on_rightclick then + return minetest.item_place(itemstack, placer, pointed_thing) + end - if minetest.is_protected(pointed_thing.under, placer:get_player_name()) then - minetest.record_protection_violation(pointed_thing.under, placer:get_player_name()) - return itemstack - end + local placer_name = placer:get_player_name() + if minetest.is_protected(pointed_thing_under, placer_name) then + minetest.record_protection_violation(pointed_thing_under, placer_name) + return itemstack + end - if noddef._mcl_stripped_variant == nil then + if not node_def._mcl_stripped_variant then for _, c in pairs(stairs) do - if noddef.name == "mcl_stairs:"..c[1].."_copper_"..c[2].."_cut"..c[3] then - minetest.swap_node(pointed_thing.under, {name="mcl_stairs:"..c[1].."_copper_"..c[4], param2=node.param2}) + if node_def.name == "mcl_stairs:"..c[1].."_copper_"..c[2].."_cut"..c[3] then + minetest.swap_node(pointed_thing_under, {name="mcl_stairs:"..c[1].."_copper_"..c[4], param2=node.param2}) anti_oxidation_particles(pointed_thing) add_wear(placer, itemstack) end end - if noddef._mcl_anti_oxidation_variant ~= nil then - minetest.swap_node(pointed_thing.under, {name=noddef._mcl_anti_oxidation_variant, param2=node.param2}) + if node_def._mcl_anti_oxidation_variant then + minetest.swap_node(pointed_thing_under, {name=node_def._mcl_anti_oxidation_variant, param2=node.param2}) anti_oxidation_particles(pointed_thing) add_wear(placer, itemstack) end - elseif noddef._mcl_stripped_variant ~= nil then - minetest.swap_node(pointed_thing.under, {name=noddef._mcl_stripped_variant, param2=node.param2}) + elseif node_def._mcl_stripped_variant then + minetest.swap_node(pointed_thing_under, {name=node_def._mcl_stripped_variant, param2=node.param2}) add_wear(placer, itemstack) - else - return itemstack end - return itemstack + return itemstack end local function register_axe_override(axe_name) diff --git a/mods/ITEMS/mcl_copper/items.lua b/mods/ITEMS/mcl_copper/items.lua index 92889e455..41faae79b 100644 --- a/mods/ITEMS/mcl_copper/items.lua +++ b/mods/ITEMS/mcl_copper/items.lua @@ -12,5 +12,5 @@ minetest.register_craftitem("mcl_copper:raw_copper", { _doc_items_longdesc = S("Raw Copper. Mine a Copper Ore to get it."), inventory_image = "mcl_copper_raw.png", stack_max = 64, - groups = { craftitem=1 }, + groups = { craftitem=1, blast_furnace_smeltable=1 }, }) \ No newline at end of file diff --git a/mods/ITEMS/mcl_copper/nodes.lua b/mods/ITEMS/mcl_copper/nodes.lua index 2f8709eae..427306c91 100644 --- a/mods/ITEMS/mcl_copper/nodes.lua +++ b/mods/ITEMS/mcl_copper/nodes.lua @@ -6,7 +6,7 @@ minetest.register_node("mcl_copper:stone_with_copper", { tiles = {"default_stone.png^mcl_copper_ore.png"}, is_ground_content = true, stack_max = 64, - groups = {pickaxey=3, building_block=1, material_stone=1}, + groups = {pickaxey=3, building_block=1, material_stone=1, blast_furnace_smeltable=1}, drop = "mcl_copper:raw_copper", sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 3, diff --git a/mods/ITEMS/mcl_core/README.txt b/mods/ITEMS/mcl_core/README.txt index 6c48d74fd..88da2f88d 100644 --- a/mods/ITEMS/mcl_core/README.txt +++ b/mods/ITEMS/mcl_core/README.txt @@ -21,6 +21,14 @@ MIT License. The textures are taken from the Minecraft resource pack “Faithful 1.11” by Vattic and xMrVizzy and contributers. + +CC BY-SA 4.0 + +mcl_core_lava_spark.png is based on the Pixel Perfection resource pack for Minecraft 1.11, +authored by XSSheep. +Source: +License: [CC BY-SA 4.0](http://creativecommons.org/licenses/by-sa/4.0/) + Sounds ====== All sounds included in this mod are under the MIT License. diff --git a/mods/ITEMS/mcl_core/functions.lua b/mods/ITEMS/mcl_core/functions.lua index 20978e26f..00f68b55c 100644 --- a/mods/ITEMS/mcl_core/functions.lua +++ b/mods/ITEMS/mcl_core/functions.lua @@ -4,11 +4,21 @@ local modpath = minetest.get_modpath(minetest.get_current_modname()) -local mg_name = mcl_mapgen.name -local v6 = mcl_mapgen.v6 - local math = math local vector = vector +local math_random = math.random +local minetest_after = minetest.after +local minetest_get_node = minetest.get_node +local minetest_get_node_drops = minetest.get_node_drops +local minetest_get_node_or_nil = minetest.get_node_or_nil +local minetest_get_node_light = minetest.get_node_light +local minetest_get_item_group = minetest.get_item_group +local mcl_time_get_number_of_times_at_pos = mcl_time.get_number_of_times_at_pos +local minetest_get_objects_inside_radius = minetest.get_objects_inside_radius +local minetest_registered_nodes = minetest.registered_nodes + +local mg_name = mcl_mapgen.name +local v6 = mcl_mapgen.v6 local OAK_TREE_ID = 1 local DARK_OAK_TREE_ID = 2 @@ -26,11 +36,11 @@ minetest.register_abm({ action = function(pos, node, active_object_count, active_object_count_wider) local water = minetest.find_nodes_in_area({x=pos.x-1, y=pos.y-1, z=pos.z-1}, {x=pos.x+1, y=pos.y+1, z=pos.z+1}, "group:water") - local lavatype = minetest.registered_nodes[node.name].liquidtype + local lavatype = minetest_registered_nodes[node.name].liquidtype for w=1, #water do - --local waternode = minetest.get_node(water[w]) - --local watertype = minetest.registered_nodes[waternode.name].liquidtype + --local waternode = minetest_get_node(water[w]) + --local watertype = minetest_registered_nodes[waternode.name].liquidtype -- Lava on top of water: Water turns into stone if water[w].y < pos.y and water[w].x == pos.x and water[w].z == pos.z then minetest.set_node(water[w], {name="mcl_core:stone"}) @@ -54,44 +64,154 @@ minetest.register_abm({ end, }) + -- --- Papyrus and cactus growing +-- Production of sparks from lava -- --- Functions -function mcl_core.grow_cactus(pos, node) - pos.y = pos.y-1 - local name = minetest.get_node(pos).name - if minetest.get_item_group(name, "sand") ~= 0 then - pos.y = pos.y+1 - local height = 0 - while minetest.get_node(pos).name == "mcl_core:cactus" and height < 4 do - height = height+1 - pos.y = pos.y+1 - end - if height < 3 then - if minetest.get_node(pos).name == "air" then - minetest.set_node(pos, {name="mcl_core:cactus"}) - end - end - end +local LAVA_SPARK_ABM_INTERVAL = 5 +local lava_spark_limit = minetest.settings:get("mcl_core_lava_spark_limit") +if lava_spark_limit == nil then + lava_spark_limit = 10 +else + lava_spark_limit = tonumber(lava_spark_limit) end +local lava_spark_chance = 0 +local lava_spark_abm_census = 0 +local lava_spark_census = 0 + +function mcl_core.lava_spark_set_chance() + lava_spark_chance = lava_spark_limit / lava_spark_abm_census + minetest_after(LAVA_SPARK_ABM_INTERVAL, mcl_core.lava_spark_set_chance) + lava_spark_abm_census = 0 + lava_spark_census = 0 +end + +function lava_spark_add(pos) + local node = minetest_get_node(pos) + if minetest_get_item_group(node.name, "lava") == 0 then return end + + local above = minetest_get_node(vector.new(pos.x, pos.y + 1, pos.z)) + if above.name ~= "air" then return end + + local pos_addend = vector.new( + (math_random() - 0.5) * 0.8, + (math_random() - 0.5) * 0.8, + (math_random() - 0.5) * 0.8 + ) + local spark_pos = vector.add(pos, pos_addend) + local spark = minetest.add_entity(spark_pos, "mcl_core:lava_spark") + if not spark then return end + + local velocity = vector.new( + (math_random() - 0.5) * 3, + (math_random() + 2) * 2, + (math_random() - 0.5) * 3 + ) + spark:set_velocity(velocity) + + spark:set_acceleration(vector.new(0, -9, 0)) + + -- Set a random size + local size = 0.2 + math_random() * 0.2 + local props = spark:get_properties() + if not props then return end + props.visual_size = vector.new(size, size, size) + spark:set_properties(props) + + local luaentity = spark:get_luaentity() + if not luaentity then return end + luaentity._life_timer = 0.4 + math_random() +end + +if lava_spark_limit > 0 then + mcl_core.lava_spark_set_chance() + + minetest.register_abm({ + label = "Lava produce sparks", + nodenames = {"group:lava"}, + neighbors = {"air"}, + interval = LAVA_SPARK_ABM_INTERVAL, + chance = 18, + action = function(pos, node) + local above = minetest_get_node(vector.new(pos.x, pos.y + 1, pos.z)) + if above.name ~= "air" then return end + + lava_spark_abm_census = lava_spark_abm_census + 1 + + if lava_spark_census >= lava_spark_limit then return end + if math_random() > lava_spark_chance then return end + + lava_spark_census = lava_spark_census + 1 + minetest_after(math_random() * LAVA_SPARK_ABM_INTERVAL, lava_spark_add, pos) + end + }) +end + +minetest.register_entity("mcl_core:lava_spark", { + physical = true, + visual = "sprite", + collide_with_objects = true, + textures = {"mcl_core_lava_spark.png"}, + glow = 10, + static_save = false, + _smoke_timer = 0.1, + _life_timer = 1, + on_step = function(self, dtime) + if not self or not self.object then return end + + self._life_timer = self._life_timer - dtime + if self._life_timer <= 0 then + self.object:remove() + return + end + + + self._smoke_timer = self._smoke_timer - dtime + if self._smoke_timer > 0 then return end + self._smoke_timer = 0.2 + math_random() * 0.3 + + local pos = self.object:get_pos() + + -- Add smoke + minetest.add_particlespawner({ + amount = 3, + time = 0.001, + minpos = pos, + maxpos = pos, + minvel = vector.new(-0.1, 1, -0.1), + maxvel = vector.new(0.1, 1.5, 0.1), + minexptime = 0.1, + maxexptime = 0.6, + minsize = 0.5, + maxsize = 1.5, + texture = "mcl_particles_smoke_anim.png", + animation = { + type = "vertical_frames", + aspect_w = 8, + aspect_h = 8, + } + }) + end +}) + +-- Functions function mcl_core.grow_reeds(pos, node) pos.y = pos.y-1 - local name = minetest.get_node(pos).name - if minetest.get_item_group(name, "soil_sugarcane") ~= 0 then + local name = minetest_get_node(pos).name + if minetest_get_item_group(name, "soil_sugarcane") ~= 0 then if minetest.find_node_near(pos, 1, {"group:water"}) == nil and minetest.find_node_near(pos, 1, {"group:frosted_ice"}) == nil then return end pos.y = pos.y+1 local height = 0 - while minetest.get_node(pos).name == "mcl_core:reeds" and height < 3 do + while minetest_get_node(pos).name == "mcl_core:reeds" and height < 3 do height = height+1 pos.y = pos.y+1 end if height < 3 then - if minetest.get_node(pos).name == "air" then + if minetest_get_node(pos).name == "air" then minetest.set_node(pos, {name="mcl_core:reeds"}) end end @@ -100,18 +220,17 @@ end -- ABMs - local function drop_attached_node(p) - local nn = minetest.get_node(p).name + local nn = minetest_get_node(p).name if nn == "air" or nn == "ignore" then return end minetest.remove_node(p) - for _, item in pairs(minetest.get_node_drops(nn, "")) do + for _, item in pairs(minetest_get_node_drops(nn, "")) do local pos = { - x = p.x + math.random()/2 - 0.25, - y = p.y + math.random()/2 - 0.25, - z = p.z + math.random()/2 - 0.25, + x = p.x + math_random()/2 - 0.25, + y = p.y + math_random()/2 - 0.25, + z = p.z + math_random()/2 - 0.25, } if item ~= "" then minetest.add_item(pos, item) @@ -123,11 +242,11 @@ end local function liquid_flow_action(pos, group, action) local function check_detach(pos, xp, yp, zp) local p = {x=pos.x+xp, y=pos.y+yp, z=pos.z+zp} - local n = minetest.get_node_or_nil(p) + local n = minetest_get_node_or_nil(p) if not n then return false end - local d = minetest.registered_nodes[n.name] + local d = minetest_registered_nodes[n.name] if not d then return false end @@ -136,7 +255,7 @@ local function liquid_flow_action(pos, group, action) * 2a: If target node is below liquid, always succeed * 2b: If target node is horizontal to liquid: succeed if source, otherwise check param2 for horizontal flow direction ]] local range = d.liquid_range or 8 - if (minetest.get_item_group(n.name, group) ~= 0) and + if (minetest_get_item_group(n.name, group) ~= 0) and ((yp > 0) or (yp == 0 and ((d.liquidtype == "source") or (n.param2 > (8-range) and n.param2 < 9)))) then action(pos) @@ -185,17 +304,23 @@ minetest.register_abm({ end, }) --- Cactus mechanisms -minetest.register_abm({ - label = "Cactus growth", - nodenames = {"mcl_core:cactus"}, - neighbors = {"group:sand"}, - interval = 25, - chance = 10, - action = function(pos) - mcl_core.grow_cactus(pos) - end, -}) +local function cactus_grow(pos, node) + local pos = pos + local y = pos.y + pos.y = y - 1 + local name = minetest_get_node(pos).name + if minetest_get_item_group(name, "sand") == 0 then return end + + for i = 1, 2 do + pos.y = y + i + name = minetest_get_node(pos).name + if name == "air" then + minetest.set_node(pos, {name = "mcl_core:cactus"}) + return + end + if name ~= "mcl_core:cactus" then return end + end +end minetest.register_abm({ label = "Cactus mechanisms", @@ -203,39 +328,34 @@ minetest.register_abm({ interval = 1, chance = 1, action = function(pos, node, active_object_count, active_object_count_wider) - for _, object in pairs(minetest.get_objects_inside_radius(pos, 0.9)) do + local pos = pos + local x, y, z = pos.x, pos.y, pos.z + + if minetest_registered_nodes[minetest_get_node({x = x + 1, y = y, z = z}).name].walkable + or minetest_registered_nodes[minetest_get_node({x = x - 1, y = y, z = z}).name].walkable + or minetest_registered_nodes[minetest_get_node({x = x, y = y, z = z + 1}).name].walkable + or minetest_registered_nodes[minetest_get_node({x = x, y = y, z = z - 1}).name].walkable + then + while minetest_get_node(pos).name == "mcl_core:cactus" do + minetest.remove_node(pos) + minetest.add_item(vector.offset(pos, math_random(-0.5, 0.5), 0, math_random(-0.5, 0.5)), "mcl_core:cactus") + pos.y = pos.y + 1 + end + return + end + + for _, object in pairs(minetest_get_objects_inside_radius(pos, 0.9)) do local entity = object:get_luaentity() if entity then local entity_name = entity.name if entity_name == "__builtin:item" then object:remove() - elseif entity_name == "mcl_minecarts:minecart" then - local pos = object:get_pos() - local driver = entity._driver - if driver then - mcl_player.player_attached[driver] = nil - local player = minetest.get_player_by_name(driver) - player:set_detach() - player:set_eye_offset({x=0, y=0, z=0},{x=0, y=0, z=0}) - mcl_player.player_set_animation(player, "stand" , 30) - end - minetest.add_item(pos, "mcl_minecarts:minecart") - object:remove() end end end - local posses = { { 1, 0 }, { -1, 0 }, { 0, 1 }, { 0, -1 } } - for _, p in pairs(posses) do - if minetest.registered_nodes[minetest.get_node(vector.new(pos.x + p[1], pos.y, pos.z + p[2])).name].walkable then - local posy = pos.y - while minetest.get_node(vector.new(pos.x, posy, pos.z)).name == "mcl_core:cactus" do - local pos = vector.new(pos.x, posy, pos.z) - minetest.remove_node(pos) - minetest.add_item(vector.offset(pos, math.random(-0.5, 0.5), 0, math.random(-0.5, 0.5)), "mcl_core:cactus") - posy = posy + 1 - end - break - end + + for i = 1, mcl_time_get_number_of_times_at_pos(pos, 25, 10) do + cactus_grow(pos) end end, }) @@ -262,7 +382,7 @@ minetest.register_on_dignode(function(pos, node) local i=1 while timber_nodenames[i]~=nil do local np={x=pos.x, y=pos.y+1, z=pos.z} - while minetest.get_node(np).name==timber_nodenames[i] do + while minetest_get_node(np).name==timber_nodenames[i] do minetest.remove_node(np) minetest.add_item(np, timber_nodenames[i]) np={x=np.x, y=np.y+1, z=np.z} @@ -272,7 +392,7 @@ minetest.register_on_dignode(function(pos, node) end) local function air_leaf(leaftype) - if math.random(0, 50) == 3 then + if math_random(0, 50) == 3 then return {name = "air"} else return {name = leaftype} @@ -286,7 +406,7 @@ local function node_stops_growth(node) return false end - local def = minetest.registered_nodes[node.name] + local def = minetest_registered_nodes[node.name] if not def then return true end @@ -319,7 +439,7 @@ local function check_growth_width(pos, width, height) pos.x + x, pos.y + y, pos.z + z) - if node_stops_growth(minetest.get_node(np)) then + if node_stops_growth(minetest_get_node(np)) then return false end end @@ -371,10 +491,10 @@ end -- oak tree. function mcl_core.generate_tree(pos, tree_type, options) pos.y = pos.y-1 - --local nodename = minetest.get_node(pos).name + --local nodename = minetest_get_node(pos).name pos.y = pos.y+1 - if not minetest.get_node_light(pos) then + if not minetest_get_node_light(pos) then return end @@ -427,7 +547,7 @@ function mcl_core.generate_v6_oak_tree(pos) local node for dy=1,4 do pos.y = pos.y+dy - if minetest.get_node(pos).name ~= "air" then + if minetest_get_node(pos).name ~= "air" then return end pos.y = pos.y-dy @@ -435,7 +555,7 @@ function mcl_core.generate_v6_oak_tree(pos) node = {name = trunk} for dy=0,4 do pos.y = pos.y+dy - if minetest.get_node(pos).name == "air" then + if minetest_get_node(pos).name == "air" then minetest.add_node(pos, node) end pos.y = pos.y-dy @@ -444,7 +564,7 @@ function mcl_core.generate_v6_oak_tree(pos) node = {name = leaves} pos.y = pos.y+3 --[[local rarity = 0 - if math.random(0, 10) == 3 then + if math_random(0, 10) == 3 then rarity = 1 end]] for dx=-2,2 do @@ -455,23 +575,23 @@ function mcl_core.generate_v6_oak_tree(pos) pos.z = pos.z+dz if dx == 0 and dz == 0 and dy==3 then - if minetest.get_node(pos).name == "air" and math.random(1, 5) <= 4 then + if minetest_get_node(pos).name == "air" and math_random(1, 5) <= 4 then minetest.add_node(pos, node) minetest.add_node(pos, air_leaf(leaves)) end elseif dx == 0 and dz == 0 and dy==4 then - if minetest.get_node(pos).name == "air" and math.random(1, 5) <= 4 then + if minetest_get_node(pos).name == "air" and math_random(1, 5) <= 4 then minetest.add_node(pos, node) minetest.add_node(pos, air_leaf(leaves)) end elseif math.abs(dx) ~= 2 and math.abs(dz) ~= 2 then - if minetest.get_node(pos).name == "air" then + if minetest_get_node(pos).name == "air" then minetest.add_node(pos, node) minetest.add_node(pos, air_leaf(leaves)) end else if math.abs(dx) ~= 2 or math.abs(dz) ~= 2 then - if minetest.get_node(pos).name == "air" and math.random(1, 5) <= 4 then + if minetest_get_node(pos).name == "air" and math_random(1, 5) <= 4 then minetest.add_node(pos, node) minetest.add_node(pos, air_leaf(leaves)) end @@ -489,14 +609,14 @@ end function mcl_core.generate_balloon_oak_tree(pos) local path local offset - local s = math.random(1, 12) + local s = math_random(1, 12) if s == 1 then -- Small balloon oak path = modpath .. "/schematics/mcl_core_oak_balloon.mts" offset = { x = -2, y = -1, z = -2 } else -- Large balloon oak - local t = math.random(1, 4) + local t = math_random(1, 4) path = modpath .. "/schematics/mcl_core_oak_large_"..t..".mts" if t == 1 or t == 3 then offset = { x = -3, y = -1, z = -3 } @@ -535,7 +655,7 @@ end function mcl_core.generate_v6_spruce_tree(pos) local x, y, z = pos.x, pos.y, pos.z - local maxy = y + math.random(9, 13) -- Trunk top + local maxy = y + math_random(9, 13) -- Trunk top local c_air = minetest.get_content_id("air") local c_ignore = minetest.get_content_id("ignore") @@ -558,7 +678,7 @@ function mcl_core.generate_v6_spruce_tree(pos) local vi = a:index(x - dev, yy, zz) local via = a:index(x - dev, yy + 1, zz) for xx = x - dev, x + dev do - if math.random() < 0.95 - dev * 0.05 then + if math_random() < 0.95 - dev * 0.05 then add_spruce_leaves(data, vi, c_air, c_ignore, c_snow, c_spruce_leaves) end @@ -578,9 +698,9 @@ function mcl_core.generate_v6_spruce_tree(pos) -- Lower branches layer local my = 0 for i = 1, 20 do -- Random 2x2 squares of leaves - local xi = x + math.random(-3, 2) - local yy = maxy + math.random(-6, -5) - local zi = z + math.random(-3, 2) + local xi = x + math_random(-3, 2) + local yy = maxy + math_random(-6, -5) + local zi = z + math_random(-3, 2) if yy > my then my = yy end @@ -602,7 +722,7 @@ function mcl_core.generate_v6_spruce_tree(pos) local vi = a:index(x - dev, yy, zz) local via = a:index(x - dev, yy + 1, zz) for xx = x - dev, x + dev do - if math.random() < 0.95 - dev * 0.05 then + if math_random() < 0.95 - dev * 0.05 then add_spruce_leaves(data, vi, c_air, c_ignore, c_snow, c_spruce_leaves) end @@ -630,14 +750,14 @@ function mcl_core.generate_v6_spruce_tree(pos) end function mcl_core.generate_spruce_tree(pos) - local r = math.random(1, 3) + local r = math_random(1, 3) local path = modpath .. "/schematics/mcl_core_spruce_"..r..".mts" minetest.place_schematic({ x = pos.x - 3, y = pos.y - 1, z = pos.z - 3 }, path, "0", nil, false) end function mcl_core.generate_huge_spruce_tree(pos) - local r1 = math.random(1, 2) - local r2 = math.random(1, 4) + local r1 = math_random(1, 2) + local r2 = math_random(1, 4) local path local offset = { x = -4, y = -1, z = -5 } if r1 <= 2 then @@ -657,7 +777,7 @@ end -- Acacia tree (multiple variants) function mcl_core.generate_acacia_tree(pos) - local r = math.random(1, 7) + local r = math_random(1, 7) local offset = vector.new() if r == 2 or r == 3 then offset = { x = -4, y = -1, z = -4 } @@ -709,9 +829,9 @@ local function add_trunk_and_leaves(data, a, pos, tree_cid, leaves_cid, -- Randomly add leaves in 2x2x2 clusters. for i = 1, iters do - local clust_x = x + math.random(-size, size - 1) - local clust_y = y + height + math.random(-size, 0) - local clust_z = z + math.random(-size, size - 1) + local clust_x = x + math_random(-size, size - 1) + local clust_y = y + height + math_random(-size, 0) + local clust_z = z + math_random(-size, size - 1) for xi = 0, 1 do for yi = 0, 1 do @@ -735,7 +855,7 @@ function mcl_core.generate_v6_jungle_tree(pos) --]] local x, y, z = pos.x, pos.y, pos.z - local height = math.random(8, 12) + local height = math_random(8, 12) local c_air = minetest.get_content_id("air") local c_ignore = minetest.get_content_id("ignore") local c_jungletree = minetest.get_content_id("mcl_core:jungletree") @@ -756,7 +876,7 @@ function mcl_core.generate_v6_jungle_tree(pos) local vi_1 = a:index(x - 1, y - 1, z + z_dist) local vi_2 = a:index(x - 1, y, z + z_dist) for x_dist = -1, 1 do - if math.random(1, 3) >= 2 then + if math_random(1, 3) >= 2 then if data[vi_1] == c_air or data[vi_1] == c_ignore then data[vi_1] = c_jungletree elseif data[vi_2] == c_air or data[vi_2] == c_ignore then @@ -781,7 +901,7 @@ end -- With pos being the lower X and the higher Z value of the trunk. function mcl_core.generate_huge_jungle_tree(pos) -- 2 variants - local r = math.random(1, 2) + local r = math_random(1, 2) local path = modpath.."/schematics/mcl_core_jungle_tree_huge_"..r..".mts" minetest.place_schematic({x = pos.x - 6, y = pos.y - 1, z = pos.z - 7}, path, "random", nil, false) end @@ -823,12 +943,12 @@ minetest.register_abm({ return end local above = {x=pos.x, y=pos.y+1, z=pos.z} - local abovenode = minetest.get_node(above) - if minetest.get_item_group(abovenode.name, "liquid") ~= 0 or minetest.get_item_group(abovenode.name, "opaque") == 1 then + local abovenode = minetest_get_node(above) + if minetest_get_item_group(abovenode.name, "liquid") ~= 0 or minetest_get_item_group(abovenode.name, "opaque") == 1 then -- Never grow directly below liquids or opaque blocks return end - local light_self = minetest.get_node_light(above) + local light_self = minetest_get_node_light(above) if not light_self then return end --[[ Try to find a spreading dirt-type block (e.g. grass block or mycelium) within a 3×5×3 area, with the source block being on the 2nd-topmost layer. ]] @@ -843,20 +963,20 @@ minetest.register_abm({ -- Found it! Now check light levels! local source_above = {x=p2.x, y=p2.y+1, z=p2.z} - local light_source = minetest.get_node_light(source_above) + local light_source = minetest_get_node_light(source_above) if not light_source then return end if light_self >= 4 and light_source >= 9 then -- All checks passed! Let's spread the grass/mycelium! - local n2 = minetest.get_node(p2) - if minetest.get_item_group(n2.name, "grass_block") ~= 0 then + local n2 = minetest_get_node(p2) + if minetest_get_item_group(n2.name, "grass_block") ~= 0 then n2 = mcl_core.get_grass_block_type(pos) end minetest.set_node(pos, {name=n2.name}) -- If this was mycelium, uproot plant above if n2.name == "mcl_core:mycelium" then - local tad = minetest.registered_nodes[minetest.get_node(above).name] + local tad = minetest_registered_nodes[minetest_get_node(above).name] if tad.groups and tad.groups.non_mycelium_plant then minetest.dig_node(above) end @@ -874,9 +994,9 @@ minetest.register_abm({ catch_up = false, action = function(pos, node) local above = {x = pos.x, y = pos.y + 1, z = pos.z} - local name = minetest.get_node(above).name + local name = minetest_get_node(above).name -- Kill grass/mycelium when below opaque block or liquid - if name ~= "ignore" and (minetest.get_item_group(name, "opaque") == 1 or minetest.get_item_group(name, "liquid") ~= 0) then + if name ~= "ignore" and (minetest_get_item_group(name, "opaque") == 1 or minetest_get_item_group(name, "liquid") ~= 0) then minetest.set_node(pos, {name = "mcl_core:dirt"}) end end @@ -884,11 +1004,11 @@ minetest.register_abm({ -- Turn Grass Path and similar nodes to Dirt if a solid node is placed above it minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack, pointed_thing) - if minetest.get_item_group(newnode.name, "solid") ~= 0 or - minetest.get_item_group(newnode.name, "dirtifier") ~= 0 then + if minetest_get_item_group(newnode.name, "solid") ~= 0 or + minetest_get_item_group(newnode.name, "dirtifier") ~= 0 then local below = {x=pos.x, y=pos.y-1, z=pos.z} - local belownode = minetest.get_node(below) - if minetest.get_item_group(belownode.name, "dirtifies_below_solid") == 1 then + local belownode = minetest_get_node(below) + if minetest_get_item_group(belownode.name, "dirtifies_below_solid") == 1 then minetest.set_node(below, {name="mcl_core:dirt"}) end end @@ -902,8 +1022,8 @@ minetest.register_abm({ chance = 50, action = function(pos, node) local above = {x = pos.x, y = pos.y + 1, z = pos.z} - local name = minetest.get_node(above).name - local nodedef = minetest.registered_nodes[name] + local name = minetest_get_node(above).name + local nodedef = minetest_registered_nodes[name] if name ~= "ignore" and nodedef and (nodedef.groups and nodedef.groups.solid) then minetest.set_node(pos, {name = "mcl_core:dirt"}) end @@ -952,7 +1072,7 @@ local function sapling_grow_action(tree_id, soil_needed, one_by_one, two_by_two, local meta = minetest.get_meta(pos) if meta:get("grown") then return end -- Checks if the sapling at pos has enough light and the correct soil - local light = minetest.get_node_light(pos) + local light = minetest_get_node_light(pos) if not light then return end local low_light = (light < treelight) @@ -970,13 +1090,13 @@ local function sapling_grow_action(tree_id, soil_needed, one_by_one, two_by_two, if low_light then if delta < 1.2 then return end - if minetest.get_node_light(pos, 0.5) < treelight then return end + if minetest_get_node_light(pos, 0.5) < treelight then return end end -- TODO: delta is [days] missed in inactive area. Currently we just add it to stage, which is far from a perfect calculation... - local soilnode = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}) - local soiltype = minetest.get_item_group(soilnode.name, "soil_sapling") + local soilnode = minetest_get_node({x=pos.x, y=pos.y-1, z=pos.z}) + local soiltype = minetest_get_item_group(soilnode.name, "soil_sapling") if soiltype < soil_needed then return end -- Increase and check growth stage @@ -990,7 +1110,7 @@ local function sapling_grow_action(tree_id, soil_needed, one_by_one, two_by_two, if two_by_two then -- Check 8 surrounding saplings and try to find a 2×2 pattern local function is_sapling(pos, sapling) - return minetest.get_node(pos).name == sapling + return minetest_get_node(pos).name == sapling end local p2 = {x=pos.x+1, y=pos.y, z=pos.z} local p3 = {x=pos.x, y=pos.y, z=pos.z-1} @@ -1042,7 +1162,7 @@ local function sapling_grow_action(tree_id, soil_needed, one_by_one, two_by_two, end if one_by_one and tree_id == OAK_TREE_ID then -- There is a chance that this tree wants to grow as a balloon oak - if math.random(1, 12) == 1 then + if math_random(1, 12) == 1 then -- Check if there is room for that if check_tree_growth(pos, tree_id, { balloon = true }) then minetest.set_node(pos, {name="air"}) @@ -1055,7 +1175,7 @@ local function sapling_grow_action(tree_id, soil_needed, one_by_one, two_by_two, if one_by_one and check_tree_growth(pos, tree_id) then -- Single sapling minetest.set_node(pos, {name="air"}) - --local r = math.random(1, 12) + --local r = math_random(1, 12) mcl_core.generate_tree(pos, tree_id) return end @@ -1074,7 +1194,7 @@ local grow_birch = sapling_grow_action(BIRCH_TREE_ID, 1, true, false) -- Attempts to grow the sapling at the specified position -- pos: Position --- node: Node table of the node at this position, from minetest.get_node +-- node: Node table of the node at this position, from minetest_get_node -- Returns true on success and false on failure function mcl_core.grow_sapling(pos, node) local grow @@ -1206,7 +1326,7 @@ minetest.register_lbm({ local function leafdecay_particles(pos, node) minetest.add_particlespawner({ - amount = math.random(10, 20), + amount = math_random(10, 20), time = 0.1, minpos = vector.add(pos, {x=-0.4, y=-0.4, z=-0.4}), maxpos = vector.add(pos, {x=0.4, y=0.4, z=0.4}), @@ -1244,7 +1364,7 @@ local function vinedecay_particles(pos, node) end minetest.add_particlespawner({ - amount = math.random(8, 16), + amount = math_random(8, 16), time = 0.1, minpos = vector.add(pos, relpos1), maxpos = vector.add(pos, relpos2), @@ -1282,8 +1402,8 @@ minetest.register_abm({ -- Add vines below pos (if empty) local function spread_down(origin, target, dir, node) - if math.random(1, 2) == 1 then - if minetest.get_node(target).name == "air" then + if math_random(1, 2) == 1 then + if minetest_get_node(target).name == "air" then minetest.add_node(target, {name = "mcl_core:vine", param2 = node.param2}) end end @@ -1294,11 +1414,11 @@ minetest.register_abm({ local vines_in_area = minetest.find_nodes_in_area({x=origin.x-4, y=origin.y-1, z=origin.z-4}, {x=origin.x+4, y=origin.y+1, z=origin.z+4}, "mcl_core:vine") -- Less then 4 vines blocks around the ticked vines block (remember the ticked block is counted by above function as well) if #vines_in_area < 5 then - if math.random(1, 2) == 1 then - if minetest.get_node(target).name == "air" then + if math_random(1, 2) == 1 then + if minetest_get_node(target).name == "air" then local backup_dir = minetest.wallmounted_to_dir(node.param2) local backup = vector.subtract(target, backup_dir) - local backupnodename = minetest.get_node(backup).name + local backupnodename = minetest_get_node(backup).name -- Check if the block above is supported if mcl_core.supports_vines(backupnodename) then @@ -1316,10 +1436,10 @@ minetest.register_abm({ -- Spread horizontally local backup_dir = minetest.wallmounted_to_dir(node.param2) if not vector.equals(backup_dir, dir) then - local target_node = minetest.get_node(target) + local target_node = minetest_get_node(target) if target_node.name == "air" then local backup = vector.add(target, backup_dir) - local backupnodename = minetest.get_node(backup).name + local backupnodename = minetest_get_node(backup).name if mcl_core.supports_vines(backupnodename) then minetest.add_node(target, {name = "mcl_core:vine", param2 = node.param2}) end @@ -1337,7 +1457,7 @@ minetest.register_abm({ { { x= 0, y= 0, z=-1 }, spread_horizontal }, } - local d = math.random(1, #directions) + local d = math_random(1, #directions) local dir = directions[d][1] local spread = directions[d][2] @@ -1347,7 +1467,7 @@ minetest.register_abm({ -- Returns true of the node supports vines function mcl_core.supports_vines(nodename) - local def = minetest.registered_nodes[nodename] + local def = minetest_registered_nodes[nodename] -- Rules: 1) walkable 2) full cube return def.walkable and (def.node_box == nil or def.node_box.type == "regular") and @@ -1385,11 +1505,11 @@ minetest.register_abm({ action = function(p0, node, _, _) local do_preserve = false - local d = minetest.registered_nodes[node.name].groups.leafdecay + local d = minetest_registered_nodes[node.name].groups.leafdecay if not d or d == 0 then return end - local n0 = minetest.get_node(p0) + local n0 = minetest_get_node(p0) if n0.param2 ~= 0 then -- Prevent leafdecay for player-placed leaves. -- param2 is set to 1 after it was placed by the player @@ -1400,8 +1520,8 @@ minetest.register_abm({ p0_hash = minetest.hash_node_position(p0) local trunkp = mcl_core.leafdecay_trunk_cache[p0_hash] if trunkp then - local n = minetest.get_node(trunkp) - local reg = minetest.registered_nodes[n.name] + local n = minetest_get_node(trunkp) + local reg = minetest_registered_nodes[n.name] -- Assume ignore is a trunk, to make the thing work at the border of the active area if n.name == "ignore" or (reg and reg.groups.tree and reg.groups.tree ~= 0) then return @@ -1426,12 +1546,12 @@ minetest.register_abm({ end if not do_preserve then -- Drop stuff other than the node itself - local itemstacks = minetest.get_node_drops(n0.name) + local itemstacks = minetest_get_node_drops(n0.name) for _, itemname in pairs(itemstacks) do local p_drop = { - x = p0.x - 0.5 + math.random(), - y = p0.y - 0.5 + math.random(), - z = p0.z - 0.5 + math.random(), + x = p0.x - 0.5 + math_random(), + y = p0.y - 0.5 + math_random(), + z = p0.z - 0.5 + math_random(), } minetest.add_item(p_drop, itemname) end @@ -1450,7 +1570,7 @@ minetest.register_abm({ } for s=1, #surround do local spos = vector.add(p0, surround[s]) - local maybe_vine = minetest.get_node(spos) + local maybe_vine = minetest_get_node(spos) --local surround_inverse = vector.multiply(surround[s], -1) if maybe_vine.name == "mcl_core:vine" and (not mcl_core.check_vines_supported(spos, maybe_vine)) then minetest.remove_node(spos) @@ -1491,7 +1611,7 @@ minetest.register_abm({ interval = 16, chance = 8, action = function(pos, node) - if minetest.get_node_light(pos, 0) >= 12 then + if minetest_get_node_light(pos, 0) >= 12 then if node.name == "mcl_core:ice" then mcl_core.melt_ice(pos) else @@ -1509,7 +1629,7 @@ function mcl_core.check_vines_supported(pos, node) local supported = false local dir = minetest.wallmounted_to_dir(node.param2) local pos1 = vector.add(pos, dir) - local node_neighbor = minetest.get_node(pos1) + local node_neighbor = minetest_get_node(pos1) -- Check if vines are attached to a solid block. -- If ignore, we assume its solid. if node_neighbor.name == "ignore" or mcl_core.supports_vines(node_neighbor.name) then @@ -1518,7 +1638,7 @@ function mcl_core.check_vines_supported(pos, node) -- Vines are not attached, now we check if the vines are “hanging” below another vines block -- of equal orientation. local pos2 = vector.add(pos, {x=0, y=1, z=0}) - local node2 = minetest.get_node(pos2) + local node2 = minetest_get_node(pos2) -- Again, ignore means we assume its supported if node2.name == "ignore" or (node2.name == "mcl_core:vine" and node2.param2 == node.param2) then supported = true @@ -1531,7 +1651,7 @@ end function mcl_core.melt_ice(pos) -- Create a water source if ice is destroyed and there was something below it local below = {x=pos.x, y=pos.y-1, z=pos.z} - local belownode = minetest.get_node(below) + local belownode = minetest_get_node(below) local dim = mcl_worlds.pos_to_dimension(below) if dim ~= "nether" and belownode.name ~= "air" and belownode.name ~= "ignore" and belownode.name ~= "mcl_core:void" then minetest.set_node(pos, {name="mcl_core:water_source"}) @@ -1566,7 +1686,7 @@ end -- The snowable nodes also MUST have _mcl_snowed defined to contain the name -- of the snowed node. function mcl_core.register_snowed_node(itemstring_snowed, itemstring_clear, tiles, sounds, clear_colorization, desc) - local def = table.copy(minetest.registered_nodes[itemstring_clear]) + local def = table.copy(minetest_registered_nodes[itemstring_clear]) local create_doc_alias if def.description then create_doc_alias = true @@ -1629,7 +1749,7 @@ end -- This function assumes there is no snow cover node above. This function -- MUST NOT be called if there is a snow cover node above pos. function mcl_core.clear_snow_dirt(pos, node) - local def = minetest.registered_nodes[node.name] + local def = minetest_registered_nodes[node.name] if def._mcl_snowless then minetest.swap_node(pos, {name = def._mcl_snowless, param2=node.param2}) end @@ -1642,15 +1762,15 @@ end -- Makes constructed snowable node snowed if placed below a snow cover node. function mcl_core.on_snowable_construct(pos) -- Myself - local node = minetest.get_node(pos) + local node = minetest_get_node(pos) -- Above local apos = {x=pos.x, y=pos.y+1, z=pos.z} - local anode = minetest.get_node(apos) + local anode = minetest_get_node(apos) -- Make snowed if needed - if minetest.get_item_group(anode.name, "snow_cover") == 1 then - local def = minetest.registered_nodes[node.name] + if minetest_get_item_group(anode.name, "snow_cover") == 1 then + local def = minetest_registered_nodes[node.name] if def._mcl_snowed then minetest.swap_node(pos, {name = def._mcl_snowed, param2=node.param2}) end @@ -1670,8 +1790,8 @@ end -- Makes snowable node below snowed. function mcl_core.on_snow_construct(pos) local npos = {x=pos.x, y=pos.y-1, z=pos.z} - local node = minetest.get_node(npos) - local def = minetest.registered_nodes[node.name] + local node = minetest_get_node(npos) + local def = minetest_registered_nodes[node.name] if def._mcl_snowed then minetest.swap_node(npos, {name = def._mcl_snowed, param2=node.param2}) end @@ -1679,13 +1799,13 @@ end -- after_destruct -- Clears snowed dirtlike node below. function mcl_core.after_snow_destruct(pos) - local nn = minetest.get_node(pos).name + local nn = minetest_get_node(pos).name -- No-op if snow was replaced with snow - if minetest.get_item_group(nn, "snow_cover") == 1 then + if minetest_get_item_group(nn, "snow_cover") == 1 then return end local npos = {x=pos.x, y=pos.y-1, z=pos.z} - local node = minetest.get_node(npos) + local node = minetest_get_node(npos) mcl_core.clear_snow_dirt(npos, node) end diff --git a/mods/ITEMS/mcl_core/locale/mcl_core.fr.tr b/mods/ITEMS/mcl_core/locale/mcl_core.fr.tr index c4c818aae..977745ab0 100644 --- a/mods/ITEMS/mcl_core/locale/mcl_core.fr.tr +++ b/mods/ITEMS/mcl_core/locale/mcl_core.fr.tr @@ -92,6 +92,7 @@ Diorite=Diorite Diorite is an igneous rock.=La diorite est une roche volcanique. Dirt=Terre Dirt acts as a soil for a few plants. When in light, this block may grow a grass or mycelium cover if such blocks are nearby.=La terre agit comme un sol pour quelques plantes. Lorsqu'il est à la lumière, ce bloc peut faire pousser une couverture d'herbe ou de mycélium si ces blocs sont à proximité. +Enchanted Golden Apple=Pomme Dorée Enchantée Emerald=Emeraude Emerald Ore=Minerai d'Emeraude Emerald ore is the ore of emeralds. It is very rare and can be found alone, not in clusters.=Le minerai d'émeraude produit des émeraudes. Il est très rare et ne peut être trouvé que seul, pas en filons. @@ -154,6 +155,8 @@ Oak Wood Planks=Planches de Chêne Oak leaves are grown from oak trees.=Les feuilles de chêne sont cultivées à partir de chênes. Obsidian=Obsidienne Obsidian is an extremely hard mineral with an enourmous blast-resistance. Obsidian is formed when water meets lava.=L'obsidienne est un minéral extrêmement dur avec une énorme résistance à l'explosion. L'obsidienne se forme lorsque l'eau rencontre la lave. +Crying Obsidian=Obsidienne Pleureuse +Crying obsidian is a luminous obsidian that can generate as part of ruined portals.=L'obsidienne pleureuse est de l'obsidienne lumineuse générée comme composant des portails en ruines. One of the most common blocks in the world, almost the entire underground consists of stone. It sometimes contains ores. Stone may be created when water meets lava.=L'un des blocs les plus courants au monde, presque tout le sous-sol est en pierre. Il contient parfois des minerais. La pierre peut être créée lorsque l'eau rencontre la lave. Orange Stained Glass=Verre Orange Packed Ice=Glace Compactée @@ -202,20 +205,45 @@ Stained glass is a decorative and mostly transparent block which comes in variou Stick=Bâton Sticks are a very versatile crafting material; used in countless crafting recipes.=Les bâtons sont un matériau d'artisanat très polyvalent; utilisé dans d'innombrables recettes d'artisanat. Stone=Roche +Stripped Acacia Log=Bois d'Acacia +Stripped Acacia Wood=Bois Ecorché d'Acacia +Stripped Birch Log=Bois de Bouleau +Stripped Birch Wood=Bois écorcé de Bouleau +Stripped Dark Oak Log=Bois de Chêne Noir +Stripped Dark Oak Wood=Bois écorcé de Chêne Noir +Stripped Jungle Log=Bois d'Acajou +Stripped Jungle Wood=Bois écorcé d'Acajou +Stripped Oak Log=Bois de Chêne +Stripped Oak Wood=Bois écorcé de Chêne +Stripped Spruce Log=Bois de Sapin +Stripped Spruce Wood=Bois écorcé de Sapin Stone Bricks=Pierre Taillée Sugar=Sucre Sugar Canes=Canne à Sucre Sugar canes are a plant which has some uses in crafting. Sugar canes will slowly grow up to 3 blocks when they are next to water and are placed on a grass block, dirt, sand, red sand, podzol or coarse dirt. When a sugar cane is broken, all sugar canes connected above will break as well.=Les cannes à sucre sont une plante qui a certaines utilisations dans l'artisanat. Les cannes à sucre poussent lentement jusqu'à 3 blocs lorsqu'elles sont à côté de l'eau et sont placées sur un bloc d'herbe, de terre, de sable, de sable rouge, de podzol ou de terre stérile. Lorsqu'une canne à sucre est cassée, toutes les cannes à sucre connectées au-dessus se brisent également. Sugar canes can only be placed top of other sugar canes and on top of blocks on which they would grow.=Les cannes à sucre ne peuvent être placées que sur d'autres cannes à sucre et sur des blocs sur lesquels elles poussent. Sugar comes from sugar canes and is used to make sweet foods.=Le sucre provient des cannes à sucre et est utilisé pour fabriquer des aliments sucrés. +The stripped trunk of an acacia tree.=Le tronc écorcé d'un acacia. +The stripped trunk of a birch tree.=Le tronc écorcé d'un bouleau. +The stripped trunk of a dark oak tree.=Le tronc écorcé d'un chêne noir. +The stripped trunk of a jungle tree.=Le tronc écorcé d'un acajou. +The stripped trunk of an oak tree.=Le tronc écorcé d'un chêne. +The stripped trunk of a spruce tree.=Le tronc écorcé d'un sapin. The trunk of a birch tree.=Le tronc d'un bouleau. The trunk of a dark oak tree.=Le tronc d'un chêne noir. The trunk of a jungle tree.=Le tronc d'un acajou. The trunk of a spruce tree.=Le tronc d'un sapin. The trunk of an acacia.=Le tronc d'un acacia The trunk of an oak tree.=Le tronc d'un chêne. +The stripped wood of an acacia tree.=Les planches écorcée d'un acacia. +The stripped wood of a birch tree.=Les planches écorcée d'un bouleau. +The stripped wood of a dark oak tree.=Les planches écorcée d'un chêne noir. +The stripped wood of a jungle tree.=Les planches écorcée d'un acajou. +The stripped wood of an oak tree.=Les planches écorcée d'un chêne. +The stripped wood of a spruce tree.=Les planches écorcée d'un sapin. This block consists of a couple of loose stones and can't support itself.=Ce bloc se compose de quelques pierres lâches et ne peut pas se soutenir. This is a decorative block surrounded by the bark of a tree trunk.=Il s'agit d'un bloc décoratif entouré par l'écorce d'un tronc d'arbre. +This is a decorative block.=Il s'agit d'un bloc décoratif. This is a full block of snow. Snow of this thickness is usually found in areas of extreme cold.=Ceci est un bloc de neige complet. La neige de cette épaisseur se trouve généralement dans les zones de froid extrême. This is a piece of cactus commonly found in dry areas, especially deserts. Over time, cacti will grow up to 3 blocks high on sand or red sand. A cactus hurts living beings touching it with a damage of 1 HP every half second. When a cactus block is broken, all cactus blocks connected above it will break as well.=Il s'agit d'un morceau de cactus que l'on trouve couramment dans les zones sèches, en particulier dans les déserts. Au fil du temps, les cactus pousseront jusqu'à 3 blocs de haut sur le sable ou le sable rouge. Un cactus blesse les êtres vivants qui le touchent avec des dégâts de 1 HP toutes les demi-secondes. Lorsqu'un bloc de cactus est brisé, tous les blocs de cactus connectés au-dessus se brisent également. This stone contains pure gold, a rare metal.=Cette pierre contient de l'or pur, un métal rare. @@ -256,3 +284,7 @@ Slows down movement=Ralentit le mouvement 2×2 saplings @= large tree=2×2 pousses @= grand arbre Grows on sand or dirt next to water=Pousse sur le sable ou la terre près de l'eau Stackable=Empilable +Moss=Mousse +Moss Carpet=Tapis de Mousse +A moss block is a natural block that can be spread to some other blocks by using bone meal.=Un bloc de mousse est un bloc naturel qui peut se propager à d'autres blocs en utilisant de la farine d'os. +Moss Carpets are a thin decorative variant of the moss block.=Les tapis de mousse sont une fine variante décorative du bloc de mousse. \ No newline at end of file diff --git a/mods/ITEMS/mcl_core/locale/template.txt b/mods/ITEMS/mcl_core/locale/template.txt index 57b15ef82..901c0a4a3 100644 --- a/mods/ITEMS/mcl_core/locale/template.txt +++ b/mods/ITEMS/mcl_core/locale/template.txt @@ -284,3 +284,7 @@ Slows down movement= 2×2 saplings @= large tree= Grows on sand or dirt next to water= Stackable= +Moss= +Moss Carpet= +A moss block is a natural block that can be spread to some other blocks by using bone meal.= +Moss Carpets are a thin decorative variant of the moss block.= \ No newline at end of file diff --git a/mods/ITEMS/mcl_core/mod.conf b/mods/ITEMS/mcl_core/mod.conf index 3d7f59245..ab3094708 100644 --- a/mods/ITEMS/mcl_core/mod.conf +++ b/mods/ITEMS/mcl_core/mod.conf @@ -1,4 +1,4 @@ name = mcl_core description = Core items of MineClone 2: Basic biome blocks (dirt, sand, stones, etc.), derived items, glass, sugar cane, cactus, barrier, mining tools, hand, craftitems, and misc. items which don't really fit anywhere else. -depends = mcl_autogroup, mcl_init, mcl_sounds, mcl_particles, mcl_util, mcl_worlds, doc_items, mcl_enchanting, mcl_colors, mcl_mapgen +depends = mcl_autogroup, mcl_init, mcl_sounds, mcl_particles, mcl_util, mcl_worlds, doc_items, mcl_enchanting, mcl_colors, mcl_mapgen, mcl_time optional_depends = doc diff --git a/mods/ITEMS/mcl_core/nodes_base.lua b/mods/ITEMS/mcl_core/nodes_base.lua index eed6ab906..226e5088b 100644 --- a/mods/ITEMS/mcl_core/nodes_base.lua +++ b/mods/ITEMS/mcl_core/nodes_base.lua @@ -11,7 +11,23 @@ else ice_drawtype = "normal" ice_texture_alpha = minetest.features.use_texture_alpha_string_modes and "opaque" or false end -local mossnodes = {"mcl_core:stone", "mcl_core:granite", "mcl_core:granite_smooth", "mcl_core:diorite", "mcl_core:diorite_smooth", "mcl_core:andesite", "mcl_core:andesite_smooth", "mcl_deepslate:deepslate", --[[glowberries, ]]"mcl_core:dirt", "mcl_core:dirt_with_grass", "mcl_core:podzol", "mcl_core:coarse_dirt", "mcl_core:mycelium"} + +local moss_nodes = { + "mcl_core:stone", + "mcl_core:granite", + "mcl_core:granite_smooth", + "mcl_core:diorite", + "mcl_core:diorite_smooth", + "mcl_core:andesite", + "mcl_core:andesite_smooth", + "mcl_deepslate:deepslate", + --[[glowberries, ]] + "mcl_core:dirt", + "mcl_core:dirt_with_grass", + "mcl_core:podzol", + "mcl_core:coarse_dirt", + "mcl_core:mycelium", +} mcl_core.fortune_drop_ore = { discrete_uniform_distribution = true, @@ -48,7 +64,7 @@ minetest.register_node("mcl_core:stone_with_coal", { tiles = {"mcl_core_coal_ore.png"}, is_ground_content = true, stack_max = 64, - groups = {pickaxey=1, building_block=1, material_stone=1, xp=1}, + groups = {pickaxey=1, building_block=1, material_stone=1, xp=1, blast_furnace_smeltable=1}, drop = "mcl_core:coal_lump", sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 3, @@ -63,7 +79,7 @@ minetest.register_node("mcl_core:stone_with_iron", { tiles = {"mcl_core_iron_ore.png"}, is_ground_content = true, stack_max = 64, - groups = {pickaxey=3, building_block=1, material_stone=1}, + groups = {pickaxey=3, building_block=1, material_stone=1, blast_furnace_smeltable=1}, drop = "mcl_core:stone_with_iron", sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 3, @@ -78,7 +94,7 @@ minetest.register_node("mcl_core:stone_with_gold", { tiles = {"mcl_core_gold_ore.png"}, is_ground_content = true, stack_max = 64, - groups = {pickaxey=4, building_block=1, material_stone=1}, + groups = {pickaxey=4, building_block=1, material_stone=1, blast_furnace_smeltable=1}, drop = "mcl_core:stone_with_gold", sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 3, @@ -98,7 +114,7 @@ minetest.register_node("mcl_core:stone_with_redstone", { tiles = {"mcl_core_redstone_ore.png"}, is_ground_content = true, stack_max = 64, - groups = {pickaxey=4, building_block=1, material_stone=1, xp=7}, + groups = {pickaxey=4, building_block=1, material_stone=1, xp=7, blast_furnace_smeltable=1}, drop = { items = { max_items = 1, @@ -176,7 +192,7 @@ minetest.register_node("mcl_core:stone_with_lapis", { tiles = {"mcl_core_lapis_ore.png"}, is_ground_content = true, stack_max = 64, - groups = {pickaxey=3, building_block=1, material_stone=1, xp=6}, + groups = {pickaxey=3, building_block=1, material_stone=1, xp=6, blast_furnace_smeltable=1}, drop = { max_items = 1, items = { @@ -200,7 +216,7 @@ minetest.register_node("mcl_core:stone_with_emerald", { tiles = {"mcl_core_emerald_ore.png"}, is_ground_content = true, stack_max = 64, - groups = {pickaxey=4, building_block=1, material_stone=1, xp=6}, + groups = {pickaxey=4, building_block=1, material_stone=1, xp=6, blast_furnace_smeltable=1}, drop = "mcl_core:emerald", sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 3, @@ -215,7 +231,7 @@ minetest.register_node("mcl_core:stone_with_diamond", { tiles = {"mcl_core_diamond_ore.png"}, is_ground_content = true, stack_max = 64, - groups = {pickaxey=4, building_block=1, material_stone=1, xp=4}, + groups = {pickaxey=4, building_block=1, material_stone=1, xp=4, blast_furnace_smeltable=1}, drop = "mcl_core:diamond", sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 3, @@ -1089,7 +1105,9 @@ minetest.register_node("mcl_core:snowblock", { _mcl_silk_touch_drop = true, }) -minetest.register_node("mcl_core:moss", { +local MOSS_ITEMSTRING = "mcl_core:moss" +local MOSS_NODE = {name = MOSS_ITEMSTRING} +minetest.register_node(MOSS_ITEMSTRING, { description = S("Moss"), _doc_items_longdesc = S("A moss block is a natural block that can be spread to some other blocks by using bone meal."),--TODO: Other desciption? _doc_items_hidden = false, @@ -1101,41 +1119,41 @@ minetest.register_node("mcl_core:moss", { _mcl_blast_resistance = 0.1, _mcl_hardness = 0.1, on_rightclick = function(pos, node, player, itemstack, pointed_thing) - if player:get_wielded_item():get_name() == "mcl_dye:white" then - if not minetest.is_creative_enabled(player) and not minetest.check_player_privs(player, "creative") then - itemstack:take_item() - end - - for i, j in pairs(minetest.find_nodes_in_area_under_air({x = pos.x-1, y = pos.y-1, z = pos.z-1}, {x = pos.x+1, y = pos.y+1, z = pos.z+1}, mossnodes)) do - minetest.set_node(j, {name="mcl_core:moss"}) - end - for i, j in pairs(minetest.find_nodes_in_area_under_air({x = pos.x-2, y = pos.y-1, z = pos.z-2}, {x = pos.x+2, y = pos.y+1, z = pos.z+2}, mossnodes)) do - if math.random(1,3) == 1 then minetest.set_node(j, {name="mcl_core:moss"}) end - end - for i, j in pairs(minetest.find_nodes_in_area_under_air({x = pos.x-3, y = pos.y-1, z = pos.z-3}, {x = pos.x+3, y = pos.y+1, z = pos.z+3}, mossnodes)) do - if math.random(1,9) == 1 then minetest.set_node(j, {name="mcl_core:moss"}) end - end - for i, j in pairs(minetest.find_nodes_in_area_under_air({x = pos.x-3, y = pos.y-1, z = pos.z-3}, {x = pos.x+3, y = pos.y+1, z = pos.z+3}, {"mcl_core:moss"})) do - if math.random(1,2) == 1 then - minetest.set_node({x=j.x,y=j.y+1,z=j.z} ,{name="mcl_flowers:tallgrass"}) - end - end - for i, j in pairs(minetest.find_nodes_in_area_under_air({x = pos.x-3, y = pos.y-1, z = pos.z-3}, {x = pos.x+3, y = pos.y+1, z = pos.z+3}, {"mcl_core:moss"})) do - if math.random(1,4) == 1 then - minetest.set_node({x=j.x,y=j.y+1,z=j.z}, {name="mcl_core:moss_carpet"}) - end - end - for i, j in pairs(minetest.find_nodes_in_area_under_air({x = pos.x-3, y = pos.y-1, z = pos.z-3}, {x = pos.x+3, y = pos.y+1, z = pos.z+3}, {"mcl_core:moss"})) do - if math.random(1,10) == 1 then - minetest.set_node({x=j.x,y=j.y+1,z=j.z} ,{name="mcl_flowers:double_grass"}) - minetest.set_node({x=j.x,y=j.y+2,z=j.z} ,{name="mcl_flowers:double_grass_top"}) - end - end - elseif minetest.registered_nodes[player:get_wielded_item():get_name()] then + local pos = pos + local x, y, z = pos.x, pos.y, pos.z + local player_wielded_item = player:get_wielded_item() + local item_name = player_wielded_item:get_name() + if item_name == "mcl_dye:white" then + if not minetest.is_creative_enabled(player) then itemstack:take_item() - minetest.set_node(pointed_thing.above, {name=player:get_wielded_item():get_name()}) - end - end, + end + for _, p in pairs(minetest.find_nodes_in_area_under_air({x=x-1, y=y-1, z=z-1}, {x=x+1, y=y+1, z=z+1}, moss_nodes)) do + minetest.set_node(p, MOSS_NODE) + end + for _, p in pairs(minetest.find_nodes_in_area_under_air({x=x-2, y=y-2, z=z-2}, {x=x+2, y=y+2, z=z+2}, moss_nodes)) do + if math.random(1,3) == 1 then minetest.set_node(p, MOSS_NODE) end + end + for _, p in pairs(minetest.find_nodes_in_area_under_air({x=x-3, y=y-3, z=z-3}, {x=x+3, y=y+3, z=z+3}, moss_nodes)) do + if math.random(1,9) == 1 then minetest.set_node(p, MOSS_NODE) end + end + for _, p in pairs(minetest.find_nodes_in_area_under_air({x=x-3, y=y-3, z=z-3}, {x=x+3, y=y+3, z=z+3}, {MOSS_ITEMSTRING})) do + if math.random(1,2) == 1 then + minetest.set_node({x=p.x, y=p.y+1, z=p.z}, {name="mcl_flowers:tallgrass"}) + elseif math.random(1,4) == 1 then + minetest.set_node({x=p.x, y=p.y+1, z=p.z}, {name="mcl_core:moss_carpet"}) + elseif math.random(1,10) == 1 then + minetest.set_node({x=p.x, y=p.y+1, z=p.z}, {name="mcl_flowers:double_grass"}) + minetest.set_node({x=p.x, y=p.y+2, z=p.z}, {name="mcl_flowers:double_grass_top"}) + end + end + elseif minetest.registered_nodes[item_name] then + if not minetest.is_creative_enabled(player) then + itemstack:take_item() + end + local set_pos = pointed_thing and pointed_thing.above or {x = pos.x, y = pos.y + 1, z = pos.z} + minetest.set_node(set_pos, {name = item_name}) + end + end, }) minetest.register_node("mcl_core:moss_carpet", { diff --git a/mods/ITEMS/mcl_core/textures/mcl_core_lava_spark.png b/mods/ITEMS/mcl_core/textures/mcl_core_lava_spark.png new file mode 100644 index 000000000..079f7730e Binary files /dev/null and b/mods/ITEMS/mcl_core/textures/mcl_core_lava_spark.png differ diff --git a/mods/ITEMS/mcl_deepslate/init.lua b/mods/ITEMS/mcl_deepslate/init.lua index 7984ba89a..b9770b14b 100644 --- a/mods/ITEMS/mcl_deepslate/init.lua +++ b/mods/ITEMS/mcl_deepslate/init.lua @@ -144,7 +144,7 @@ minetest.register_node("mcl_deepslate:deepslate_with_redstone_lit", { light_source = 9, is_ground_content = true, stack_max = 64, - groups = { pickaxey = 4, not_in_creative_inventory = 1, material_stone = 1, xp = 7}, + groups = { pickaxey = 4, not_in_creative_inventory = 1, material_stone = 1, xp = 7 }, drop = { items = { max_items = 1, diff --git a/mods/ITEMS/mcl_deepslate/locale/mcl_deepslate.fr.tr b/mods/ITEMS/mcl_deepslate/locale/mcl_deepslate.fr.tr index 1305ad387..4948d44ff 100644 --- a/mods/ITEMS/mcl_deepslate/locale/mcl_deepslate.fr.tr +++ b/mods/ITEMS/mcl_deepslate/locale/mcl_deepslate.fr.tr @@ -31,21 +31,21 @@ Deepslate Lapis Lazuli Ore=Minerai de lapis-lazuli de l'ardoise des abîmes Deepslate lapis ore is a variant of lapis ore that can generate in deepslate and tuff blobs.=Le minerai de lapis de l'ardoise des abîmes est une variante de minerai de lapis-lazuli qui apparaît dans l'ardoise des abîmes et les filons de tuf. Deepslate redstone ore is a variant of redstone ore that can generate in deepslate and tuff blobs.=Le minerai de redstone de l'ardoise des abîmes est une variante de minerai de redstone qui apparaît dans l'ardoise des abîmes et les filons de tuf. Deepslate Redstone Ore=Minerai de Redstone de l'ardoise des abîmes -Deepslate tiles are a decorative variant of deepslate.=L''ardoise des abîmes carrelée est une variante décorative de l'ardoise des abîmes. +Deepslate tiles are a decorative variant of deepslate.=L'ardoise des abîmes carrelée est une variante décorative de l'ardoise des abîmes. Deepslate Tiles Slab=Dalle d'ardoise des abîmes carrelée Deepslate Tiles Stairs=Escalier d'ardoise des abîmes carrelée Deepslate Tiles Wall=Muret d'ardoise des abîmes carrelée Deepslate Tiles=Ardoise des abîmes carrelée -Deepslate=Ardoise des abïmes +Deepslate=Ardoise des abîmes Double Cobbled Deepslate Slab=Dalle double de pierre des abîmes Double Deepslate Bricks Slab=Dalle double d'ardoise des abîmes taillée Double Deepslate Tiles Slab=Dalle double d'ardoise des abîmes carrelée -Double Polished Deepslate Slab=Dalle double d'ardoise des abïmes polie +Double Polished Deepslate Slab=Dalle double d'ardoise des abîmes polie Hides a silverfish=Cache un poisson d'argent -Infested Deepslate=Ardoise des abïmes infestée +Infested Deepslate=Ardoise des abîmes infestée Lit Deepslate Redstone Ore=Minerai de Redstone de l'ardoise des abîmes éclairé Polished deepslate is the stone-like polished version of deepslate.=l'ardoise des abîmes polie est la version polie de l'ardoise des abîmes, de manière similaire à la pierre. -Polished Deepslate Slab=Dalle d'ardoise des abïmes -Polished Deepslate Stairs=Escalier d'ardoise des abïmes -Polished Deepslate Wall=Muret d'ardoise des abïmes -Polished Deepslate=Ardoise des abïmes polie \ No newline at end of file +Polished Deepslate Slab=Dalle d'ardoise des abîmes +Polished Deepslate Stairs=Escalier d'ardoise des abîmes +Polished Deepslate Wall=Muret d'ardoise des abîmes +Polished Deepslate=Ardoise des abîmes polie \ No newline at end of file diff --git a/mods/ITEMS/mcl_doors/register.lua b/mods/ITEMS/mcl_doors/register.lua index 8c8b7613f..4d30fcc31 100644 --- a/mods/ITEMS/mcl_doors/register.lua +++ b/mods/ITEMS/mcl_doors/register.lua @@ -5,232 +5,87 @@ local S = minetest.get_translator(minetest.get_current_modname()) local wood_longdesc = S("Wooden doors are 2-block high barriers which can be opened or closed by hand and by a redstone signal.") local wood_usagehelp = S("To open or close a wooden door, rightclick it or supply its lower half with a redstone signal.") ---- Oak Door --- -mcl_doors:register_door("mcl_doors:wooden_door", { - description = S("Oak Door"), - _doc_items_longdesc = wood_longdesc, - _doc_items_usagehelp = wood_usagehelp, - inventory_image = "doors_item_wood.png", - groups = {handy=1,axey=1, material_wood=1, flammable=-1}, - _mcl_hardness = 3, - _mcl_blast_resistance = 3, - tiles_bottom = {"mcl_doors_door_wood_lower.png", "mcl_doors_door_wood_side_lower.png"}, - tiles_top = {"mcl_doors_door_wood_upper.png", "mcl_doors_door_wood_side_upper.png"}, - sounds = mcl_sounds.node_sound_wood_defaults(), -}) +--Register flammable doors-- -minetest.register_craft({ - output = "mcl_doors:wooden_door 3", - recipe = { - {"mcl_core:wood", "mcl_core:wood"}, - {"mcl_core:wood", "mcl_core:wood"}, - {"mcl_core:wood", "mcl_core:wood"} - } -}) +local woods = { + --id, desc, textures, craftitem + {"wooden_door",S("Oak Door"),"doors_item_wood.png",{"mcl_doors_door_wood_lower.png", "mcl_doors_door_wood_side_lower.png"},{"mcl_doors_door_wood_upper.png", "mcl_doors_door_wood_side_upper.png"},"mcl_core:wood"}, + {"acacia_door",S("Acacia Door"),"mcl_doors_door_acacia.png",{"mcl_doors_door_acacia_lower.png", "mcl_doors_door_acacia_side_lower.png"},{"mcl_doors_door_acacia_upper.png", "mcl_doors_door_acacia_side_upper.png"},"mcl_core:acaciawood"}, + {"birch_door",S("Birch Door"),"mcl_doors_door_birch.png",{"mcl_doors_door_birch_lower.png", "mcl_doors_door_birch_side_lower.png"},{"mcl_doors_door_birch_upper.png", "mcl_doors_door_birch_side_upper.png"},"mcl_core:birchwood"}, + {"dark_oak_door",S("Dark Oak Door"),"mcl_doors_door_dark_oak.png",{"mcl_doors_door_dark_oak_lower.png", "mcl_doors_door_dark_oak_side_lower.png"},{"mcl_doors_door_dark_oak_upper.png", "mcl_doors_door_dark_oak_side_upper.png"},"mcl_core:darkwood"}, + {"jungle_door",S("Jungle Door"),"mcl_doors_door_jungle.png",{"mcl_doors_door_jungle_lower.png", "mcl_doors_door_jungle_side_lower.png"},{"mcl_doors_door_jungle_upper.png", "mcl_doors_door_jungle_side_upper.png"},"mcl_core:junglewood"}, + {"spruce_door",S("Spruce Door"),"mcl_doors_door_spruce.png",{"mcl_doors_door_spruce_lower.png", "mcl_doors_door_spruce_side_lower.png"},{"mcl_doors_door_spruce_upper.png", "mcl_doors_door_spruce_side_upper.png"},"mcl_core:sprucewood"}, +} ---- Acacia Door -- -mcl_doors:register_door("mcl_doors:acacia_door", { - description = S("Acacia Door"), - _doc_items_longdesc = wood_longdesc, - _doc_items_usagehelp = wood_usagehelp, - inventory_image = "mcl_doors_door_acacia.png", - groups = {handy=1,axey=1, material_wood=1, flammable=-1}, - _mcl_hardness = 3, - _mcl_blast_resistance = 3, - tiles_bottom = {"mcl_doors_door_acacia_lower.png", "mcl_doors_door_acacia_side_lower.png"}, - tiles_top = {"mcl_doors_door_acacia_upper.png", "mcl_doors_door_acacia_side_upper.png"}, - sounds = mcl_sounds.node_sound_wood_defaults(), -}) +for w=1, #woods do + mcl_doors:register_door("mcl_doors:"..woods[w][1], { + description = woods[w][2], + _doc_items_longdesc = wood_longdesc, + _doc_items_usagehelp = wood_usagehelp, + inventory_image = woods[w][3], + groups = {handy=1,axey=1, material_wood=1, flammable=-1}, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + tiles_bottom = woods[w][4], + tiles_top = woods[w][5], + sounds = mcl_sounds.node_sound_wood_defaults(), + }) -minetest.register_craft({ - output = "mcl_doors:acacia_door 3", - recipe = { - {"mcl_core:acaciawood", "mcl_core:acaciawood"}, - {"mcl_core:acaciawood", "mcl_core:acaciawood"}, - {"mcl_core:acaciawood", "mcl_core:acaciawood"} - } -}) + minetest.register_craft({ + output = "mcl_doors:"..woods[w][1].." 3", + recipe = { + {woods[w][6], woods[w][6]}, + {woods[w][6], woods[w][6]}, + {woods[w][6], woods[w][6]} + } + }) ---- Birch Door -- -mcl_doors:register_door("mcl_doors:birch_door", { - description = S("Birch Door"), - _doc_items_longdesc = wood_longdesc, - _doc_items_usagehelp = wood_usagehelp, - inventory_image = "mcl_doors_door_birch.png", - groups = {handy=1,axey=1, material_wood=1, flammable=-1}, - _mcl_hardness = 3, - _mcl_blast_resistance = 3, - tiles_bottom = {"mcl_doors_door_birch_lower.png", "mcl_doors_door_birch_side_lower.png"}, - tiles_top = {"mcl_doors_door_birch_upper.png", "mcl_doors_door_birch_side_upper.png"}, - sounds = mcl_sounds.node_sound_wood_defaults(), -}) + minetest.register_craft({ + type = "fuel", + recipe = "mcl_doors:"..woods[w][1], + burntime = 10, + }) -minetest.register_craft({ - output = "mcl_doors:birch_door 3", - recipe = { - {"mcl_core:birchwood", "mcl_core:birchwood"}, - {"mcl_core:birchwood", "mcl_core:birchwood"}, - {"mcl_core:birchwood", "mcl_core:birchwood"}, - } -}) +end ---- Dark Oak Door -- -mcl_doors:register_door("mcl_doors:dark_oak_door", { - description = S("Dark Oak Door"), - _doc_items_longdesc = wood_longdesc, - _doc_items_usagehelp = wood_usagehelp, - inventory_image = "mcl_doors_door_dark_oak.png", - groups = {handy=1,axey=1, material_wood=1, flammable=-1}, - _mcl_hardness = 3, - _mcl_blast_resistance = 3, - tiles_bottom = {"mcl_doors_door_dark_oak_lower.png", "mcl_doors_door_dark_oak_side_lower.png"}, - tiles_top = {"mcl_doors_door_dark_oak_upper.png", "mcl_doors_door_dark_oak_side_upper.png"}, - sounds = mcl_sounds.node_sound_wood_defaults(), -}) +--Register non-flammable doors-- -minetest.register_craft({ - output = "mcl_doors:dark_oak_door 3", - recipe = { - {"mcl_core:darkwood", "mcl_core:darkwood"}, - {"mcl_core:darkwood", "mcl_core:darkwood"}, - {"mcl_core:darkwood", "mcl_core:darkwood"}, - } -}) +local woods_nether = { + --id, desc, textures, craftitem + {"crimson_door",S("Crimson Door"),"mcl_doors_door_crimson.png",{"mcl_doors_door_crimson_lower.png", "mcl_doors_door_crimson_side_lower.png"},{"mcl_doors_door_crimson_upper.png", "mcl_doors_door_crimson_side_upper.png"},"mcl_mushroom:crimson_hyphae_wood"}, + {"warped_door",S("Warped Door"),"mcl_doors_door_warped.png",{"mcl_doors_door_warped_lower.png", "mcl_doors_door_warped_side_lower.png"},{"mcl_doors_door_warped_upper.png", "mcl_doors_door_warped_side_upper.png"},"mcl_mushroom:warped_hyphae_wood"}, +} ---- Jungle Door -- -mcl_doors:register_door("mcl_doors:jungle_door", { - description = S("Jungle Door"), - _doc_items_longdesc = wood_longdesc, - _doc_items_usagehelp = wood_usagehelp, - inventory_image = "mcl_doors_door_jungle.png", - groups = {handy=1,axey=1, material_wood=1, flammable=-1}, - _mcl_hardness = 3, - _mcl_blast_resistance = 3, - tiles_bottom = {"mcl_doors_door_jungle_lower.png", "mcl_doors_door_jungle_side_lower.png"}, - tiles_top = {"mcl_doors_door_jungle_upper.png", "mcl_doors_door_jungle_side_upper.png"}, - sounds = mcl_sounds.node_sound_wood_defaults(), -}) +for w=1, #woods_nether do + mcl_doors:register_door("mcl_doors:"..woods_nether[w][1], { + description = woods_nether[w][2], + _doc_items_longdesc = wood_longdesc, + _doc_items_usagehelp = wood_usagehelp, + inventory_image = woods_nether[w][3], + groups = {handy=1,axey=1, material_wood=1}, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + tiles_bottom = woods_nether[w][4], + tiles_top = woods_nether[w][5], + sounds = mcl_sounds.node_sound_wood_defaults(), + }) -minetest.register_craft({ - output = "mcl_doors:jungle_door 3", - recipe = { - {"mcl_core:junglewood", "mcl_core:junglewood"}, - {"mcl_core:junglewood", "mcl_core:junglewood"}, - {"mcl_core:junglewood", "mcl_core:junglewood"} - } -}) + minetest.register_craft({ + output = "mcl_doors:"..woods_nether[w][1].." 3", + recipe = { + {woods_nether[w][6], woods_nether[w][6]}, + {woods_nether[w][6], woods_nether[w][6]}, + {woods_nether[w][6], woods_nether[w][6]} + } + }) ---- Spruce Door -- -mcl_doors:register_door("mcl_doors:spruce_door", { - description = S("Spruce Door"), - _doc_items_longdesc = wood_longdesc, - _doc_items_usagehelp = wood_usagehelp, - inventory_image = "mcl_doors_door_spruce.png", - groups = {handy=1,axey=1, material_wood=1, flammable=-1}, - _mcl_hardness = 3, - _mcl_blast_resistance = 3, - tiles_bottom = {"mcl_doors_door_spruce_lower.png", "mcl_doors_door_spruce_side_lower.png"}, - tiles_top = {"mcl_doors_door_spruce_upper.png", "mcl_doors_door_spruce_side_upper.png"}, - sounds = mcl_sounds.node_sound_wood_defaults(), -}) + minetest.register_craft({ + type = "fuel", + recipe = "mcl_doors:"..woods_nether[w][1], + burntime = 10, + }) -minetest.register_craft({ - output = "mcl_doors:spruce_door 3", - recipe = { - {"mcl_core:sprucewood", "mcl_core:sprucewood"}, - {"mcl_core:sprucewood", "mcl_core:sprucewood"}, - {"mcl_core:sprucewood", "mcl_core:sprucewood"} - } -}) - ---- Crimson Door -- -mcl_doors:register_door("mcl_doors:crimson_door", { - description = S("Crimson Door"), - _doc_items_longdesc = wood_longdesc, - _doc_items_usagehelp = wood_usagehelp, - inventory_image = "mcl_doors_door_crimson.png", - groups = {handy=1,axey=1, material_wood=1, flammable=-1}, - _mcl_hardness = 3, - _mcl_blast_resistance = 3, - tiles_bottom = {"mcl_doors_door_crimson_lower.png", "mcl_doors_door_crimson_side_lower.png"}, - tiles_top = {"mcl_doors_door_crimson_upper.png", "mcl_doors_door_crimson_side_upper.png"}, - sounds = mcl_sounds.node_sound_wood_defaults(), -}) - -minetest.register_craft({ - output = "mcl_doors:crimson_door 3", - recipe = { - {"mcl_mushroom:crimson_hyphae_wood", "mcl_mushroom:crimson_hyphae_wood"}, - {"mcl_mushroom:crimson_hyphae_wood", "mcl_mushroom:crimson_hyphae_wood"}, - {"mcl_mushroom:crimson_hyphae_wood", "mcl_mushroom:crimson_hyphae_wood"} - } -}) - ---- Warped Door -- -mcl_doors:register_door("mcl_doors:warped_door", { - description = S("Warped Door"), - _doc_items_longdesc = wood_longdesc, - _doc_items_usagehelp = wood_usagehelp, - inventory_image = "mcl_doors_door_warped.png", - groups = {handy=1,axey=1, material_wood=1, flammable=-1}, - _mcl_hardness = 3, - _mcl_blast_resistance = 3, - tiles_bottom = {"mcl_doors_door_warped_lower.png", "mcl_doors_door_warped_side_lower.png"}, - tiles_top = {"mcl_doors_door_warped_upper.png", "mcl_doors_door_warped_side_upper.png"}, - sounds = mcl_sounds.node_sound_wood_defaults(), -}) - -minetest.register_craft({ - output = "mcl_doors:warped_door 3", - recipe = { - {"mcl_mushroom:warped_hyphae_wood", "mcl_mushroom:warped_hyphae_wood"}, - {"mcl_mushroom:warped_hyphae_wood", "mcl_mushroom:warped_hyphae_wood"}, - {"mcl_mushroom:warped_hyphae_wood", "mcl_mushroom:warped_hyphae_wood"} - } -}) - -minetest.register_craft({ - type = "fuel", - recipe = "mcl_doors:wooden_door", - burntime = 10, -}) -minetest.register_craft({ - type = "fuel", - recipe = "mcl_doors:jungle_door", - burntime = 10, -}) -minetest.register_craft({ - type = "fuel", - recipe = "mcl_doors:dark_oak_door", - burntime = 10, -}) -minetest.register_craft({ - type = "fuel", - recipe = "mcl_doors:birch_door", - burntime = 10, -}) -minetest.register_craft({ - type = "fuel", - recipe = "mcl_doors:acacia_door", - burntime = 10, -}) -minetest.register_craft({ - type = "fuel", - recipe = "mcl_doors:spruce_door", - burntime = 10, -}) - -minetest.register_craft({ - type = "fuel", - recipe = "mcl_doors:crimson_door", - burntime = 10, -}) - -minetest.register_craft({ - type = "fuel", - recipe = "mcl_doors:warped_door", - burntime = 10, -}) +end --- Iron Door --- mcl_doors:register_door("mcl_doors:iron_door", { @@ -262,6 +117,9 @@ minetest.register_craft({ --[[ Trapdoors ]] + +--Register flammable trapdoors-- + local woods = { -- id, desc, texture, craftitem { "trapdoor", S("Oak Trapdoor"), "doors_trapdoor.png", "doors_trapdoor_side.png", "mcl_core:wood" }, @@ -270,8 +128,6 @@ local woods = { { "spruce_trapdoor", S("Spruce Trapdoor"), "mcl_doors_trapdoor_spruce.png", "mcl_doors_trapdoor_spruce_side.png", "mcl_core:sprucewood" }, { "dark_oak_trapdoor", S("Dark Oak Trapdoor"), "mcl_doors_trapdoor_dark_oak.png", "mcl_doors_trapdoor_dark_oak_side.png", "mcl_core:darkwood" }, { "jungle_trapdoor", S("Jungle Trapdoor"), "mcl_doors_trapdoor_jungle.png", "mcl_doors_trapdoor_jungle_side.png", "mcl_core:junglewood" }, - { "crimson_trapdoor", S("Crimson Trapdoor"), "mcl_doors_trapdoor_crimson.png", "mcl_doors_trapdoor_crimson_side.png", "mcl_mushroom:crimson_hyphae_wood" }, - { "warped_trapdoor", S("Warped Trapdoor"), "mcl_doors_trapdoor_warped.png", "mcl_doors_trapdoor_warped_side.png", "mcl_mushroom:warped_hyphae_wood" }, } for w=1, #woods do @@ -303,6 +159,45 @@ for w=1, #woods do }) end +--Register non-flammable trapdoors-- + +local woods_nether = { + -- id, desc, texture, craftitem + { "crimson_trapdoor", S("Crimson Trapdoor"), "mcl_doors_trapdoor_crimson.png", "mcl_doors_trapdoor_crimson_side.png", "mcl_mushroom:crimson_hyphae_wood" }, + { "warped_trapdoor", S("Warped Trapdoor"), "mcl_doors_trapdoor_warped.png", "mcl_doors_trapdoor_warped_side.png", "mcl_mushroom:warped_hyphae_wood" }, +} + +for w=1, #woods_nether do + mcl_doors:register_trapdoor("mcl_doors:"..woods_nether[w][1], { + description = woods_nether[w][2], + _doc_items_longdesc = S("Wooden trapdoors are horizontal barriers which can be opened and closed by hand or a redstone signal. They occupy the upper or lower part of a block, depending on how they have been placed. When open, they can be climbed like a ladder."), + _doc_items_usagehelp = S("To open or close the trapdoor, rightclick it or send a redstone signal to it."), + tile_front = woods_nether[w][3], + tile_side = woods_nether[w][4], + wield_image = woods_nether[w][3], + groups = {handy=1,axey=1, mesecon_effector_on=1, material_wood=1}, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + sounds = mcl_sounds.node_sound_wood_defaults(), + }) + + minetest.register_craft({ + output = "mcl_doors:"..woods_nether[w][1].." 2", + recipe = { + {woods_nether[w][5], woods_nether[w][5], woods_nether[w][5]}, + {woods_nether[w][5], woods_nether[w][5], woods_nether[w][5]}, + } + }) + + minetest.register_craft({ + type = "fuel", + recipe = "mcl_doors:"..woods_nether[w][1], + burntime = 15, + }) +end + +--Iron Trapdoor-- + mcl_doors:register_trapdoor("mcl_doors:iron_trapdoor", { description = S("Iron Trapdoor"), _doc_items_longdesc = S("Iron trapdoors are horizontal barriers which can only be opened and closed by redstone signals, but not by hand. They occupy the upper or lower part of a block, depending on how they have been placed. When open, they can be climbed like a ladder."), diff --git a/mods/ITEMS/mcl_dye/init.lua b/mods/ITEMS/mcl_dye/init.lua index ca0ca6fe1..09a97e08e 100644 --- a/mods/ITEMS/mcl_dye/init.lua +++ b/mods/ITEMS/mcl_dye/init.lua @@ -281,6 +281,11 @@ local function apply_bone_meal(pointed_thing) if math.random(1, 100) <= 75 then return mcl_farming:grow_plant("plant_beetroot", pos, n, 1, true) end + -- Sweet berry bush advances 1 stage + elseif string.find(n.name, "mcl_farming:sweet_berry_bush_") then + mcl_dye.add_bone_meal_particle(pos) + local stages = 1 + return mcl_farming:grow_plant("plant_sweet_berry_bush", pos, n, stages, true) elseif n.name == "mcl_cocoas:cocoa_1" or n.name == "mcl_cocoas:cocoa_2" then mcl_dye.add_bone_meal_particle(pos) -- Cocoa: Advance by 1 stage diff --git a/mods/ITEMS/mcl_enchanting/engine.lua b/mods/ITEMS/mcl_enchanting/engine.lua index d6407d0bc..7e94580f5 100644 --- a/mods/ITEMS/mcl_enchanting/engine.lua +++ b/mods/ITEMS/mcl_enchanting/engine.lua @@ -271,11 +271,10 @@ function mcl_enchanting.initialize() new_def.groups.not_in_craft_guide = 1 new_def.groups.enchanted = 1 - if new_def._mcl_armor_texture and not type(new_def._mcl_armor_texture) == "function" then - new_def._mcl_armor_texture = new_def._mcl_armor_texture .. mcl_enchanting.overlay - end - if new_def._mcl_armor_preview and not type(new_def._mcl_armor_preview) == "function" then - new_def._mcl_armor_preview = new_def._mcl_armor_preview .. mcl_enchanting.overlay + if new_def._mcl_armor_texture then + if type(new_def._mcl_armor_texture) == "string" then + new_def._mcl_armor_texture = new_def._mcl_armor_texture .. mcl_enchanting.overlay + end end new_def._mcl_enchanting_enchanted_tool = new_name diff --git a/mods/ITEMS/mcl_enchanting/locale/mcl_enchanting.fr.tr b/mods/ITEMS/mcl_enchanting/locale/mcl_enchanting.fr.tr index 57d9d0b93..0e5c784b5 100644 --- a/mods/ITEMS/mcl_enchanting/locale/mcl_enchanting.fr.tr +++ b/mods/ITEMS/mcl_enchanting/locale/mcl_enchanting.fr.tr @@ -1,100 +1,145 @@ # textdomain: mcl_enchanting + + +### enchantments.lua ### + +Arrows passes through multiple objects.=Les flèches traversent plusieurs objets. +Arrows set target on fire.=Les flèches mettent le feu à la cible. +Bane of Arthropods=Fléau des arthropodes +Channeling=Canalisation + +Channels a bolt of lightning toward a target. Works only during thunderstorms and if target is unobstructed with opaque blocks.=Canalise un éclair vers une cible. Fonctionne uniquement pendant les orages et si la cible n'est pas obstruée par des blocs opaques. + +Curse of Vanishing=Malédiction de disparition +Decreases crossbow charging time.=Diminue le temps de chargement de l'arbalète. +Decreases time until rod catches something.=Diminue le temps jusqu'à ce qu'un poisson ne morde à l'hameçon. +Depth Strider=Agilité aquatique +Efficiency=Efficacité +Extends underwater breathing time.=Prolonge le temps de respiration sous l'eau. +Fire Aspect=Aura de feu +Flame=Flamme +Fortune=Fortune +Frost Walker=Semelles givrantes +Impaling=Empalement +Increases arrow damage.=Augmente les dégâts des flèches. +Increases arrow knockback.=Augmente le recul de la flèche. +Increases certain block drops.=Multiplie les items droppés. + +Increases damage and applies Slowness IV to arthropod mobs (spiders, cave spiders, silverfish and endermites).=Augmente les dégâts et applique la lenteur IV aux mobs arthropodes (araignées, araignées des cavernes, lépismes argentés et endermites). + +Increases damage to undead mobs.=Augmente les dégâts infligés aux monstres morts-vivants. +Increases damage.=Augmente les dégâts. +Increases item durability.=Augmente la durabilité des objets. +Increases knockback.=Augmente le recul. +Increases mining speed.=Augmente la vitesse de minage. +Increases mob loot.=Augmente le butin des mobs. +Increases rate of good loot (enchanting books, etc.)=Augmente le taux de bon butin (livres enchanteurs, etc.) +Increases sweeping attack damage.=Augmente les dégâts de l'épée. +Increases underwater movement speed.=Augmente la vitesse de déplacement sous l'eau. +Increases walking speed on soul sand.=Augmente la vitesse de marche sur le sable de l'âme. +Infinity=Infinité +Item destroyed on death.=Objet détruit à la mort. +Knockback=Recul +Looting=Butin +Loyalty=Loyauté +Luck of the Sea=Chance de la mer +Lure=Appât +Mending=Raccommodage +Mined blocks drop themselves.=Les blocs minés tombent d'eux-mêmes. +Multishot=Tir multiple +Piercing=Perforation +Power=Puissance +Punch=Frappe +Quick Charge=Charge rapide +Repair the item while gaining XP orbs.=Réparez l'objet tout en gagnant des points d'XP. +Respiration=Apnée +Riptide=Impulsion +Sets target on fire.=Définit la cible en feu. +Sharpness=Tranchant +Shoot 3 arrows at the cost of one.=Tirez 3 flèches pour le prix d'une. +Shooting consumes no regular arrows.=Le tir ne consomme pas de flèches standard. +Silk Touch=Toucher de soie +Smite=Châtiment +Soul Speed=Agilité des âmes +Sweeping Edge=Affilage +Trident deals additional damage to ocean mobs.=Trident inflige des dégâts supplémentaires aux mobs océaniques. + +Trident launches player with itself when thrown. Works only in water or rain.=Le trident lance le joueur avec lui-même lorsqu'il est lancé. Fonctionne uniquement sous l'eau ou sous la pluie. + +Trident returns after being thrown. Higher levels reduce return time.=Le trident revient après avoir été jeté. Des niveaux plus élevés réduisent le temps de retour. + +Turns water beneath the player into frosted ice and prevents the damage from magma blocks.=Transforme l'eau sous le joueur en glace givrée et empêche les dommages causés par les blocs de magma. + +Unbreaking=Solidité + +### engine.lua ### + +@1 Enchantment Levels=@1 Niveaux d'enchantement +@1 Lapis Lazuli=@1 Lapis Lazuli +Inventory=Inventaire +Level requirement: @1=Niveau requis: @1 + +### init.lua ### + +'@1' is not a valid number='@1' n'est pas un nombre valide +'@1' is not a valid number.='@1' n'est pas un nombre valide. + []= [] +@1 can't be combined with @2.=@1 ne peut être combiné avec @2. + +After finally selecting your enchantment; left-click on the selection, and you will see both the lapis lazuli and your experience levels consumed. And, an enchanted item left in its place.=Après sélection d'un enchantement ; cliquer gauche sur la sélection et vous verrez le lapis lazuli et les niveaux d'expérience consummés. Et, un objet enchanté à la place. + +After placing your items in the slots, the enchanting options will be shown. Hover over the options to read what is available to you.=Après avoir placé les objets dans les cases, les options d'enchantement s'affichent. + +Enchant=Enchantement +Enchant an item=Enchanter un objet +Enchanted Book=Livre enchanté +Enchanting Table=Table d'enchantement + +Spend experience, and lapis to enchant various items.=Dépenser de l'expérience et du lapis pour enchanter des objets variés. +Enchanting Tables will let you enchant armors, tools, weapons, and books with various abilities. But, at the cost of some experience, and lapis lazuli.=Les tables d'enchantement vous permettent d'enchanter des armures, outils, armes et livres avec différents pouvoirs. Mais cela a un coût en expérience et en lapis lazuli. + +Enchanting succeded.=L'enchantement a réussi. +Forcefully enchant an item=Enchantement forcé d'un objet + +Place a tool, armor, weapon or book into the top left slot, and then place 1-3 Lapis Lazuli in the slot to the right.=Placer un outil, armure, arme ou livre dans la case en haut à gauche, puis placer 1-3 lapis lazuli dans la case à droite. + +Player '@1' cannot be found.=Le joueur '@1' est introuvable. +Rightclick the Enchanting Table to open the enchanting menu.=Clic droit sur la Table d'enchantement pour ouvrir le menu d'enchantement. + +The number you have entered (@1) is too big, it must be at most @2.=Le nombre que vous avez entré (@1) est trop grand, il doit être au plus de @2. + +The number you have entered (@1) is too small, it must be at least @2.=Le nombre que vous avez entré (@1) est trop petit, il doit être au moins de @2. + +The selected enchantment can't be added to the target item.=L'enchantement sélectionné ne peut pas être ajouté à la cible. +The target doesn't hold an item.=La cible ne contient aucun élément. +The target item is not enchantable.=L'objet cible n'est pas enchantable. +There is no such enchantment '@1'.=Il n'y a pas un tel enchantement '@1'. + +These options are randomized, and dependent on experience level; but the enchantment strength can be increased.=Ces options sont aléatoires et dépendent du niveau d'expérience ; mais la force de l'enchantement peut être augmentée. + +To increase the enchantment strength, place bookshelves around the enchanting table. However, you will need to keep 1 air node between the table, & the bookshelves to empower the enchanting table.=Pour augmenter la force de l'enchantement, placer des bibliothèques autour de la table d'enchantement. Cependant il faut garder un bloc d'air entre la table et les bibliothèques pour renforcer l'enchantement. + +Usage: /enchant []=Usage : /enchant [] +Usage: /forceenchant []=Usage : /forceenchant [] + + +##### not used anymore ##### + +# textdomain: mcl_enchanting + Aqua Affinity=Affinité aquatique Increases underwater mining speed.=Augmente la vitesse de minage sous-marine. -Bane of Arthropods=Fléau des arthropodes -Increases damage and applies Slowness IV to arthropod mobs (spiders, cave spiders, silverfish and endermites).=Augmente les dégâts et applique la lenteur IV aux mobs arthropodes (araignées, araignées des cavernes, lépismes argentés et endermites). Blast Protection=Protection contre les explosions Reduces explosion damage and knockback.=Réduit les dégâts d'explosion et de recul. -Channeling=Canalisation -Channels a bolt of lightning toward a target. Works only during thunderstorms and if target is unobstructed with opaque blocks.=Canalise un éclair vers une cible. Fonctionne uniquement pendant les orages et si la cible n'est pas obstruée par des blocs opaques. Curse of Binding=Malédiction du lien éternel Item cannot be removed from armor slots except due to death, breaking or in Creative Mode.=L'objet ne peut pas être retiré des emplacements d'armure sauf en cas de mort, de rupture ou en mode créatif. -Curse of Vanishing=Malédiction de disparition -Item destroyed on death.=Objet détruit à la mort. -Depth Strider=Agilité aquatique -Increases underwater movement speed.=Augmente la vitesse de déplacement sous l'eau. -Efficiency=Efficacité -Increases mining speed.=Augmente la vitesse de minage. Feather Falling=Chute amortie Reduces fall damage.=Réduit les dégats de chute. -Fire Aspect=Aura de feu -Sets target on fire.=Définit la cible en feu. Fire Protection=Protection contre le feu Reduces fire damage.=Reduit les dégats de feu. -Flame=Flamme -Arrows set target on fire.=Les flèches mettent le feu à la cible. -Fortune=Fortune -Increases certain block drops.=Multiplie les items droppés -Frost Walker=Semelles givrantes -Turns water beneath the player into frosted ice and prevents the damage from magma blocks.=Transforme l'eau sous le joueur en glace givrée et empêche les dommages causés par les blocs de magma. -Impaling=Empalement -Trident deals additional damage to ocean mobs.=Trident inflige des dégâts supplémentaires aux mobs océaniques. -Infinity=Infinité -Shooting consumes no regular arrows.=Le tir ne consomme pas de flèches standard. -Knockback=Recul -Increases knockback.=Augmente le recul. -Looting=Butin -Increases mob loot.=Augmente le butin des mobs. -Loyalty=Loyauté -Trident returns after being thrown. Higher levels reduce return time.=Le trident revient après avoir été jeté. Des niveaux plus élevés réduisent le temps de retour. -Luck of the Sea=Chance de la mer -Increases rate of good loot (enchanting books, etc.)=Augmente le taux de bon butin (livres enchanteurs, etc.) -Lure=Appât -Decreases time until rod catches something.=Diminue le temps jusqu'à ce qu'un poisson ne morde à l'hameçon. -Mending=Raccommodage -Repair the item while gaining XP orbs.=Réparez l'objet tout en gagnant des points d'XP. -Multishot=Tir multiple -Shoot 3 arrows at the cost of one.=Tirez sur 3 flèches au prix d'une. -Piercing=Perforation -Arrows passes through multiple objects.=Les flèches traversent plusieurs objets. -Power=Puissance -Increases arrow damage.=Augmente les dégâts des flèches. Projectile Protection=Protection contre les projectiles Reduces projectile damage.=Réduit les dommages causés par les projectiles. Protection=Protection Reduces most types of damage by 4% for each level.=Réduit la plupart des types de dégâts de 4% pour chaque niveau. -Punch=Frappe -Increases arrow knockback.=Augmente le recul de la flèche. -Quick Charge=Charge rapide -Decreases crossbow charging time.=Diminue le temps de chargement de l'arbalète. -Respiration=Apnée -Extends underwater breathing time.=Prolonge le temps de respiration sous l'eau. -Riptide=Impulsion -Trident launches player with itself when thrown. Works only in water or rain.=Le trident lance le joueur avec lui-même lorsqu'il est lancé. Fonctionne uniquement sous l'eau ou sous la pluie. -Sharpness=Tranchant -Increases damage.=Augmente les dégâts. -Silk Touch=Toucher de soie -Mined blocks drop themselves.=Les blocs minés tombent d'eux-mêmes. -Smite=Châtiment -Increases damage to undead mobs.=Augmente les dégâts infligés aux monstres morts-vivants. -Soul Speed=Agilité des âmes -Increases walking speed on soul sand.=Augmente la vitesse de marche sur le sable de l'âme. -Sweeping Edge=Affilage -Increases sweeping attack damage.=Augmente les dégâts de l'épée Thorns=Épines Reflects some of the damage taken when hit, at the cost of reducing durability with each proc.=Reflète une partie des dégâts subis lors de la frappe, au prix d'une réduction de la durabilité à chaque déclenchement. -Unbreaking=Solidité -Increases item durability.=Augmente la durabilité des objets. -Inventory=Inventaire -@1 Lapis Lazuli=@1 Lapis Lazuli -@1 Enchantment Levels=@1 Niveaux d'enchantement -Level requirement: @1=Niveau requis: @1 -Enchant an item=Enchanter un objet - []= [] -Usage: /enchant []=Usage: /enchant [] -Player '@1' cannot be found.=Le joueur '@1' est introuvable. -There is no such enchantment '@1'.=Il n'y a pas un tel enchantement '@1'. -The target doesn't hold an item.=La cible ne contient aucun élément. -The selected enchantment can't be added to the target item.=L'enchantement sélectionné ne peut pas être ajouté à la cible. -'@1' is not a valid number='@1' n'est pas un nombre valide -The number you have entered (@1) is too big, it must be at most @2.=Le nombre que vous avez entré (@1) est trop grand, il doit être au plus de @2. -The number you have entered (@1) is too small, it must be at least @2.=Le nombre que vous avez entré (@1) est trop petit, il doit être au moins de @2. -@1 can't be combined with @2.=@1 ne peut pas être combiné avec @2. -Enchanting succeded.=L'enchantement a réussi. -Forcefully enchant an item=Enchantement forcé d'un objet -Usage: /forceenchant []=Usage: /forceenchant [] -The target item is not enchantable.=L'objet cible n'est pas enchantable. -'@1' is not a valid number.='@1' n'est pas un nombre valide. -Enchanted Book=Livre enchanté -Enchanting Table=Table d'enchantement -Enchant=Enchantement diff --git a/mods/ITEMS/mcl_enchanting/locale/template.txt b/mods/ITEMS/mcl_enchanting/locale/template.txt index c459a308b..9356853d6 100644 --- a/mods/ITEMS/mcl_enchanting/locale/template.txt +++ b/mods/ITEMS/mcl_enchanting/locale/template.txt @@ -105,7 +105,6 @@ Place a tool, armor, weapon or book into the top left slot, and then place 1-3 L Player '@1' cannot be found.= Rightclick the Enchanting Table to open the enchanting menu.= -Spend experience, and lapis to enchant various items.= The number you have entered (@1) is too big, it must be at most @2.= @@ -127,4 +126,20 @@ Usage: /forceenchant []= ##### not used anymore ##### # textdomain: mcl_enchanting + Aqua Affinity= +Increases underwater mining speed.= +Blast Protection= +Reduces explosion damage and knockback.= +Curse of Binding=Malédiction du lien éternel +Item cannot be removed from armor slots except due to death, breaking or in Creative Mode.= +Feather Falling= +Reduces fall damage.= +Fire Protection= +Reduces fire damage.= +Projectile Protection= +Reduces projectile damage.= +Protection= +Reduces most types of damage by 4% for each level.= +Thorns= +Reflects some of the damage taken when hit, at the cost of reducing durability with each proc.= diff --git a/mods/ITEMS/mcl_end/textures/mcl_end_crystal_beam.png b/mods/ITEMS/mcl_end/textures/mcl_end_crystal_beam.png index 1259a5d0e..42b05a17f 100644 Binary files a/mods/ITEMS/mcl_end/textures/mcl_end_crystal_beam.png and b/mods/ITEMS/mcl_end/textures/mcl_end_crystal_beam.png differ diff --git a/mods/ITEMS/mcl_farming/locale/mcl_farming.fr.tr b/mods/ITEMS/mcl_farming/locale/mcl_farming.fr.tr index b2fa8265d..3049a8957 100644 --- a/mods/ITEMS/mcl_farming/locale/mcl_farming.fr.tr +++ b/mods/ITEMS/mcl_farming/locale/mcl_farming.fr.tr @@ -96,4 +96,6 @@ Turns block into farmland=Transforme un bloc en terres agricoles 60% chance of poisoning=60% de chances d'empoisonnement Surface for crops=Surface pour les cultures Can become wet=Peut devenir humide -Uses: @1=Utilisations: @1 \ No newline at end of file +Uses: @1=Utilisations: @1 +Sweet Berry=Baies sucrées +Sweet Berry Bush (Stage @1)=Buisson à Baies sucrées \ No newline at end of file diff --git a/mods/ITEMS/mcl_farming/pumpkin.lua b/mods/ITEMS/mcl_farming/pumpkin.lua index 72d0057dc..ddaa49e02 100644 --- a/mods/ITEMS/mcl_farming/pumpkin.lua +++ b/mods/ITEMS/mcl_farming/pumpkin.lua @@ -120,7 +120,6 @@ pumpkin_face_base_def._mcl_armor_mob_range_factor = 0 pumpkin_face_base_def._mcl_armor_mob_range_mob = "mobs_mc:enderman" pumpkin_face_base_def._mcl_armor_element = "head" pumpkin_face_base_def._mcl_armor_texture = "mcl_farming_pumpkin_face.png" -pumpkin_face_base_def._mcl_armor_preview = "mcl_farming_pumpkin_face_preview.png" if minetest.get_modpath("mcl_armor") then local pumpkin_hud = {} diff --git a/mods/ITEMS/mcl_farming/shared_functions.lua b/mods/ITEMS/mcl_farming/shared_functions.lua index e942415f5..8c712f8f2 100644 --- a/mods/ITEMS/mcl_farming/shared_functions.lua +++ b/mods/ITEMS/mcl_farming/shared_functions.lua @@ -129,7 +129,7 @@ function mcl_farming:grow_plant(identifier, pos, node, stages, ignore_light, low if not stages then stages = 1 end - stages = stages + math.ceil(intervals_counter) + stages = stages + math.floor(intervals_counter) local new_node = {name = plant_info.names[step+stages]} if new_node.name == nil then new_node.name = plant_info.full_grown diff --git a/mods/ITEMS/mcl_farming/sweet_berry.lua b/mods/ITEMS/mcl_farming/sweet_berry.lua index f215851e3..cde2f8d97 100644 --- a/mods/ITEMS/mcl_farming/sweet_berry.lua +++ b/mods/ITEMS/mcl_farming/sweet_berry.lua @@ -63,3 +63,6 @@ minetest.register_decoration({ y_min = 2, decoration = "mcl_sweet_berry:sweet_berry_bush_3" }) + +-- TODO: Find proper interval and chance values for sweet berry bushes. Current interval and chance values are copied from mcl_farming:beetroot which has similar growth stages. +mcl_farming:add_plant("plant_sweet_berry_bush", "mcl_farming:sweet_berry_bush_3", {"mcl_farming:sweet_berry_bush_0", "mcl_farming:sweet_berry_bush_1", "mcl_farming:sweet_berry_bush_2"}, 68, 3) \ No newline at end of file diff --git a/mods/ITEMS/mcl_farming/textures/mcl_farming_pumpkin_face_preview.png b/mods/ITEMS/mcl_farming/textures/mcl_farming_pumpkin_face_preview.png deleted file mode 100644 index a151fcab6..000000000 Binary files a/mods/ITEMS/mcl_farming/textures/mcl_farming_pumpkin_face_preview.png and /dev/null differ diff --git a/mods/ITEMS/mcl_fishing/init.lua b/mods/ITEMS/mcl_fishing/init.lua index 788e591dc..172b07ac3 100644 --- a/mods/ITEMS/mcl_fishing/init.lua +++ b/mods/ITEMS/mcl_fishing/init.lua @@ -75,6 +75,7 @@ local fish = function(itemstack, player, pointed_thing) stacks_min = 1, stacks_max = 1, }, pr) + awards.unlock(player:get_player_name(), "mcl:fishyBusiness") elseif r <= junk_value then -- Junk items = mcl_loot.get_loot({ @@ -385,7 +386,7 @@ minetest.register_tool("mcl_fishing:fishing_rod", { _doc_items_usagehelp = S("Rightclick to launch the bobber. When it sinks right-click again to reel in an item. Who knows what you're going to catch?"), groups = { tool=1, fishing_rod=1, enchantability=1 }, inventory_image = "mcl_fishing_fishing_rod.png", - wield_image = "mcl_fishing_fishing_rod.png^[transformR270", + wield_image = "mcl_fishing_fishing_rod.png^[transformFY^[transformR90", wield_scale = { x = 1.5, y = 1.5, z = 1 }, stack_max = 1, on_place = fish, @@ -426,7 +427,7 @@ minetest.register_craftitem("mcl_fishing:fish_raw", { on_place = minetest.item_eat(2), on_secondary_use = minetest.item_eat(2), stack_max = 64, - groups = { food=2, eatable = 2 }, + groups = { food=2, eatable = 2, smoker_cookable = 1 }, _mcl_saturation = 0.4, }) @@ -456,7 +457,7 @@ minetest.register_craftitem("mcl_fishing:salmon_raw", { on_place = minetest.item_eat(2), on_secondary_use = minetest.item_eat(2), stack_max = 64, - groups = { food=2, eatable = 2 }, + groups = { food=2, eatable = 2, smoker_cookable = 1 }, _mcl_saturation = 0.4, }) @@ -511,3 +512,25 @@ minetest.register_on_item_eat(function (hp_change, replace_with_item, itemstack, end end ) + +-- Fish Buckets +fish_names = {"cod", "salmon"} + +for _, fish in ipairs(fish_names) do + mcl_buckets.register_liquid({ + bucketname = "mcl_fishing:bucket_" .. fish, + source_place = function(pos) + minetest.add_entity(pos, "extra_mobs:" .. fish) + return "mcl_core:water_source" + end, + source_take = {"extra_mobs:" .. fish}, + inventory_image = fish .. "_bucket.png", + name = S("Bucket of @1", S(fish)), + longdesc = S("This bucket is filled with water and @1.", S(fish)), + usagehelp = S("Place it to empty the bucket and place a @1. Obtain by right clicking on a @2 fish with a bucket of water.", S(fish), S(fish)), + tt_help = S("Places a water source and a @1 fish.", S(fish)), + extra_check = function(pos, placer) + return true, true + end, + }) +end diff --git a/mods/ITEMS/mcl_fishing/locale/mcl_fishing.fr.tr b/mods/ITEMS/mcl_fishing/locale/mcl_fishing.fr.tr index 2bac42bbd..638f93bb2 100644 --- a/mods/ITEMS/mcl_fishing/locale/mcl_fishing.fr.tr +++ b/mods/ITEMS/mcl_fishing/locale/mcl_fishing.fr.tr @@ -16,3 +16,9 @@ Pufferfish=Poisson-Globe Pufferfish are a common species of fish and can be obtained by fishing. They can technically be eaten, but they are very bad for humans. Eating a pufferfish only restores 1 hunger point and will poison you very badly (which drains your health non-fatally) and causes serious food poisoning (which increases your hunger).=Le poisson-globe est une espèce de poisson commune et peut être obtenu par la pêche. Ils peuvent techniquement être mangés, mais ils sont très mauvais pour les humains. Manger un poisson-globe ne restaure que 1 point de faim et vous empoisonnera fortement (ce qui draine votre santé de manière non fatale) et provoque une grave intoxication alimentaire (qui augmente votre faim). Catches fish in water=Attrape les poissons dans l'eau Very poisonous=Très toxique +cod=morue +salmon=saumon +Bucket of @1=Seau de @1 +This bucket is filled with water and @1.=Ce seau est rempli d'eau et de @1 +Place it to empty the bucket and place a @1. Obtain by right clicking on a @2 fish with a bucket of water.=Placez le pour vider le seau et placer un @1. Obtenu en cliquant droit sur un poisson @2 avec un seau d'eau. +Places a water source and a @1 fish.=Place une source d'eau et un poisson @1 diff --git a/mods/ITEMS/mcl_fishing/locale/template.txt b/mods/ITEMS/mcl_fishing/locale/template.txt index a1544666b..200f5e145 100644 --- a/mods/ITEMS/mcl_fishing/locale/template.txt +++ b/mods/ITEMS/mcl_fishing/locale/template.txt @@ -16,3 +16,9 @@ Pufferfish= Pufferfish are a common species of fish and can be obtained by fishing. They can technically be eaten, but they are very bad for humans. Eating a pufferfish only restores 1 hunger point and will poison you very badly (which drains your health non-fatally) and causes serious food poisoning (which increases your hunger).= Catches fish in water= Very poisonous= +cod= +salmon= +Bucket of @1= +This bucket is filled with water and @1.= +Place it to empty the bucket and place a @1. Obtain by right clicking on a @2 fish with a bucket of water.= +Places a water source and a @1 fish.= diff --git a/mods/ITEMS/mcl_fishing/textures/cod_bucket.png b/mods/ITEMS/mcl_fishing/textures/cod_bucket.png new file mode 100644 index 000000000..582207cb0 Binary files /dev/null and b/mods/ITEMS/mcl_fishing/textures/cod_bucket.png differ diff --git a/mods/ITEMS/mcl_fishing/textures/mcl_fishing_fishing_rod.png b/mods/ITEMS/mcl_fishing/textures/mcl_fishing_fishing_rod.png index 2fbcc7344..d1cd9dd03 100644 Binary files a/mods/ITEMS/mcl_fishing/textures/mcl_fishing_fishing_rod.png and b/mods/ITEMS/mcl_fishing/textures/mcl_fishing_fishing_rod.png differ diff --git a/mods/ITEMS/mcl_fishing/textures/pufferfish_bucket.png b/mods/ITEMS/mcl_fishing/textures/pufferfish_bucket.png new file mode 100644 index 000000000..2c88bac35 Binary files /dev/null and b/mods/ITEMS/mcl_fishing/textures/pufferfish_bucket.png differ diff --git a/mods/ITEMS/mcl_fishing/textures/salmon_bucket.png b/mods/ITEMS/mcl_fishing/textures/salmon_bucket.png new file mode 100644 index 000000000..b9ac22fd9 Binary files /dev/null and b/mods/ITEMS/mcl_fishing/textures/salmon_bucket.png differ diff --git a/mods/ITEMS/mcl_fishing/textures/tropical_fish_bucket.png b/mods/ITEMS/mcl_fishing/textures/tropical_fish_bucket.png new file mode 100644 index 000000000..edf7dd244 Binary files /dev/null and b/mods/ITEMS/mcl_fishing/textures/tropical_fish_bucket.png differ diff --git a/mods/ITEMS/mcl_fletching_table/README.md b/mods/ITEMS/mcl_fletching_table/README.md new file mode 100644 index 000000000..a30e2c1b4 --- /dev/null +++ b/mods/ITEMS/mcl_fletching_table/README.md @@ -0,0 +1,19 @@ +mcl_fletching_table +------------------- +Fletching Tables, by PrairieWind + +Adds Fletching Tables to MineClone 2/5. + +License of source code +---------------------- +LGPLv2.1 + +License of media +---------------- + +fletching_table_bottom.png +fletching_table_front.png +fletching_table_side.png +fletching_table_top.png +License: CC BY-SA 4.0 +Author: MrRar diff --git a/mods/ITEMS/mcl_fletching_table/init.lua b/mods/ITEMS/mcl_fletching_table/init.lua new file mode 100644 index 000000000..686a1dc2c --- /dev/null +++ b/mods/ITEMS/mcl_fletching_table/init.lua @@ -0,0 +1,25 @@ +local S = minetest.get_translator(minetest.get_current_modname()) +-- Fletching Table Code. No use as of current Minecraft Updates. Basically a decor block. As of now, this is complete. +minetest.register_node("mcl_fletching_table:fletching_table", { + description = S("Fletching Table"), + _tt_help = S("A fletching table"), + _doc_items_longdesc = S("This is the fletcher villager's work station. It currently has no use beyond decoration."), + tiles = { + "fletching_table_top.png", "fletching_table_bottom.png", + "fletching_table_front.png", "fletching_table_front.png", + "fletching_table_side.png", "fletching_table_side.png" + }, + paramtype2 = "facedir", + groups = { axey = 2, handy = 1, deco_block = 1, material_wood = 1, flammable = 1 }, + _mcl_blast_resistance = 2.5, + _mcl_hardness = 2.5 + }) + +minetest.register_craft({ + output = "mcl_fletching_table:fletching_table", + recipe = { + { "mcl_core:flint", "mcl_core:flint", "" }, + { "group:wood", "group:wood", "" }, + { "group:wood", "group:wood", "" }, + } +}) \ No newline at end of file diff --git a/mods/ITEMS/mcl_fletching_table/locale/mcl_fletching_table.fr.tr b/mods/ITEMS/mcl_fletching_table/locale/mcl_fletching_table.fr.tr new file mode 100644 index 000000000..cea6ab417 --- /dev/null +++ b/mods/ITEMS/mcl_fletching_table/locale/mcl_fletching_table.fr.tr @@ -0,0 +1,4 @@ +# textdomain: mcl_fletching_table +Fletching Table=Table d'Archerie +A fletching table=une table d'archerie +This is the fletcher villager's work station. It currently has no use beyond decoration.=Ceci est le poste de travail du villageois fléchier. Il n'a actuellement aucune autre utilité que la décoration. \ No newline at end of file diff --git a/mods/ITEMS/mcl_fletching_table/locale/template.txt b/mods/ITEMS/mcl_fletching_table/locale/template.txt new file mode 100644 index 000000000..b42ea2578 --- /dev/null +++ b/mods/ITEMS/mcl_fletching_table/locale/template.txt @@ -0,0 +1,4 @@ +# textdomain: mcl_fletching_table +Fletching Table= +A fletching table= +This is the fletcher villager's work station. It currently has no use beyond decoration.= \ No newline at end of file diff --git a/mods/ITEMS/mcl_fletching_table/mod.conf b/mods/ITEMS/mcl_fletching_table/mod.conf new file mode 100644 index 000000000..5a4e9a900 --- /dev/null +++ b/mods/ITEMS/mcl_fletching_table/mod.conf @@ -0,0 +1,3 @@ +name = mcl_fletching_table +author = PrairieWind +description = Adds the fletching table villager workstation to MineClone 2/5. diff --git a/mods/ITEMS/mcl_fletching_table/textures/fletching_table_bottom.png b/mods/ITEMS/mcl_fletching_table/textures/fletching_table_bottom.png new file mode 100644 index 000000000..5c1289766 Binary files /dev/null and b/mods/ITEMS/mcl_fletching_table/textures/fletching_table_bottom.png differ diff --git a/mods/ITEMS/mcl_fletching_table/textures/fletching_table_front.png b/mods/ITEMS/mcl_fletching_table/textures/fletching_table_front.png new file mode 100644 index 000000000..091389e26 Binary files /dev/null and b/mods/ITEMS/mcl_fletching_table/textures/fletching_table_front.png differ diff --git a/mods/ITEMS/mcl_fletching_table/textures/fletching_table_side.png b/mods/ITEMS/mcl_fletching_table/textures/fletching_table_side.png new file mode 100644 index 000000000..33ff2842f Binary files /dev/null and b/mods/ITEMS/mcl_fletching_table/textures/fletching_table_side.png differ diff --git a/mods/ITEMS/mcl_fletching_table/textures/fletching_table_top.png b/mods/ITEMS/mcl_fletching_table/textures/fletching_table_top.png new file mode 100644 index 000000000..e6088e7d2 Binary files /dev/null and b/mods/ITEMS/mcl_fletching_table/textures/fletching_table_top.png differ diff --git a/mods/ITEMS/mcl_furnaces/furnace.lua b/mods/ITEMS/mcl_furnaces/furnace.lua deleted file mode 100644 index 81bef41f7..000000000 --- a/mods/ITEMS/mcl_furnaces/furnace.lua +++ /dev/null @@ -1,558 +0,0 @@ -local S = minetest.get_translator(minetest.get_current_modname()) - -local LIGHT_ACTIVE_FURNACE = 13 - --- --- Formspecs --- - -local function active_formspec(fuel_percent, item_percent) - return "size[9,8.75]".. - "label[0,4;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]".. - "list[current_player;main;0,4.5;9,3;9]".. - mcl_formspec.get_itemslot_bg(0,4.5,9,3).. - "list[current_player;main;0,7.74;9,1;]".. - mcl_formspec.get_itemslot_bg(0,7.74,9,1).. - "label[2.75,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Furnace"))).."]".. - "list[context;src;2.75,0.5;1,1;]".. - mcl_formspec.get_itemslot_bg(2.75,0.5,1,1).. - "list[context;fuel;2.75,2.5;1,1;]".. - mcl_formspec.get_itemslot_bg(2.75,2.5,1,1).. - "list[context;dst;5.75,1.5;1,1;]".. - mcl_formspec.get_itemslot_bg(5.75,1.5,1,1).. - "image[2.75,1.5;1,1;default_furnace_fire_bg.png^[lowpart:".. - (100-fuel_percent)..":default_furnace_fire_fg.png]".. - "image[4.1,1.5;1.5,1;gui_furnace_arrow_bg.png^[lowpart:".. - (item_percent)..":gui_furnace_arrow_fg.png^[transformR270]".. - -- Craft guide button temporarily removed due to Minetest bug. - -- TODO: Add it back when the Minetest bug is fixed. - --"image_button[8,0;1,1;craftguide_book.png;craftguide;]".. - --"tooltip[craftguide;"..minetest.formspec_escape(S("Recipe book")).."]".. - "listring[context;dst]".. - "listring[current_player;main]".. - "listring[context;src]".. - "listring[current_player;main]".. - "listring[context;fuel]".. - "listring[current_player;main]" -end - -local inactive_formspec = "size[9,8.75]".. - "label[0,4;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]".. - "list[current_player;main;0,4.5;9,3;9]".. - mcl_formspec.get_itemslot_bg(0,4.5,9,3).. - "list[current_player;main;0,7.74;9,1;]".. - mcl_formspec.get_itemslot_bg(0,7.74,9,1).. - "label[2.75,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Furnace"))).."]".. - "list[context;src;2.75,0.5;1,1;]".. - mcl_formspec.get_itemslot_bg(2.75,0.5,1,1).. - "list[context;fuel;2.75,2.5;1,1;]".. - mcl_formspec.get_itemslot_bg(2.75,2.5,1,1).. - "list[context;dst;5.75,1.5;1,1;]".. - mcl_formspec.get_itemslot_bg(5.75,1.5,1,1).. - "image[2.75,1.5;1,1;default_furnace_fire_bg.png]".. - "image[4.1,1.5;1.5,1;gui_furnace_arrow_bg.png^[transformR270]".. - -- Craft guide button temporarily removed due to Minetest bug. - -- TODO: Add it back when the Minetest bug is fixed. - --"image_button[8,0;1,1;craftguide_book.png;craftguide;]".. - --"tooltip[craftguide;"..minetest.formspec_escape(S("Recipe book")).."]".. - "listring[context;dst]".. - "listring[current_player;main]".. - "listring[context;src]".. - "listring[current_player;main]".. - "listring[context;fuel]".. - "listring[current_player;main]" - -local receive_fields = function(pos, formname, fields, sender) - if fields.craftguide then - mcl_craftguide.show(sender:get_player_name()) - end -end - -local function give_xp(pos, player) - local meta = minetest.get_meta(pos) - local dir = vector.divide(minetest.facedir_to_dir(minetest.get_node(pos).param2),-1.95) - local xp = meta:get_int("xp") - if xp > 0 then - if player then - mcl_experience.add_xp(player, xp) - else - mcl_experience.throw_xp(vector.add(pos, dir), xp) - end - meta:set_int("xp", 0) - end -end - --- --- Node callback functions that are the same for active and inactive furnace --- - -local function allow_metadata_inventory_put(pos, listname, index, stack, player) - local name = player:get_player_name() - if minetest.is_protected(pos, name) then - minetest.record_protection_violation(pos, name) - return 0 - end - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - if listname == "fuel" then - -- Special case: empty bucket (not a fuel, but used for sponge drying) - if stack:get_name() == "mcl_buckets:bucket_empty" then - if inv:get_stack(listname, index):get_count() == 0 then - return 1 - else - return 0 - end - end - - -- Test stack with size 1 because we burn one fuel at a time - local teststack = ItemStack(stack) - teststack:set_count(1) - local output, decremented_input = minetest.get_craft_result({method="fuel", width=1, items={teststack}}) - if output.time ~= 0 then - -- Only allow to place 1 item if fuel get replaced by recipe. - -- This is the case for lava buckets. - local replace_item = decremented_input.items[1] - if replace_item:is_empty() then - -- For most fuels, just allow to place everything - return stack:get_count() - else - if inv:get_stack(listname, index):get_count() == 0 then - return 1 - else - return 0 - end - end - else - return 0 - end - elseif listname == "src" then - return stack:get_count() - elseif listname == "dst" then - return 0 - end -end - -local function allow_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - local stack = inv:get_stack(from_list, from_index) - return allow_metadata_inventory_put(pos, to_list, to_index, stack, player) -end - -local function allow_metadata_inventory_take(pos, listname, index, stack, player) - local name = player:get_player_name() - if minetest.is_protected(pos, name) then - minetest.record_protection_violation(pos, name) - return 0 - end - return stack:get_count() -end - -local function on_metadata_inventory_take(pos, listname, index, stack, player) - -- Award smelting achievements - if listname == "dst" then - if stack:get_name() == "mcl_core:iron_ingot" then - awards.unlock(player:get_player_name(), "mcl:acquireIron") - elseif stack:get_name() == "mcl_fishing:fish_cooked" then - awards.unlock(player:get_player_name(), "mcl:cookFish") - end - give_xp(pos, player) - end -end - -local function on_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player) - if from_list == "dst" then - give_xp(pos, player) - end -end - -local function spawn_flames(pos, param2) - local minrelpos, maxrelpos - local dir = minetest.facedir_to_dir(param2) - if dir.x > 0 then - minrelpos = { x = -0.6, y = -0.05, z = -0.25 } - maxrelpos = { x = -0.55, y = -0.45, z = 0.25 } - elseif dir.x < 0 then - minrelpos = { x = 0.55, y = -0.05, z = -0.25 } - maxrelpos = { x = 0.6, y = -0.45, z = 0.25 } - elseif dir.z > 0 then - minrelpos = { x = -0.25, y = -0.05, z = -0.6 } - maxrelpos = { x = 0.25, y = -0.45, z = -0.55 } - elseif dir.z < 0 then - minrelpos = { x = -0.25, y = -0.05, z = 0.55 } - maxrelpos = { x = 0.25, y = -0.45, z = 0.6 } - else - return - end - mcl_particles.add_node_particlespawner(pos, { - amount = 4, - time = 0, - minpos = vector.add(pos, minrelpos), - maxpos = vector.add(pos, maxrelpos), - minvel = { x = -0.01, y = 0, z = -0.01 }, - maxvel = { x = 0.01, y = 0.1, z = 0.01 }, - minexptime = 0.3, - maxexptime = 0.6, - minsize = 0.4, - maxsize = 0.8, - texture = "mcl_particles_flame.png", - glow = LIGHT_ACTIVE_FURNACE, - }, "low") -end - -local function swap_node(pos, name) - local node = minetest.get_node(pos) - if node.name == name then - return - end - node.name = name - minetest.swap_node(pos, node) - if name == "mcl_furnaces:furnace_active" then - spawn_flames(pos, node.param2) - else - mcl_particles.delete_node_particlespawners(pos) - end -end - -local function furnace_node_timer(pos, elapsed) - -- - -- Inizialize metadata - -- - local meta = minetest.get_meta(pos) - local fuel_time = meta:get_float("fuel_time") or 0 - local src_time = meta:get_float("src_time") or 0 - local src_item = meta:get_string("src_item") or "" - local fuel_totaltime = meta:get_float("fuel_totaltime") or 0 - - local inv = meta:get_inventory() - local srclist, fuellist - - local cookable, cooked - local active = true - local fuel - - srclist = inv:get_list("src") - fuellist = inv:get_list("fuel") - - -- Check if src item has been changed - if srclist[1]:get_name() ~= src_item then - -- Reset cooking progress in this case - src_time = 0 - src_item = srclist[1]:get_name() - end - - local update = true - local elapsed_game_time = mcl_time.get_irl_seconds_passed_at_pos_or_nil(pos) or elapsed - while elapsed_game_time > 0.00001 and update do - -- - -- Cooking - -- - - local el = elapsed_game_time - - -- Check if we have cookable content: cookable - local aftercooked - cooked, aftercooked = minetest.get_craft_result({method = "cooking", width = 1, items = srclist}) - cookable = cooked.time ~= 0 - if cookable then - -- Successful cooking requires space in dst slot and time - if not inv:room_for_item("dst", cooked.item) then - cookable = false - end - end - - if cookable then -- fuel lasts long enough, adjust el to cooking duration - el = math.min(el, cooked.time - src_time) - end - - -- Check if we have enough fuel to burn - active = fuel_time < fuel_totaltime - if cookable and not active then - -- We need to get new fuel - local afterfuel - fuel, afterfuel = minetest.get_craft_result({method = "fuel", width = 1, items = fuellist}) - - if fuel.time == 0 then - -- No valid fuel in fuel list -- stop - fuel_totaltime = 0 - src_time = 0 - update = false - else - -- Take fuel from fuel list - inv:set_stack("fuel", 1, afterfuel.items[1]) - fuel_time = 0 - fuel_totaltime = fuel.time - el = math.min(el, fuel_totaltime) - active = true - fuellist = inv:get_list("fuel") - end - elseif active then - el = math.min(el, fuel_totaltime - fuel_time) - -- The furnace is currently active and has enough fuel - fuel_time = fuel_time + el - end - - -- If there is a cookable item then check if it is ready yet - if cookable and active then - src_time = src_time + el - -- Place result in dst list if done - if src_time >= cooked.time then - inv:add_item("dst", cooked.item) - inv:set_stack("src", 1, aftercooked.items[1]) - - -- Unique recipe: Pour water into empty bucket after cooking wet sponge successfully - if inv:get_stack("fuel", 1):get_name() == "mcl_buckets:bucket_empty" then - if srclist[1]:get_name() == "mcl_sponges:sponge_wet" then - inv:set_stack("fuel", 1, "mcl_buckets:bucket_water") - fuellist = inv:get_list("fuel") - -- Also for river water - elseif srclist[1]:get_name() == "mcl_sponges:sponge_wet_river_water" then - inv:set_stack("fuel", 1, "mcl_buckets:bucket_river_water") - fuellist = inv:get_list("fuel") - end - end - - srclist = inv:get_list("src") - src_time = 0 - - meta:set_int("xp", meta:get_int("xp") + 1) -- ToDo give each recipe an idividial XP count - end - end - - elapsed_game_time = elapsed_game_time - el - end - - if fuel and fuel_totaltime > fuel.time then - fuel_totaltime = fuel.time - end - if srclist and srclist[1]:is_empty() then - src_time = 0 - end - - -- - -- Update formspec and node - -- - local formspec = inactive_formspec - local item_percent = 0 - if cookable then - item_percent = math.floor(src_time / cooked.time * 100) - end - - local result = false - - if active then - local fuel_percent = 0 - if fuel_totaltime > 0 then - fuel_percent = math.floor(fuel_time / fuel_totaltime * 100) - end - formspec = active_formspec(fuel_percent, item_percent) - swap_node(pos, "mcl_furnaces:furnace_active") - -- make sure timer restarts automatically - result = true - else - swap_node(pos, "mcl_furnaces:furnace") - -- stop timer on the inactive furnace - minetest.get_node_timer(pos):stop() - end - - -- - -- Set meta values - -- - meta:set_float("fuel_totaltime", fuel_totaltime) - meta:set_float("fuel_time", fuel_time) - meta:set_float("src_time", src_time) - if srclist then - meta:set_string("src_item", src_item) - else - meta:set_string("src_item", "") - end - meta:set_string("formspec", formspec) - - return result -end - -local on_rotate, after_rotate_active -if minetest.get_modpath("screwdriver") then - on_rotate = screwdriver.rotate_simple - after_rotate_active = function(pos) - local node = minetest.get_node(pos) - mcl_particles.delete_node_particlespawners(pos) - if node.name == "mcl_furnaces:furnace" then - return - end - spawn_flames(pos, node.param2) - end -end - -minetest.register_node("mcl_furnaces:furnace", { - description = S("Furnace"), - _tt_help = S("Uses fuel to smelt or cook items"), - _doc_items_longdesc = S("Furnaces cook or smelt several items, using a furnace fuel, into something else."), - _doc_items_usagehelp = - S([[ - Use the furnace to open the furnace menu. - Place a furnace fuel in the lower slot and the source material in the upper slot. - The furnace will slowly use its fuel to smelt the item. - The result will be placed into the output slot at the right side. - ]]).."\n".. - S("Use the recipe book to see what you can smelt, what you can use as fuel and how long it will burn."), - _doc_items_hidden = false, - tiles = { - "default_furnace_top.png", "default_furnace_bottom.png", - "default_furnace_side.png", "default_furnace_side.png", - "default_furnace_side.png", "default_furnace_front.png" - }, - paramtype2 = "facedir", - groups = {pickaxey=1, container=4, deco_block=1, material_stone=1}, - is_ground_content = false, - sounds = mcl_sounds.node_sound_stone_defaults(), - - on_timer = furnace_node_timer, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - local meta = minetest.get_meta(pos) - local meta2 = meta:to_table() - meta:from_table(oldmetadata) - local inv = meta:get_inventory() - for _, listname in ipairs({"src", "dst", "fuel"}) do - local stack = inv:get_stack(listname, 1) - if not stack:is_empty() then - local p = {x=pos.x+math.random(0, 10)/10-0.5, y=pos.y, z=pos.z+math.random(0, 10)/10-0.5} - minetest.add_item(p, stack) - end - end - meta:from_table(meta2) - end, - - on_construct = function(pos) - local meta = minetest.get_meta(pos) - meta:set_string("formspec", inactive_formspec) - local inv = meta:get_inventory() - inv:set_size("src", 1) - inv:set_size("fuel", 1) - inv:set_size("dst", 1) - end, - on_destruct = function(pos) - mcl_particles.delete_node_particlespawners(pos) - give_xp(pos) - end, - - on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) - -- Reset accumulated game time when player works with furnace: - mcl_time.touch(pos) - minetest.get_node_timer(pos):start(1.0) - - on_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player) - end, - on_metadata_inventory_put = function(pos) - -- Reset accumulated game time when player works with furnace: - mcl_time.touch(pos) - -- start timer function, it will sort out whether furnace can burn or not. - minetest.get_node_timer(pos):start(1.0) - end, - on_metadata_inventory_take = function(pos, listname, index, stack, player) - -- Reset accumulated game time when player works with furnace: - mcl_time.touch(pos) - -- start timer function, it will helpful if player clears dst slot - minetest.get_node_timer(pos):start(1.0) - - on_metadata_inventory_take(pos, listname, index, stack, player) - end, - - allow_metadata_inventory_put = allow_metadata_inventory_put, - allow_metadata_inventory_move = allow_metadata_inventory_move, - allow_metadata_inventory_take = allow_metadata_inventory_take, - on_receive_fields = receive_fields, - _mcl_blast_resistance = 3.5, - _mcl_hardness = 3.5, - on_rotate = on_rotate, -}) - -minetest.register_node("mcl_furnaces:furnace_active", { - description = S("Burning Furnace"), - _doc_items_create_entry = false, - tiles = { - "default_furnace_top.png", "default_furnace_bottom.png", - "default_furnace_side.png", "default_furnace_side.png", - "default_furnace_side.png", "default_furnace_front_active.png", - }, - paramtype2 = "facedir", - paramtype = "light", - light_source = LIGHT_ACTIVE_FURNACE, - drop = "mcl_furnaces:furnace", - groups = {pickaxey=1, container=4, deco_block=1, not_in_creative_inventory=1, material_stone=1}, - is_ground_content = false, - sounds = mcl_sounds.node_sound_stone_defaults(), - on_timer = furnace_node_timer, - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - local meta = minetest.get_meta(pos) - local meta2 = meta - meta:from_table(oldmetadata) - local inv = meta:get_inventory() - for _, listname in ipairs({"src", "dst", "fuel"}) do - local stack = inv:get_stack(listname, 1) - if not stack:is_empty() then - local p = {x=pos.x+math.random(0, 10)/10-0.5, y=pos.y, z=pos.z+math.random(0, 10)/10-0.5} - minetest.add_item(p, stack) - end - end - meta:from_table(meta2:to_table()) - end, - - on_construct = function(pos) - local node = minetest.get_node(pos) - spawn_flames(pos, node.param2) - end, - on_destruct = function(pos) - mcl_particles.delete_node_particlespawners(pos) - give_xp(pos) - end, - - allow_metadata_inventory_put = allow_metadata_inventory_put, - allow_metadata_inventory_move = allow_metadata_inventory_move, - allow_metadata_inventory_take = allow_metadata_inventory_take, - on_metadata_inventory_move = on_metadata_inventory_move, - on_metadata_inventory_take = on_metadata_inventory_take, - on_receive_fields = receive_fields, - _mcl_blast_resistance = 3.5, - _mcl_hardness = 3.5, - on_rotate = on_rotate, - after_rotate = after_rotate_active, -}) - -minetest.register_craft({ - output = "mcl_furnaces:furnace", - recipe = { - { "mcl_core:cobble", "mcl_core:cobble", "mcl_core:cobble" }, - { "mcl_core:cobble", "", "mcl_core:cobble" }, - { "mcl_core:cobble", "mcl_core:cobble", "mcl_core:cobble" }, - } -}) - --- Add entry alias for the Help -if minetest.get_modpath("doc") then - doc.add_entry_alias("nodes", "mcl_furnaces:furnace", "nodes", "mcl_furnaces:furnace_active") -end - -minetest.register_lbm({ - label = "Active furnace flame particles", - name = "mcl_furnaces:flames", - nodenames = {"mcl_furnaces:furnace_active"}, - run_at_every_load = true, - action = function(pos, node) - spawn_flames(pos, node.param2) - end, -}) - --- Legacy -minetest.register_lbm({ - label = "Update furnace formspecs (0.60.0)", - name = "mcl_furnaces:update_formspecs_0_60_0", - -- Only update inactive furnaces because active ones should update themselves - nodenames = { "mcl_furnaces:furnace" }, - run_at_every_load = false, - action = function(pos, node) - local meta = minetest.get_meta(pos) - meta:set_string("formspec", inactive_formspec) - end, -}) diff --git a/mods/ITEMS/mcl_furnaces/init.lua b/mods/ITEMS/mcl_furnaces/init.lua index adf8210cc..81bef41f7 100644 --- a/mods/ITEMS/mcl_furnaces/init.lua +++ b/mods/ITEMS/mcl_furnaces/init.lua @@ -1,6 +1,558 @@ --- Load files -local modpath = minetest.get_modpath(minetest.get_current_modname()) +local S = minetest.get_translator(minetest.get_current_modname()) -dofile(modpath.."/blast_furnace.lua") -- Load Blast Furnaces -dofile(modpath.."/furnace.lua") -- Load Furnaces -dofile(modpath.."/smoker.lua") -- Load Smokers \ No newline at end of file +local LIGHT_ACTIVE_FURNACE = 13 + +-- +-- Formspecs +-- + +local function active_formspec(fuel_percent, item_percent) + return "size[9,8.75]".. + "label[0,4;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]".. + "list[current_player;main;0,4.5;9,3;9]".. + mcl_formspec.get_itemslot_bg(0,4.5,9,3).. + "list[current_player;main;0,7.74;9,1;]".. + mcl_formspec.get_itemslot_bg(0,7.74,9,1).. + "label[2.75,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Furnace"))).."]".. + "list[context;src;2.75,0.5;1,1;]".. + mcl_formspec.get_itemslot_bg(2.75,0.5,1,1).. + "list[context;fuel;2.75,2.5;1,1;]".. + mcl_formspec.get_itemslot_bg(2.75,2.5,1,1).. + "list[context;dst;5.75,1.5;1,1;]".. + mcl_formspec.get_itemslot_bg(5.75,1.5,1,1).. + "image[2.75,1.5;1,1;default_furnace_fire_bg.png^[lowpart:".. + (100-fuel_percent)..":default_furnace_fire_fg.png]".. + "image[4.1,1.5;1.5,1;gui_furnace_arrow_bg.png^[lowpart:".. + (item_percent)..":gui_furnace_arrow_fg.png^[transformR270]".. + -- Craft guide button temporarily removed due to Minetest bug. + -- TODO: Add it back when the Minetest bug is fixed. + --"image_button[8,0;1,1;craftguide_book.png;craftguide;]".. + --"tooltip[craftguide;"..minetest.formspec_escape(S("Recipe book")).."]".. + "listring[context;dst]".. + "listring[current_player;main]".. + "listring[context;src]".. + "listring[current_player;main]".. + "listring[context;fuel]".. + "listring[current_player;main]" +end + +local inactive_formspec = "size[9,8.75]".. + "label[0,4;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]".. + "list[current_player;main;0,4.5;9,3;9]".. + mcl_formspec.get_itemslot_bg(0,4.5,9,3).. + "list[current_player;main;0,7.74;9,1;]".. + mcl_formspec.get_itemslot_bg(0,7.74,9,1).. + "label[2.75,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Furnace"))).."]".. + "list[context;src;2.75,0.5;1,1;]".. + mcl_formspec.get_itemslot_bg(2.75,0.5,1,1).. + "list[context;fuel;2.75,2.5;1,1;]".. + mcl_formspec.get_itemslot_bg(2.75,2.5,1,1).. + "list[context;dst;5.75,1.5;1,1;]".. + mcl_formspec.get_itemslot_bg(5.75,1.5,1,1).. + "image[2.75,1.5;1,1;default_furnace_fire_bg.png]".. + "image[4.1,1.5;1.5,1;gui_furnace_arrow_bg.png^[transformR270]".. + -- Craft guide button temporarily removed due to Minetest bug. + -- TODO: Add it back when the Minetest bug is fixed. + --"image_button[8,0;1,1;craftguide_book.png;craftguide;]".. + --"tooltip[craftguide;"..minetest.formspec_escape(S("Recipe book")).."]".. + "listring[context;dst]".. + "listring[current_player;main]".. + "listring[context;src]".. + "listring[current_player;main]".. + "listring[context;fuel]".. + "listring[current_player;main]" + +local receive_fields = function(pos, formname, fields, sender) + if fields.craftguide then + mcl_craftguide.show(sender:get_player_name()) + end +end + +local function give_xp(pos, player) + local meta = minetest.get_meta(pos) + local dir = vector.divide(minetest.facedir_to_dir(minetest.get_node(pos).param2),-1.95) + local xp = meta:get_int("xp") + if xp > 0 then + if player then + mcl_experience.add_xp(player, xp) + else + mcl_experience.throw_xp(vector.add(pos, dir), xp) + end + meta:set_int("xp", 0) + end +end + +-- +-- Node callback functions that are the same for active and inactive furnace +-- + +local function allow_metadata_inventory_put(pos, listname, index, stack, player) + local name = player:get_player_name() + if minetest.is_protected(pos, name) then + minetest.record_protection_violation(pos, name) + return 0 + end + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + if listname == "fuel" then + -- Special case: empty bucket (not a fuel, but used for sponge drying) + if stack:get_name() == "mcl_buckets:bucket_empty" then + if inv:get_stack(listname, index):get_count() == 0 then + return 1 + else + return 0 + end + end + + -- Test stack with size 1 because we burn one fuel at a time + local teststack = ItemStack(stack) + teststack:set_count(1) + local output, decremented_input = minetest.get_craft_result({method="fuel", width=1, items={teststack}}) + if output.time ~= 0 then + -- Only allow to place 1 item if fuel get replaced by recipe. + -- This is the case for lava buckets. + local replace_item = decremented_input.items[1] + if replace_item:is_empty() then + -- For most fuels, just allow to place everything + return stack:get_count() + else + if inv:get_stack(listname, index):get_count() == 0 then + return 1 + else + return 0 + end + end + else + return 0 + end + elseif listname == "src" then + return stack:get_count() + elseif listname == "dst" then + return 0 + end +end + +local function allow_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + local stack = inv:get_stack(from_list, from_index) + return allow_metadata_inventory_put(pos, to_list, to_index, stack, player) +end + +local function allow_metadata_inventory_take(pos, listname, index, stack, player) + local name = player:get_player_name() + if minetest.is_protected(pos, name) then + minetest.record_protection_violation(pos, name) + return 0 + end + return stack:get_count() +end + +local function on_metadata_inventory_take(pos, listname, index, stack, player) + -- Award smelting achievements + if listname == "dst" then + if stack:get_name() == "mcl_core:iron_ingot" then + awards.unlock(player:get_player_name(), "mcl:acquireIron") + elseif stack:get_name() == "mcl_fishing:fish_cooked" then + awards.unlock(player:get_player_name(), "mcl:cookFish") + end + give_xp(pos, player) + end +end + +local function on_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player) + if from_list == "dst" then + give_xp(pos, player) + end +end + +local function spawn_flames(pos, param2) + local minrelpos, maxrelpos + local dir = minetest.facedir_to_dir(param2) + if dir.x > 0 then + minrelpos = { x = -0.6, y = -0.05, z = -0.25 } + maxrelpos = { x = -0.55, y = -0.45, z = 0.25 } + elseif dir.x < 0 then + minrelpos = { x = 0.55, y = -0.05, z = -0.25 } + maxrelpos = { x = 0.6, y = -0.45, z = 0.25 } + elseif dir.z > 0 then + minrelpos = { x = -0.25, y = -0.05, z = -0.6 } + maxrelpos = { x = 0.25, y = -0.45, z = -0.55 } + elseif dir.z < 0 then + minrelpos = { x = -0.25, y = -0.05, z = 0.55 } + maxrelpos = { x = 0.25, y = -0.45, z = 0.6 } + else + return + end + mcl_particles.add_node_particlespawner(pos, { + amount = 4, + time = 0, + minpos = vector.add(pos, minrelpos), + maxpos = vector.add(pos, maxrelpos), + minvel = { x = -0.01, y = 0, z = -0.01 }, + maxvel = { x = 0.01, y = 0.1, z = 0.01 }, + minexptime = 0.3, + maxexptime = 0.6, + minsize = 0.4, + maxsize = 0.8, + texture = "mcl_particles_flame.png", + glow = LIGHT_ACTIVE_FURNACE, + }, "low") +end + +local function swap_node(pos, name) + local node = minetest.get_node(pos) + if node.name == name then + return + end + node.name = name + minetest.swap_node(pos, node) + if name == "mcl_furnaces:furnace_active" then + spawn_flames(pos, node.param2) + else + mcl_particles.delete_node_particlespawners(pos) + end +end + +local function furnace_node_timer(pos, elapsed) + -- + -- Inizialize metadata + -- + local meta = minetest.get_meta(pos) + local fuel_time = meta:get_float("fuel_time") or 0 + local src_time = meta:get_float("src_time") or 0 + local src_item = meta:get_string("src_item") or "" + local fuel_totaltime = meta:get_float("fuel_totaltime") or 0 + + local inv = meta:get_inventory() + local srclist, fuellist + + local cookable, cooked + local active = true + local fuel + + srclist = inv:get_list("src") + fuellist = inv:get_list("fuel") + + -- Check if src item has been changed + if srclist[1]:get_name() ~= src_item then + -- Reset cooking progress in this case + src_time = 0 + src_item = srclist[1]:get_name() + end + + local update = true + local elapsed_game_time = mcl_time.get_irl_seconds_passed_at_pos_or_nil(pos) or elapsed + while elapsed_game_time > 0.00001 and update do + -- + -- Cooking + -- + + local el = elapsed_game_time + + -- Check if we have cookable content: cookable + local aftercooked + cooked, aftercooked = minetest.get_craft_result({method = "cooking", width = 1, items = srclist}) + cookable = cooked.time ~= 0 + if cookable then + -- Successful cooking requires space in dst slot and time + if not inv:room_for_item("dst", cooked.item) then + cookable = false + end + end + + if cookable then -- fuel lasts long enough, adjust el to cooking duration + el = math.min(el, cooked.time - src_time) + end + + -- Check if we have enough fuel to burn + active = fuel_time < fuel_totaltime + if cookable and not active then + -- We need to get new fuel + local afterfuel + fuel, afterfuel = minetest.get_craft_result({method = "fuel", width = 1, items = fuellist}) + + if fuel.time == 0 then + -- No valid fuel in fuel list -- stop + fuel_totaltime = 0 + src_time = 0 + update = false + else + -- Take fuel from fuel list + inv:set_stack("fuel", 1, afterfuel.items[1]) + fuel_time = 0 + fuel_totaltime = fuel.time + el = math.min(el, fuel_totaltime) + active = true + fuellist = inv:get_list("fuel") + end + elseif active then + el = math.min(el, fuel_totaltime - fuel_time) + -- The furnace is currently active and has enough fuel + fuel_time = fuel_time + el + end + + -- If there is a cookable item then check if it is ready yet + if cookable and active then + src_time = src_time + el + -- Place result in dst list if done + if src_time >= cooked.time then + inv:add_item("dst", cooked.item) + inv:set_stack("src", 1, aftercooked.items[1]) + + -- Unique recipe: Pour water into empty bucket after cooking wet sponge successfully + if inv:get_stack("fuel", 1):get_name() == "mcl_buckets:bucket_empty" then + if srclist[1]:get_name() == "mcl_sponges:sponge_wet" then + inv:set_stack("fuel", 1, "mcl_buckets:bucket_water") + fuellist = inv:get_list("fuel") + -- Also for river water + elseif srclist[1]:get_name() == "mcl_sponges:sponge_wet_river_water" then + inv:set_stack("fuel", 1, "mcl_buckets:bucket_river_water") + fuellist = inv:get_list("fuel") + end + end + + srclist = inv:get_list("src") + src_time = 0 + + meta:set_int("xp", meta:get_int("xp") + 1) -- ToDo give each recipe an idividial XP count + end + end + + elapsed_game_time = elapsed_game_time - el + end + + if fuel and fuel_totaltime > fuel.time then + fuel_totaltime = fuel.time + end + if srclist and srclist[1]:is_empty() then + src_time = 0 + end + + -- + -- Update formspec and node + -- + local formspec = inactive_formspec + local item_percent = 0 + if cookable then + item_percent = math.floor(src_time / cooked.time * 100) + end + + local result = false + + if active then + local fuel_percent = 0 + if fuel_totaltime > 0 then + fuel_percent = math.floor(fuel_time / fuel_totaltime * 100) + end + formspec = active_formspec(fuel_percent, item_percent) + swap_node(pos, "mcl_furnaces:furnace_active") + -- make sure timer restarts automatically + result = true + else + swap_node(pos, "mcl_furnaces:furnace") + -- stop timer on the inactive furnace + minetest.get_node_timer(pos):stop() + end + + -- + -- Set meta values + -- + meta:set_float("fuel_totaltime", fuel_totaltime) + meta:set_float("fuel_time", fuel_time) + meta:set_float("src_time", src_time) + if srclist then + meta:set_string("src_item", src_item) + else + meta:set_string("src_item", "") + end + meta:set_string("formspec", formspec) + + return result +end + +local on_rotate, after_rotate_active +if minetest.get_modpath("screwdriver") then + on_rotate = screwdriver.rotate_simple + after_rotate_active = function(pos) + local node = minetest.get_node(pos) + mcl_particles.delete_node_particlespawners(pos) + if node.name == "mcl_furnaces:furnace" then + return + end + spawn_flames(pos, node.param2) + end +end + +minetest.register_node("mcl_furnaces:furnace", { + description = S("Furnace"), + _tt_help = S("Uses fuel to smelt or cook items"), + _doc_items_longdesc = S("Furnaces cook or smelt several items, using a furnace fuel, into something else."), + _doc_items_usagehelp = + S([[ + Use the furnace to open the furnace menu. + Place a furnace fuel in the lower slot and the source material in the upper slot. + The furnace will slowly use its fuel to smelt the item. + The result will be placed into the output slot at the right side. + ]]).."\n".. + S("Use the recipe book to see what you can smelt, what you can use as fuel and how long it will burn."), + _doc_items_hidden = false, + tiles = { + "default_furnace_top.png", "default_furnace_bottom.png", + "default_furnace_side.png", "default_furnace_side.png", + "default_furnace_side.png", "default_furnace_front.png" + }, + paramtype2 = "facedir", + groups = {pickaxey=1, container=4, deco_block=1, material_stone=1}, + is_ground_content = false, + sounds = mcl_sounds.node_sound_stone_defaults(), + + on_timer = furnace_node_timer, + after_dig_node = function(pos, oldnode, oldmetadata, digger) + local meta = minetest.get_meta(pos) + local meta2 = meta:to_table() + meta:from_table(oldmetadata) + local inv = meta:get_inventory() + for _, listname in ipairs({"src", "dst", "fuel"}) do + local stack = inv:get_stack(listname, 1) + if not stack:is_empty() then + local p = {x=pos.x+math.random(0, 10)/10-0.5, y=pos.y, z=pos.z+math.random(0, 10)/10-0.5} + minetest.add_item(p, stack) + end + end + meta:from_table(meta2) + end, + + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("formspec", inactive_formspec) + local inv = meta:get_inventory() + inv:set_size("src", 1) + inv:set_size("fuel", 1) + inv:set_size("dst", 1) + end, + on_destruct = function(pos) + mcl_particles.delete_node_particlespawners(pos) + give_xp(pos) + end, + + on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) + -- Reset accumulated game time when player works with furnace: + mcl_time.touch(pos) + minetest.get_node_timer(pos):start(1.0) + + on_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player) + end, + on_metadata_inventory_put = function(pos) + -- Reset accumulated game time when player works with furnace: + mcl_time.touch(pos) + -- start timer function, it will sort out whether furnace can burn or not. + minetest.get_node_timer(pos):start(1.0) + end, + on_metadata_inventory_take = function(pos, listname, index, stack, player) + -- Reset accumulated game time when player works with furnace: + mcl_time.touch(pos) + -- start timer function, it will helpful if player clears dst slot + minetest.get_node_timer(pos):start(1.0) + + on_metadata_inventory_take(pos, listname, index, stack, player) + end, + + allow_metadata_inventory_put = allow_metadata_inventory_put, + allow_metadata_inventory_move = allow_metadata_inventory_move, + allow_metadata_inventory_take = allow_metadata_inventory_take, + on_receive_fields = receive_fields, + _mcl_blast_resistance = 3.5, + _mcl_hardness = 3.5, + on_rotate = on_rotate, +}) + +minetest.register_node("mcl_furnaces:furnace_active", { + description = S("Burning Furnace"), + _doc_items_create_entry = false, + tiles = { + "default_furnace_top.png", "default_furnace_bottom.png", + "default_furnace_side.png", "default_furnace_side.png", + "default_furnace_side.png", "default_furnace_front_active.png", + }, + paramtype2 = "facedir", + paramtype = "light", + light_source = LIGHT_ACTIVE_FURNACE, + drop = "mcl_furnaces:furnace", + groups = {pickaxey=1, container=4, deco_block=1, not_in_creative_inventory=1, material_stone=1}, + is_ground_content = false, + sounds = mcl_sounds.node_sound_stone_defaults(), + on_timer = furnace_node_timer, + + after_dig_node = function(pos, oldnode, oldmetadata, digger) + local meta = minetest.get_meta(pos) + local meta2 = meta + meta:from_table(oldmetadata) + local inv = meta:get_inventory() + for _, listname in ipairs({"src", "dst", "fuel"}) do + local stack = inv:get_stack(listname, 1) + if not stack:is_empty() then + local p = {x=pos.x+math.random(0, 10)/10-0.5, y=pos.y, z=pos.z+math.random(0, 10)/10-0.5} + minetest.add_item(p, stack) + end + end + meta:from_table(meta2:to_table()) + end, + + on_construct = function(pos) + local node = minetest.get_node(pos) + spawn_flames(pos, node.param2) + end, + on_destruct = function(pos) + mcl_particles.delete_node_particlespawners(pos) + give_xp(pos) + end, + + allow_metadata_inventory_put = allow_metadata_inventory_put, + allow_metadata_inventory_move = allow_metadata_inventory_move, + allow_metadata_inventory_take = allow_metadata_inventory_take, + on_metadata_inventory_move = on_metadata_inventory_move, + on_metadata_inventory_take = on_metadata_inventory_take, + on_receive_fields = receive_fields, + _mcl_blast_resistance = 3.5, + _mcl_hardness = 3.5, + on_rotate = on_rotate, + after_rotate = after_rotate_active, +}) + +minetest.register_craft({ + output = "mcl_furnaces:furnace", + recipe = { + { "mcl_core:cobble", "mcl_core:cobble", "mcl_core:cobble" }, + { "mcl_core:cobble", "", "mcl_core:cobble" }, + { "mcl_core:cobble", "mcl_core:cobble", "mcl_core:cobble" }, + } +}) + +-- Add entry alias for the Help +if minetest.get_modpath("doc") then + doc.add_entry_alias("nodes", "mcl_furnaces:furnace", "nodes", "mcl_furnaces:furnace_active") +end + +minetest.register_lbm({ + label = "Active furnace flame particles", + name = "mcl_furnaces:flames", + nodenames = {"mcl_furnaces:furnace_active"}, + run_at_every_load = true, + action = function(pos, node) + spawn_flames(pos, node.param2) + end, +}) + +-- Legacy +minetest.register_lbm({ + label = "Update furnace formspecs (0.60.0)", + name = "mcl_furnaces:update_formspecs_0_60_0", + -- Only update inactive furnaces because active ones should update themselves + nodenames = { "mcl_furnaces:furnace" }, + run_at_every_load = false, + action = function(pos, node) + local meta = minetest.get_meta(pos) + meta:set_string("formspec", inactive_formspec) + end, +}) diff --git a/mods/ITEMS/mcl_furnaces/locale/mcl_furnaces.fr.tr b/mods/ITEMS/mcl_furnaces/locale/mcl_furnaces.fr.tr index f7b37e537..6140504ef 100644 --- a/mods/ITEMS/mcl_furnaces/locale/mcl_furnaces.fr.tr +++ b/mods/ITEMS/mcl_furnaces/locale/mcl_furnaces.fr.tr @@ -7,3 +7,7 @@ Burning Furnace=Four Allumé Recipe book=Livre de Recette Inventory=Inventaire Uses fuel to smelt or cook items=Utilise du carburant pour fondre ou cuire des articles +Blast Furnace=Haut Fourneau +Blast Furnaces cook or smelt several items, using a furnace fuel, into something else, but faster than a normal furnace.=Un haut fourneau peut cuire ou fondre plusieurs objets, en quelque chose d'autre, en utilisant du carburant, plus vite qu'un four normal. +Smoker=Fumoir +Smokers cook or smelt several items, using a furnace fuel, into something else, but faster than a normal furnace.=Le Fumoir peut cuire ou fondre plusieurs objets, en quelque chose d'autre, en utilisant du carburant, plus vite qu'un four normal. diff --git a/mods/ITEMS/mcl_furnaces/locale/template.txt b/mods/ITEMS/mcl_furnaces/locale/template.txt index 4f88824b0..d48de3909 100644 --- a/mods/ITEMS/mcl_furnaces/locale/template.txt +++ b/mods/ITEMS/mcl_furnaces/locale/template.txt @@ -7,3 +7,7 @@ Burning Furnace= Recipe book= Inventory= Uses fuel to smelt or cook items= +Blast Furnace= +Blast Furnaces cook or smelt several items, using a furnace fuel, into something else, but faster than a normal furnace.= +Smoker= +Smokers cook or smelt several items, using a furnace fuel, into something else, but faster than a normal furnace.= diff --git a/mods/ITEMS/mcl_heads/init.lua b/mods/ITEMS/mcl_heads/init.lua index 78356de71..c14079393 100644 --- a/mods/ITEMS/mcl_heads/init.lua +++ b/mods/ITEMS/mcl_heads/init.lua @@ -113,7 +113,6 @@ local function addhead(name, texture, desc, longdesc, rangemob, rangefactor) _mcl_armor_mob_range_factor = rangefactor, _mcl_armor_element = "head", _mcl_armor_texture = "mcl_heads_" .. name .. ".png", - _mcl_armor_preview = "mcl_heads_" .. name .. "_preview.png", _mcl_blast_resistance = 1, _mcl_hardness = 1, }) diff --git a/mods/ITEMS/mcl_heads/textures/mcl_heads_creeper_preview.png b/mods/ITEMS/mcl_heads/textures/mcl_heads_creeper_preview.png deleted file mode 100644 index 120f0b53e..000000000 Binary files a/mods/ITEMS/mcl_heads/textures/mcl_heads_creeper_preview.png and /dev/null differ diff --git a/mods/ITEMS/mcl_heads/textures/mcl_heads_skeleton_preview.png b/mods/ITEMS/mcl_heads/textures/mcl_heads_skeleton_preview.png deleted file mode 100644 index 70d6d5cab..000000000 Binary files a/mods/ITEMS/mcl_heads/textures/mcl_heads_skeleton_preview.png and /dev/null differ diff --git a/mods/ITEMS/mcl_heads/textures/mcl_heads_steve_preview.png b/mods/ITEMS/mcl_heads/textures/mcl_heads_steve_preview.png deleted file mode 100644 index 906eb5b93..000000000 Binary files a/mods/ITEMS/mcl_heads/textures/mcl_heads_steve_preview.png and /dev/null differ diff --git a/mods/ITEMS/mcl_heads/textures/mcl_heads_wither_skeleton_preview.png b/mods/ITEMS/mcl_heads/textures/mcl_heads_wither_skeleton_preview.png deleted file mode 100644 index dbc9b3629..000000000 Binary files a/mods/ITEMS/mcl_heads/textures/mcl_heads_wither_skeleton_preview.png and /dev/null differ diff --git a/mods/ITEMS/mcl_heads/textures/mcl_heads_zombie_preview.png b/mods/ITEMS/mcl_heads/textures/mcl_heads_zombie_preview.png deleted file mode 100644 index ff1e0b26c..000000000 Binary files a/mods/ITEMS/mcl_heads/textures/mcl_heads_zombie_preview.png and /dev/null differ diff --git a/mods/ITEMS/mcl_hoppers/License.txt b/mods/ITEMS/mcl_hoppers/License.txt deleted file mode 100644 index 5c93f4565..000000000 --- a/mods/ITEMS/mcl_hoppers/License.txt +++ /dev/null @@ -1,13 +0,0 @@ - DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE - Version 2, December 2004 - - Copyright (C) 2004 Sam Hocevar - - Everyone is permitted to copy and distribute verbatim or modified - copies of this license document, and changing it is allowed as long - as the name is changed. - - DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. You just DO WHAT THE FUCK YOU WANT TO. diff --git a/mods/ITEMS/mcl_hoppers/README.md b/mods/ITEMS/mcl_hoppers/README.md deleted file mode 100644 index 52c85a5d9..000000000 --- a/mods/ITEMS/mcl_hoppers/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Hoppers -This is the Hoppers mod for Minetest. It's just a clone of Minecraft hoppers, functions nearly identical to them minus mesecons making them stop and the way they're placed. - -## Forum Topic -- https://forum.minetest.net/viewtopic.php?f=11&t=12379 diff --git a/mods/ITEMS/mcl_hoppers/init.lua b/mods/ITEMS/mcl_hoppers/init.lua index 36a21ad95..0d6e60138 100644 --- a/mods/ITEMS/mcl_hoppers/init.lua +++ b/mods/ITEMS/mcl_hoppers/init.lua @@ -1,7 +1,26 @@ local S = minetest.get_translator(minetest.get_current_modname()) ---[[ BEGIN OF NODE DEFINITIONS ]] +local math_abs = math.abs +local mcl_util_move_item_container = mcl_util.move_item_container +local minetest_facedir_to_dir = minetest.facedir_to_dir +local minetest_get_inventory = minetest.get_inventory +local minetest_get_item_group = minetest.get_item_group +local minetest_get_meta = minetest.get_meta +local minetest_get_node = minetest.get_node +local minetest_get_objects_inside_radius = minetest.get_objects_inside_radius +local minetest_registered_nodes = minetest.registered_nodes +local HOPPER = "mcl_hoppers:hopper" +local HOPPER_SIDE = "mcl_hoppers:hopper_side" +local GROUPS_TO_PUT_INTO_COMMON_SLOT = { + [2] = true, + [3] = true, + [5] = true, + [6] = true, +} +local GROUPS_TO_PUT_INTO_FUEL_SLOT = { + [4] = true, +} local mcl_hoppers_formspec = "size[9,7]".. "label[2,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Hopper"))).."]".. @@ -23,44 +42,50 @@ local def_hopper = { groups = {pickaxey=1, container=2,deco_block=1,hopper=1}, drawtype = "nodebox", paramtype = "light", - -- FIXME: mcl_hoppers_hopper_inside.png is unused by hoppers. - tiles = {"mcl_hoppers_hopper_inside.png^mcl_hoppers_hopper_top.png", "mcl_hoppers_hopper_outside.png", "mcl_hoppers_hopper_outside.png", "mcl_hoppers_hopper_outside.png", "mcl_hoppers_hopper_outside.png", "mcl_hoppers_hopper_outside.png"}, + tiles = { + "mcl_hoppers_hopper_inside.png^mcl_hoppers_hopper_top.png", + "mcl_hoppers_hopper_outside.png", + "mcl_hoppers_hopper_outside.png", + "mcl_hoppers_hopper_outside.png", + "mcl_hoppers_hopper_outside.png", + "mcl_hoppers_hopper_outside.png" + }, node_box = { type = "fixed", fixed = { --funnel walls - {-0.5, 0.0, 0.4, 0.5, 0.5, 0.5}, - {0.4, 0.0, -0.5, 0.5, 0.5, 0.5}, - {-0.5, 0.0, -0.5, -0.4, 0.5, 0.5}, - {-0.5, 0.0, -0.5, 0.5, 0.5, -0.4}, + {-0.5, 0.0, 0.4, 0.5, 0.5, 0.5,}, + { 0.4, 0.0, -0.5, 0.5, 0.5, 0.5,}, + {-0.5, 0.0, -0.5, -0.4, 0.5, 0.5,}, + {-0.5, 0.0, -0.5, 0.5, 0.5, -0.4,}, --funnel base - {-0.5, 0.0, -0.5, 0.5, 0.1, 0.5}, + {-0.5, 0.0, -0.5, 0.5, 0.1, 0.5,}, --spout - {-0.3, -0.3, -0.3, 0.3, 0.0, 0.3}, - {-0.1, -0.3, -0.1, 0.1, -0.5, 0.1}, + {-0.3, -0.3, -0.3, 0.3, 0.0, 0.3,}, + {-0.1, -0.3, -0.1, 0.1, -0.5, 0.1,}, }, }, selection_box = { type = "fixed", fixed = { --funnel - {-0.5, 0.0, -0.5, 0.5, 0.5, 0.5}, + {-0.5, 0.0, -0.5, 0.5, 0.5, 0.5,}, --spout - {-0.3, -0.3, -0.3, 0.3, 0.0, 0.3}, - {-0.1, -0.3, -0.1, 0.1, -0.5, 0.1}, + {-0.3, -0.3, -0.3, 0.3, 0.0, 0.3,}, + {-0.1, -0.3, -0.1, 0.1, -0.5, 0.1,}, }, }, is_ground_content = false, on_construct = function(pos) - local meta = minetest.get_meta(pos) + local meta = minetest_get_meta(pos) meta:set_string("formspec", mcl_hoppers_formspec) local inv = meta:get_inventory() inv:set_size("main", 5) end, after_dig_node = function(pos, oldnode, oldmetadata, digger) - local meta = minetest.get_meta(pos) + local meta = minetest_get_meta(pos) local meta2 = meta:to_table() meta:from_table(oldmetadata) local inv = meta:get_inventory() @@ -118,10 +143,8 @@ local def_hopper = { _mcl_hardness = 3, } --- Redstone variants (on/off) of downwards hopper. --- Note a hopper is enabled when it is *not* supplied with redstone power and disabled when it is supplied with redstone power. - -- Enabled downwards hopper + local def_hopper_enabled = table.copy(def_hopper) def_hopper_enabled.description = S("Hopper") def_hopper_enabled._tt_help = S("5 inventory slots").."\n"..S("Collects items from above, moves items to container below").."\n"..S("Can be disabled with redstone power") @@ -138,8 +161,8 @@ def_hopper_enabled.on_place = function(itemstack, placer, pointed_thing) local upos = pointed_thing.under local apos = pointed_thing.above - local uposnode = minetest.get_node(upos) - local uposnodedef = minetest.registered_nodes[uposnode.name] + local uposnode = minetest_get_node(upos) + local uposnodedef = minetest_registered_nodes[uposnode.name] if not uposnodedef then return itemstack end -- Use pointed node's on_rightclick function first, if present if placer and not placer:get_player_control().sneak then @@ -148,26 +171,16 @@ def_hopper_enabled.on_place = function(itemstack, placer, pointed_thing) end end - local x = upos.x - apos.x - local z = upos.z - apos.z - local fake_itemstack = ItemStack(itemstack) + local dx = apos.x - upos.x + local dz = apos.z - upos.z local param2 - if x == -1 then - fake_itemstack:set_name("mcl_hoppers:hopper_side") - param2 = 0 - elseif x == 1 then - fake_itemstack:set_name("mcl_hoppers:hopper_side") - param2 = 2 - elseif z == -1 then - fake_itemstack:set_name("mcl_hoppers:hopper_side") - param2 = 3 - elseif z == 1 then - fake_itemstack:set_name("mcl_hoppers:hopper_side") - param2 = 1 + if (dx ~= 0) or (dz ~= 0) then + param2 = minetest.dir_to_facedir({x = dx, y = 0, z = dz}) + fake_itemstack:set_name(HOPPER_SIDE) end - local itemstack,_ = minetest.item_place_node(fake_itemstack, placer, pointed_thing, param2) - itemstack:set_name("mcl_hoppers:hopper") + local itemstack, _ = minetest.item_place_node(fake_itemstack, placer, pointed_thing, param2) + itemstack:set_name(HOPPER) return itemstack end def_hopper_enabled.mesecons = { @@ -178,77 +191,84 @@ def_hopper_enabled.mesecons = { }, } -minetest.register_node("mcl_hoppers:hopper", def_hopper_enabled) +minetest.register_node(HOPPER, def_hopper_enabled) -- Disabled downwards hopper + local def_hopper_disabled = table.copy(def_hopper) def_hopper_disabled.description = S("Disabled Hopper") def_hopper_disabled.inventory_image = nil def_hopper_disabled._doc_items_create_entry = false def_hopper_disabled.groups.not_in_creative_inventory = 1 -def_hopper_disabled.drop = "mcl_hoppers:hopper" +def_hopper_disabled.drop = HOPPER def_hopper_disabled.mesecons = { effector = { action_off = function(pos, node) - minetest.swap_node(pos, {name="mcl_hoppers:hopper", param2=node.param2}) + minetest.swap_node(pos, {name=HOPPER, param2=node.param2}) end, }, } minetest.register_node("mcl_hoppers:hopper_disabled", def_hopper_disabled) +-- Sidewadrs hopper (base definition) - -local on_rotate -if minetest.get_modpath("screwdriver") then - on_rotate = screwdriver.rotate_simple -end - --- Sidewars hopper (base definition) local def_hopper_side = { _doc_items_create_entry = false, - drop = "mcl_hoppers:hopper", - groups = {pickaxey=1, container=2,not_in_creative_inventory=1,hopper=2}, + drop = HOPPER, + groups = { + container = 2, + hopper = 2, + not_in_creative_inventory = 1, + pickaxey = 1, + }, drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - tiles = {"mcl_hoppers_hopper_inside.png^mcl_hoppers_hopper_top.png", "mcl_hoppers_hopper_outside.png", "mcl_hoppers_hopper_outside.png", "mcl_hoppers_hopper_outside.png", "mcl_hoppers_hopper_outside.png", "mcl_hoppers_hopper_outside.png"}, + tiles = { + "mcl_hoppers_hopper_inside.png^mcl_hoppers_hopper_top.png", + "mcl_hoppers_hopper_outside.png", + "mcl_hoppers_hopper_outside.png", + "mcl_hoppers_hopper_outside.png", + "mcl_hoppers_hopper_outside.png", + "mcl_hoppers_hopper_outside.png", + }, node_box = { type = "fixed", fixed = { --funnel walls - {-0.5, 0.0, 0.4, 0.5, 0.5, 0.5}, - {0.4, 0.0, -0.5, 0.5, 0.5, 0.5}, - {-0.5, 0.0, -0.5, -0.4, 0.5, 0.5}, - {-0.5, 0.0, -0.5, 0.5, 0.5, -0.4}, + {-0.5, 0.0, 0.4, 0.5, 0.5, 0.5,}, + { 0.4, 0.0, -0.5, 0.5, 0.5, 0.5,}, + {-0.5, 0.0, -0.5, -0.4, 0.5, 0.5,}, + {-0.5, 0.0, -0.5, 0.5, 0.5, -0.4,}, --funnel base - {-0.5, 0.0, -0.5, 0.5, 0.1, 0.5}, + {-0.5, 0.0, -0.5, 0.5, 0.1, 0.5,}, --spout - {-0.3, -0.3, -0.3, 0.3, 0.0, 0.3}, - {-0.5, -0.3, -0.1, 0.1, -0.1, 0.1}, + {-0.3, -0.3, -0.3, 0.3, 0.0, 0.3,}, + {-0.1, -0.3, -0.5, 0.1, -0.1, 0.1,}, }, }, selection_box = { type = "fixed", fixed = { --funnel - {-0.5, 0.0, -0.5, 0.5, 0.5, 0.5}, + {-0.5, 0.0, -0.5, 0.5, 0.5, 0.5,}, --spout - {-0.3, -0.3, -0.3, 0.3, 0.0, 0.3}, - {-0.5, -0.3, -0.1, 0.1, -0.1, 0.1}, + {-0.3, -0.3, -0.3, 0.3, 0.0, 0.3,}, + {-0.1, -0.3, -0.5, 0.1, -0.1, 0.1,}, }, }, is_ground_content = false, on_construct = function(pos) - local meta = minetest.get_meta(pos) + local meta = minetest_get_meta(pos) meta:set_string("formspec", mcl_hoppers_formspec) local inv = meta:get_inventory() inv:set_size("main", 5) end, after_dig_node = function(pos, oldnode, oldmetadata, digger) - local meta = minetest.get_meta(pos) + local meta = minetest_get_meta(pos) local meta2 = meta meta:from_table(oldmetadata) local inv = meta:get_inventory() @@ -300,13 +320,15 @@ local def_hopper_side = { minetest.log("action", player:get_player_name().. " takes stuff from mcl_hoppers at "..minetest.pos_to_string(pos)) end, - on_rotate = on_rotate, + on_rotate = screwdriver.rotate_simple, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 4.8, _mcl_hardness = 3, } +-- Enabled sidewards hopper + local def_hopper_side_enabled = table.copy(def_hopper_side) def_hopper_side_enabled.description = S("Side Hopper") def_hopper_side_enabled.mesecons = { @@ -316,51 +338,105 @@ def_hopper_side_enabled.mesecons = { end, }, } -minetest.register_node("mcl_hoppers:hopper_side", def_hopper_side_enabled) +minetest.register_node(HOPPER_SIDE, def_hopper_side_enabled) + +-- Disabled sidewards hopper local def_hopper_side_disabled = table.copy(def_hopper_side) def_hopper_side_disabled.description = S("Disabled Side Hopper") def_hopper_side_disabled.mesecons = { effector = { action_off = function(pos, node) - minetest.swap_node(pos, {name="mcl_hoppers:hopper_side", param2=node.param2}) + minetest.swap_node(pos, {name=HOPPER_SIDE, param2=node.param2}) end, }, } minetest.register_node("mcl_hoppers:hopper_side_disabled", def_hopper_side_disabled) ---[[ END OF NODE DEFINITIONS ]] - ---[[ BEGIN OF ABM DEFINITONS ]] - --- Make hoppers suck in dropped items minetest.register_abm({ - label = "Hoppers suck in dropped items", - nodenames = {"mcl_hoppers:hopper","mcl_hoppers:hopper_side"}, - interval = 1.0, + label = "Hopper", + nodenames = { + HOPPER, + HOPPER_SIDE, + }, + interval = 1, chance = 1, - action = function(pos, node, active_object_count, active_object_count_wider) - local abovenode = minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}) - if not minetest.registered_items[abovenode.name] then return end - -- Don't bother checking item enties if node above is a container (should save some CPU) - if minetest.registered_items[abovenode.name].groups.container then - return - end - local meta = minetest.get_meta(pos) + action = function(pos, node) + local pos = pos + local meta = minetest_get_meta(pos) local inv = meta:get_inventory() + if not inv then return end - for _,object in pairs(minetest.get_objects_inside_radius(pos, 2)) do - if not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "__builtin:item" and not object:get_luaentity()._removed then - if inv and inv:room_for_item("main", ItemStack(object:get_luaentity().itemstring)) then - -- Item must get sucked in when the item just TOUCHES the block above the hopper - -- This is the reason for the Y calculation. - -- Test: Items on farmland and slabs get sucked, but items on full blocks don't - local posob = object:get_pos() - local posob_miny = posob.y + object:get_properties().collisionbox[2] - if math.abs(posob.x-pos.x) <= 0.5 and (posob_miny-pos.y < 1.5 and posob.y-pos.y >= 0.3) then - inv:add_item("main", ItemStack(object:get_luaentity().itemstring)) - object:get_luaentity().itemstring = "" - object:remove() + local x, y, z = pos.x, pos.y, pos.z + + -- Move an item from the hopper into the container to which the hopper points to + local dst_pos + if node.name == HOPPER then + dst_pos = {x = x, y = y - 1, z = z} + else + local param2 = node.param2 + local dir = minetest_facedir_to_dir(param2) + if not dir then return end + dst_pos = {x = x - dir.x, y = y, z = z - dir.z} + end + local dst_node = minetest_get_node(dst_pos) + local dst_node_name = dst_node.name + local dst_container_group = minetest_get_item_group(dst_node_name, "container") + if GROUPS_TO_PUT_INTO_COMMON_SLOT[dst_container_group] then + mcl_util_move_item_container(pos, dst_pos) + elseif GROUPS_TO_PUT_INTO_FUEL_SLOT[dst_container_group] then + local sinv = minetest_get_inventory({type="node", pos = pos}) + local dinv = minetest_get_inventory({type="node", pos = dst_pos}) + local slot_id,_ = mcl_util.get_eligible_transfer_item_slot( + sinv, + "main", + dinv, + "fuel", + function(itemstack, src_inventory, src_list, dst_inventory, dst_list) + -- Returns true if itemstack is fuel, but not for lava bucket if destination already has one + if not mcl_util.is_fuel(itemstack) then return false end + if itemstack:get_name() ~= "mcl_buckets:bucket_lava" then return true end + return dst_inventory:is_empty(dst_list) + end + ) + end + + local y_above = y + 1 + local pos_above = {x = x, y = y_above, z = z} + local above_node = minetest_get_node(pos_above) + local above_node_name = above_node.name + local above_container_group = minetest_get_item_group(above_node_name, "container") + if above_container_group ~= 0 then + -- Suck an item from the container above into the hopper + if not mcl_util_move_item_container(pos_above, pos) + and above_container_group == 4 then + local finv = minetest_get_inventory({type="node", pos = pos_above}) + if finv and not mcl_util.is_fuel(finv:get_stack("fuel", 1)) then + mcl_util_move_item_container(pos_above, pos, "fuel") + end + end + else + -- Suck in dropped items + local y_top_touch_to_suck = y_above + 0.5 + for _, object in pairs(minetest_get_objects_inside_radius(pos_above, 1)) do + if not object:is_player() then + local entity = object:get_luaentity() + local entity_name = entity and entity.name + if entity_name == "__builtin:item" then + local itemstring = entity.itemstring + if itemstring and itemstring ~= "" and inv:room_for_item("main", ItemStack(itemstring)) then + local object_pos = object:get_pos() + local object_pos_y = object_pos.y + local object_collisionbox = object:get_properties().collisionbox + local touches_from_above = object_pos_y + object_collisionbox[2] <= y_top_touch_to_suck + if touches_from_above + and (math_abs(object_pos.x - x) <= 0.5) + and (math_abs(object_pos.z - z) <= 0.5) + then + object:remove() + inv:add_item("main", ItemStack(itemstring)) + end + end end end end @@ -368,109 +444,8 @@ minetest.register_abm({ end, }) --- Returns true if itemstack is fuel, but not for lava bucket if destination already has one -local is_transferrable_fuel = function(itemstack, src_inventory, src_list, dst_inventory, dst_list) - if mcl_util.is_fuel(itemstack) then - if itemstack:get_name() == "mcl_buckets:bucket_lava" then - return dst_inventory:is_empty(dst_list) - else - return true - end - else - return false - end -end - - - -minetest.register_abm({ - label = "Hopper/container item exchange", - nodenames = {"mcl_hoppers:hopper"}, - neighbors = {"group:container"}, - interval = 1.0, - chance = 1, - action = function(pos, node, active_object_count, active_object_count_wider) - -- Get node pos' for item transfer - local uppos = {x=pos.x,y=pos.y+1,z=pos.z} - local downpos = {x=pos.x,y=pos.y-1,z=pos.z} - - -- Suck an item from the container above into the hopper - local upnode = minetest.get_node(uppos) - if not minetest.registered_nodes[upnode.name] then return end - local g = minetest.registered_nodes[upnode.name].groups.container - local sucked = mcl_util.move_item_container(uppos, pos) - - -- Also suck in non-fuel items from furnace fuel slot - if not sucked and g == 4 then - local finv = minetest.get_inventory({type="node", pos=uppos}) - if finv and not mcl_util.is_fuel(finv:get_stack("fuel", 1)) then - mcl_util.move_item_container(uppos, pos, "fuel") - end - end - - -- Move an item from the hopper into container below - local downnode = minetest.get_node(downpos) - if not minetest.registered_nodes[downnode.name] then return end - mcl_util.move_item_container(pos, downpos) - end, -}) - -minetest.register_abm({ - label = "Side-hopper/container item exchange", - nodenames = {"mcl_hoppers:hopper_side"}, - neighbors = {"group:container"}, - interval = 1.0, - chance = 1, - action = function(pos, node, active_object_count, active_object_count_wider) - -- Determine to which side the hopper is facing, get nodes - local face = minetest.get_node(pos).param2 - local front = {} - if face == 0 then - front = {x=pos.x-1,y=pos.y,z=pos.z} - elseif face == 1 then - front = {x=pos.x,y=pos.y,z=pos.z+1} - elseif face == 2 then - front = {x=pos.x+1,y=pos.y,z=pos.z} - elseif face == 3 then - front = {x=pos.x,y=pos.y,z=pos.z-1} - end - local above = {x=pos.x,y=pos.y+1,z=pos.z} - - local frontnode = minetest.get_node(front) - if not minetest.registered_nodes[frontnode.name] then return end - - -- Suck an item from the container above into the hopper - local abovenode = minetest.get_node(above) - if not minetest.registered_nodes[abovenode.name] then return end - local g = minetest.registered_nodes[abovenode.name].groups.container - local sucked = mcl_util.move_item_container(above, pos) - - -- Also suck in non-fuel items from furnace fuel slot - if not sucked and g == 4 then - local finv = minetest.get_inventory({type="node", pos=above}) - if finv and not mcl_util.is_fuel(finv:get_stack("fuel", 1)) then - mcl_util.move_item_container(above, pos, "fuel") - end - end - - -- Move an item from the hopper into the container to which the hopper points to - local g = minetest.registered_nodes[frontnode.name].groups.container - if g == 2 or g == 3 or g == 5 or g == 6 then - mcl_util.move_item_container(pos, front) - elseif g == 4 then - -- Put fuel into fuel slot - local sinv = minetest.get_inventory({type="node", pos = pos}) - local dinv = minetest.get_inventory({type="node", pos = front}) - local slot_id,_ = mcl_util.get_eligible_transfer_item_slot(sinv, "main", dinv, "fuel", is_transferrable_fuel) - if slot_id then - mcl_util.move_item_container(pos, front, nil, slot_id, "fuel") - end - end - end -}) - minetest.register_craft({ - output = "mcl_hoppers:hopper", + output = HOPPER, recipe = { {"mcl_core:iron_ingot","","mcl_core:iron_ingot"}, {"mcl_core:iron_ingot","mcl_chests:chest","mcl_core:iron_ingot"}, @@ -478,21 +453,20 @@ minetest.register_craft({ } }) --- Add entry aliases for the Help if minetest.get_modpath("doc") then - doc.add_entry_alias("nodes", "mcl_hoppers:hopper", "nodes", "mcl_hoppers:hopper_side") + doc.add_entry_alias("nodes", HOPPER, "nodes", HOPPER_SIDE) end --- Legacy -minetest.register_alias("mcl_hoppers:hopper_item", "mcl_hoppers:hopper") - minetest.register_lbm({ label = "Update hopper formspecs (0.60.0", name = "mcl_hoppers:update_formspec_0_60_0", nodenames = { "group:hopper" }, run_at_every_load = false, action = function(pos, node) - local meta = minetest.get_meta(pos) + local meta = minetest_get_meta(pos) meta:set_string("formspec", mcl_hoppers_formspec) end, }) + +-- Legacy +minetest.register_alias("mcl_hoppers:hopper_item", HOPPER) diff --git a/mods/ITEMS/mcl_hoppers/mod.conf b/mods/ITEMS/mcl_hoppers/mod.conf index c89292f6b..8028a93ed 100644 --- a/mods/ITEMS/mcl_hoppers/mod.conf +++ b/mods/ITEMS/mcl_hoppers/mod.conf @@ -1,4 +1,5 @@ name = mcl_hoppers +author = jordan4ibanez description = It's just a clone of Minecraft hoppers, functions nearly identical to them minus mesecons making them stop and the way they're placed. depends = mcl_core, mcl_formspec, mcl_sounds, mcl_util optional_depends = doc, screwdriver diff --git a/mods/ITEMS/mcl_itemframes/init.lua b/mods/ITEMS/mcl_itemframes/init.lua index 5dde560b7..eb20719b4 100644 --- a/mods/ITEMS/mcl_itemframes/init.lua +++ b/mods/ITEMS/mcl_itemframes/init.lua @@ -2,303 +2,351 @@ local S = minetest.get_translator(minetest.get_current_modname()) local VISUAL_SIZE = 0.3 -minetest.register_entity("mcl_itemframes:item",{ - hp_max = 1, - visual = "wielditem", - visual_size = {x=VISUAL_SIZE, y=VISUAL_SIZE}, - physical = false, - pointable = false, - textures = { "blank.png" }, - _texture = "blank.png", - _scale = 1, +local vari = {{ "mcl_itemframes:item", "mcl_itemframes:map", "mcl_itemframes:item_frame", S("Item Frame"), S("Can hold an item"), S("Item frames are decorative blocks in which items can be placed."), "mcl_itemframes_itemframe1facedir.obj", "mcl_itemframes_itemframe_background.png", "default_wood.png", "mcl_itemframes_item_frame.png", "mcl_itemframes_item_frame.png", {"itemframes:frame"}}, +{ "mcl_itemframes:glow_item", "mcl_itemframes:glow_map", "mcl_itemframes:glow_item_frame", S("Glow Item Frame"), S("Can hold an item and glows"), S("Glow Item frames are decorative blocks in which items can be placed."), "extra_mobs_glow_item_frame.obj", "extra_mobs_glow_item_frame_border.png", "extra_mobs_glow_item_frame_border.png", "extra_mobs_glow_item_frame_item.png", "extra_mobs_glow_item_frame.png", {"extra_mobs:glow_frame", "extra_mobs:glow_item_frame"}}, +} - on_activate = function(self, staticdata) - if staticdata and staticdata ~= "" then - local data = staticdata:split(";") - if data and data[1] and data[2] then - self._nodename = data[1] - self._texture = data[2] - if data[3] then - self._scale = data[3] - else - self._scale = 1 - end - end - end - if self._texture then - self.object:set_properties({ - textures={self._texture}, - visual_size={x=VISUAL_SIZE/self._scale, y=VISUAL_SIZE/self._scale}, - }) - end - end, - get_staticdata = function(self) - if not self then return end - if self._nodename and self._texture then - local ret = self._nodename .. ";" .. self._texture - if self._scale then - ret = ret .. ";" .. self._scale - end - return ret - end - return "" - end, +for v=1, #vari do + local var = vari[v] + minetest.register_entity(var[1],{ + hp_max = 1, + visual = "wielditem", + visual_size = {x=VISUAL_SIZE, y=VISUAL_SIZE}, + physical = false, + pointable = false, + textures = { "blank.png" }, + _texture = "blank.png", + _scale = 1, + glow = (v-1)*minetest.LIGHT_MAX, - _update_texture = function(self) - if self._texture then - self.object:set_properties({ - textures={self._texture}, - visual_size={x=VISUAL_SIZE/self._scale, y=VISUAL_SIZE/self._scale}, - }) - end - end, -}) + on_activate = function(self, staticdata) + if staticdata and staticdata ~= "" then + local data = staticdata:split(";") + if data and data[1] and data[2] then + self._nodename = data[1] + self._texture = data[2] + if data[3] then + self._scale = data[3] + else + self._scale = 1 + end + end + end + if self._texture then + self.object:set_properties({ + textures={self._texture}, + visual_size={x=VISUAL_SIZE/self._scale, y=VISUAL_SIZE/self._scale}, + }) + end + end, + get_staticdata = function(self) + if not self then return end + if self._nodename and self._texture then + local ret = self._nodename .. ";" .. self._texture + if self._scale then + ret = ret .. ";" .. self._scale + end + return ret + end + return "" + end, + + _update_texture = function(self) + if self._texture then + self.object:set_properties({ + textures={self._texture}, + visual_size={x=VISUAL_SIZE/self._scale, y=VISUAL_SIZE/self._scale}, + }) + end + end, + }) -minetest.register_entity("mcl_itemframes:map", { - initial_properties = { - visual = "upright_sprite", - visual_size = {x = 1, y = 1}, - pointable = false, - physical = false, - collide_with_objects = false, - textures = {"blank.png"}, - }, - on_activate = function(self, staticdata) - self.id = staticdata - self.object:set_properties({textures = {mcl_maps.load_map(self.id)}}) - end, - get_staticdata = function(self) - return self.id - end, -}) + minetest.register_entity(var[2], { + initial_properties = { + visual = "upright_sprite", + visual_size = {x = 1, y = 1}, + pointable = false, + physical = false, + collide_with_objects = false, + textures = {"blank.png"}, + }, + on_activate = function(self, staticdata) + self.id = staticdata + mcl_maps.load_map(self.id, function(texture) + -- will not crash even if self.object is invalid by now + self.object:set_properties({textures = {texture}}) + end) + end, + get_staticdata = function(self) + return self.id + end, + }) -local facedir = {} -facedir[0] = {x=0,y=0,z=1} -facedir[1] = {x=1,y=0,z=0} -facedir[2] = {x=0,y=0,z=-1} -facedir[3] = {x=-1,y=0,z=0} + local facedir = {} + facedir[0] = {x=0,y=0,z=1} + facedir[1] = {x=1,y=0,z=0} + facedir[2] = {x=0,y=0,z=-1} + facedir[3] = {x=-1,y=0,z=0} -local remove_item_entity = function(pos, node) - if node.name == "mcl_itemframes:item_frame" then - for _, obj in pairs(minetest.get_objects_inside_radius(pos, 0.5)) do - local entity = obj:get_luaentity() - if entity and (entity.name == "mcl_itemframes:item" or entity.name == "mcl_itemframes:map") then - obj:remove() - end - end - end + local remove_item_entity = function(pos, node) + if node.name == var[3] then + for _, obj in pairs(minetest.get_objects_inside_radius(pos, 0.5)) do + local entity = obj:get_luaentity() + if entity and (entity.name == var[1] or entity.name == var[2]) then + obj:remove() + end + end + end + end + + local update_item_entity = function(pos, node, param2) + remove_item_entity(pos, node) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + local item = inv:get_stack("main", 1) + if not item:is_empty() then + if not param2 then + param2 = node.param2 + end + if node.name == var[3] then + local posad = facedir[param2] + pos.x = pos.x + posad.x*6.5/16 + pos.y = pos.y + posad.y*6.5/16 + pos.z = pos.z + posad.z*6.5/16 + end + local yaw = math.pi*2 - param2 * math.pi/2 + local map_id = item:get_meta():get_string("mcl_maps:id") + if map_id == "" then + local e = minetest.add_entity(pos, var[1]) + local lua = e:get_luaentity() + lua._nodename = node.name + local itemname = item:get_name() + if itemname == "" or itemname == nil then + lua._texture = "blank.png" + lua._scale = 1 + else + lua._texture = itemname + local def = minetest.registered_items[itemname] + lua._scale = def and def.wield_scale and def.wield_scale.x or 1 + end + lua:_update_texture() + if node.name == var[3] then + e:set_yaw(yaw) + end + else + local e = minetest.add_entity(pos, var[2], map_id) + e:set_yaw(yaw) + end + end + end + + local drop_item = function(pos, node, meta, clicker) + local cname = "" + if clicker and clicker:is_player() then + cname = clicker:get_player_name() + end + if node.name == var[3] and not minetest.is_creative_enabled(cname) then + local inv = meta:get_inventory() + local item = inv:get_stack("main", 1) + if not item:is_empty() then + minetest.add_item(pos, item) + end + end + meta:set_string("infotext", "") + remove_item_entity(pos, node) + end + + minetest.register_node(var[3],{ + description = var[4], + _tt_help = var[5], + _doc_items_longdesc = var[6], + _doc_items_usagehelp = S("Just place any item on the item frame. Use the item frame again to retrieve the item."), + drawtype = "mesh", + is_ground_content = false, + mesh = var[7], + selection_box = { type = "fixed", fixed = {-6/16, -6/16, 7/16, 6/16, 6/16, 0.5} }, + collision_box = { type = "fixed", fixed = {-6/16, -6/16, 7/16, 6/16, 6/16, 0.5} }, + tiles = {var[8], var[8], var[8], var[8], var[9], var[8]}, + inventory_image = var[10], + wield_image = var[11], + paramtype = "light", + paramtype2 = "facedir", + + --FIXME: should only be glowing, no light source. How is that possible with a node? + light_source = v-1, + + sunlight_propagates = true, + groups = { dig_immediate=3,deco_block=1,dig_by_piston=1,container=7,attached_node_facedir=1 }, + sounds = mcl_sounds.node_sound_defaults(), + node_placement_prediction = "", + on_timer = function(pos) + local inv = minetest.get_meta(pos):get_inventory() + local stack = inv:get_stack("main", 1) + local itemname = stack:get_name() + if minetest.get_item_group(itemname, "clock") > 0 then + local new_name = "mcl_clock:clock_" .. (mcl_worlds.clock_works(pos) and mcl_clock.old_time or mcl_clock.random_frame) + if itemname ~= new_name then + stack:set_name(new_name) + inv:set_stack("main", 1, stack) + local node = minetest.get_node(pos) + update_item_entity(pos, node, node.param2) + end + minetest.get_node_timer(pos):start(1.0) + end + end, + on_place = function(itemstack, placer, pointed_thing) + if pointed_thing.type ~= "node" then + return itemstack + end + + -- Use pointed node's on_rightclick function first, if present + local node = minetest.get_node(pointed_thing.under) + if placer and not placer:get_player_control().sneak then + if minetest.registered_nodes[node.name] and minetest.registered_nodes[node.name].on_rightclick then + return minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, placer, itemstack) or itemstack + end + end + + return minetest.item_place(itemstack, placer, pointed_thing, minetest.dir_to_facedir(vector.direction(pointed_thing.above, pointed_thing.under))) + end, + on_construct = function(pos) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + inv:set_size("main", 1) + end, + on_rightclick = function(pos, node, clicker, itemstack) + if not itemstack then + return + end + local pname = clicker:get_player_name() + if minetest.is_protected(pos, pname) then + minetest.record_protection_violation(pos, pname) + return + end + local meta = minetest.get_meta(pos) + drop_item(pos, node, meta, clicker) + local inv = meta:get_inventory() + if itemstack:is_empty() then + remove_item_entity(pos, node) + meta:set_string("infotext", "") + inv:set_stack("main", 1, "") + return itemstack + end + local put_itemstack = ItemStack(itemstack) + put_itemstack:set_count(1) + local itemname = put_itemstack:get_name() + if minetest.get_item_group(itemname, "compass") > 0 then + put_itemstack:set_name("mcl_compass:" .. mcl_compass.get_compass_image(pos, minetest.dir_to_yaw(minetest.facedir_to_dir(node.param2)))) + end + if minetest.get_item_group(itemname, "clock") > 0 then + minetest.get_node_timer(pos):start(1.0) + end + inv:set_stack("main", 1, put_itemstack) + update_item_entity(pos, node) + -- Add node infotext when item has been named + local imeta = itemstack:get_meta() + local iname = imeta:get_string("name") + if iname then + meta:set_string("infotext", iname) + end + + if not minetest.is_creative_enabled(clicker:get_player_name()) then + itemstack:take_item() + end + return itemstack + end, + allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) + local name = player:get_player_name() + if minetest.is_protected(pos, name) then + minetest.record_protection_violation(pos, name) + return 0 + else + return count + end + end, + allow_metadata_inventory_take = function(pos, listname, index, stack, player) + local name = player:get_player_name() + if minetest.is_protected(pos, name) then + minetest.record_protection_violation(pos, name) + return 0 + else + return stack:get_count() + end + end, + allow_metadata_inventory_put = function(pos, listname, index, stack, player) + local name = player:get_player_name() + if minetest.is_protected(pos, name) then + minetest.record_protection_violation(pos, name) + return 0 + else + return stack:get_count() + end + end, + on_destruct = function(pos) + local meta = minetest.get_meta(pos) + local node = minetest.get_node(pos) + drop_item(pos, node, meta) + end, + on_rotate = function(pos, node, user, mode, param2) + if mode == screwdriver.ROTATE_FACE then + -- Rotate face + --local meta = minetest.get_meta(pos) + local node = minetest.get_node(pos) + + local objs = nil + if node.name == var[3] then + objs = minetest.get_objects_inside_radius(pos, 0.5) + end + if objs then + for _, obj in ipairs(objs) do + if obj and obj:get_luaentity() and obj:get_luaentity().name == var[1] then + update_item_entity(pos, node, (node.param2+1) % 4) + break + end + end + end + return + elseif mode == screwdriver.ROTATE_AXIS then + return false + end + end, + }) + + minetest.register_lbm({ + label = "Update legacy item frames", + name = "mcl_itemframes:update_legacy_item_frames", + nodenames = var[12], + action = function(pos, node) + -- Swap legacy node, then respawn entity + node.name = var[3] + local meta = minetest.get_meta(pos) + local item = meta:get_string("item") + minetest.swap_node(pos, node) + if item ~= "" then + local itemstack = ItemStack(minetest.deserialize(meta:get_string("itemdata"))) + local inv = meta:get_inventory() + inv:set_size("main", 1) + if not itemstack:is_empty() then + inv:set_stack("main", 1, itemstack) + end + end + update_item_entity(pos, node) + end, + }) + + -- FIXME: Item entities can get destroyed by /clearobjects + minetest.register_lbm({ + label = "Respawn item frame item entities", + name = "mcl_itemframes:respawn_entities", + nodenames = {var[3]}, + run_at_every_load = true, + action = function(pos, node) + update_item_entity(pos, node) + end, + }) end -local update_item_entity = function(pos, node, param2) - remove_item_entity(pos, node) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - local item = inv:get_stack("main", 1) - if not item:is_empty() then - if not param2 then - param2 = node.param2 - end - if node.name == "mcl_itemframes:item_frame" then - local posad = facedir[param2] - pos.x = pos.x + posad.x*6.5/16 - pos.y = pos.y + posad.y*6.5/16 - pos.z = pos.z + posad.z*6.5/16 - end - local yaw = math.pi*2 - param2 * math.pi/2 - local map_id = item:get_meta():get_string("mcl_maps:id") - if map_id == "" then - local e = minetest.add_entity(pos, "mcl_itemframes:item") - local lua = e:get_luaentity() - lua._nodename = node.name - local itemname = item:get_name() - if itemname == "" or itemname == nil then - lua._texture = "blank.png" - lua._scale = 1 - else - lua._texture = itemname - local def = minetest.registered_items[itemname] - lua._scale = def and def.wield_scale and def.wield_scale.x or 1 - end - lua:_update_texture() - if node.name == "mcl_itemframes:item_frame" then - e:set_yaw(yaw) - end - else - local e = minetest.add_entity(pos, "mcl_itemframes:map", map_id) - e:set_yaw(yaw) - end - end -end - -local drop_item = function(pos, node, meta, clicker) - local cname = "" - if clicker and clicker:is_player() then - cname = clicker:get_player_name() - end - if node.name == "mcl_itemframes:item_frame" and not minetest.is_creative_enabled(cname) then - local inv = meta:get_inventory() - local item = inv:get_stack("main", 1) - if not item:is_empty() then - minetest.add_item(pos, item) - end - end - meta:set_string("infotext", "") - remove_item_entity(pos, node) -end - -minetest.register_node("mcl_itemframes:item_frame",{ - description = S("Item Frame"), - _tt_help = S("Can hold an item"), - _doc_items_longdesc = S("Item frames are decorative blocks in which items can be placed."), - _doc_items_usagehelp = S("Just place any item on the item frame. Use the item frame again to retrieve the item."), - drawtype = "mesh", - is_ground_content = false, - mesh = "mcl_itemframes_itemframe1facedir.obj", - selection_box = { type = "fixed", fixed = {-6/16, -6/16, 7/16, 6/16, 6/16, 0.5} }, - collision_box = { type = "fixed", fixed = {-6/16, -6/16, 7/16, 6/16, 6/16, 0.5} }, - tiles = {"mcl_itemframes_itemframe_background.png", "mcl_itemframes_itemframe_background.png", "mcl_itemframes_itemframe_background.png", "mcl_itemframes_itemframe_background.png", "default_wood.png", "mcl_itemframes_itemframe_background.png"}, - inventory_image = "mcl_itemframes_item_frame.png", - wield_image = "mcl_itemframes_item_frame.png", - paramtype = "light", - paramtype2 = "facedir", - sunlight_propagates = true, - groups = { dig_immediate=3,deco_block=1,dig_by_piston=1,container=7,attached_node_facedir=1 }, - sounds = mcl_sounds.node_sound_defaults(), - node_placement_prediction = "", - on_timer = function(pos) - local inv = minetest.get_meta(pos):get_inventory() - local stack = inv:get_stack("main", 1) - local itemname = stack:get_name() - if minetest.get_item_group(itemname, "clock") > 0 then - local new_name = "mcl_clock:clock_" .. (mcl_worlds.clock_works(pos) and mcl_clock.old_time or mcl_clock.random_frame) - if itemname ~= new_name then - stack:set_name(new_name) - inv:set_stack("main", 1, stack) - local node = minetest.get_node(pos) - update_item_entity(pos, node, node.param2) - end - minetest.get_node_timer(pos):start(1.0) - end - end, - on_place = function(itemstack, placer, pointed_thing) - if pointed_thing.type ~= "node" then - return itemstack - end - - -- Use pointed node's on_rightclick function first, if present - local node = minetest.get_node(pointed_thing.under) - if placer and not placer:get_player_control().sneak then - if minetest.registered_nodes[node.name] and minetest.registered_nodes[node.name].on_rightclick then - return minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, placer, itemstack) or itemstack - end - end - - return minetest.item_place(itemstack, placer, pointed_thing, minetest.dir_to_facedir(vector.direction(pointed_thing.above, pointed_thing.under))) - end, - on_construct = function(pos) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - inv:set_size("main", 1) - end, - on_rightclick = function(pos, node, clicker, itemstack) - if not itemstack then - return - end - local pname = clicker:get_player_name() - if minetest.is_protected(pos, pname) then - minetest.record_protection_violation(pos, pname) - return - end - local meta = minetest.get_meta(pos) - drop_item(pos, node, meta, clicker) - local inv = meta:get_inventory() - if itemstack:is_empty() then - remove_item_entity(pos, node) - meta:set_string("infotext", "") - inv:set_stack("main", 1, "") - return itemstack - end - local put_itemstack = ItemStack(itemstack) - put_itemstack:set_count(1) - local itemname = put_itemstack:get_name() - if minetest.get_item_group(itemname, "compass") > 0 then - put_itemstack:set_name("mcl_compass:" .. mcl_compass.get_compass_image(pos, minetest.dir_to_yaw(minetest.facedir_to_dir(node.param2)))) - end - if minetest.get_item_group(itemname, "clock") > 0 then - minetest.get_node_timer(pos):start(1.0) - end - inv:set_stack("main", 1, put_itemstack) - update_item_entity(pos, node) - -- Add node infotext when item has been named - local imeta = itemstack:get_meta() - local iname = imeta:get_string("name") - if iname then - meta:set_string("infotext", iname) - end - - if not minetest.is_creative_enabled(clicker:get_player_name()) then - itemstack:take_item() - end - return itemstack - end, - allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) - local name = player:get_player_name() - if minetest.is_protected(pos, name) then - minetest.record_protection_violation(pos, name) - return 0 - else - return count - end - end, - allow_metadata_inventory_take = function(pos, listname, index, stack, player) - local name = player:get_player_name() - if minetest.is_protected(pos, name) then - minetest.record_protection_violation(pos, name) - return 0 - else - return stack:get_count() - end - end, - allow_metadata_inventory_put = function(pos, listname, index, stack, player) - local name = player:get_player_name() - if minetest.is_protected(pos, name) then - minetest.record_protection_violation(pos, name) - return 0 - else - return stack:get_count() - end - end, - on_destruct = function(pos) - local meta = minetest.get_meta(pos) - local node = minetest.get_node(pos) - drop_item(pos, node, meta) - end, - on_rotate = function(pos, node, user, mode, param2) - if mode == screwdriver.ROTATE_FACE then - -- Rotate face - --local meta = minetest.get_meta(pos) - local node = minetest.get_node(pos) - - local objs = nil - if node.name == "mcl_itemframes:item_frame" then - objs = minetest.get_objects_inside_radius(pos, 0.5) - end - if objs then - for _, obj in ipairs(objs) do - if obj and obj:get_luaentity() and obj:get_luaentity().name == "mcl_itemframes:item" then - update_item_entity(pos, node, (node.param2+1) % 4) - break - end - end - end - return - elseif mode == screwdriver.ROTATE_AXIS then - return false - end - end, -}) - minetest.register_craft({ output = "mcl_itemframes:item_frame", recipe = { @@ -308,37 +356,13 @@ minetest.register_craft({ } }) -minetest.register_lbm({ - label = "Update legacy item frames", - name = "mcl_itemframes:update_legacy_item_frames", - nodenames = {"itemframes:frame"}, - action = function(pos, node) - -- Swap legacy node, then respawn entity - node.name = "mcl_itemframes:item_frame" - local meta = minetest.get_meta(pos) - local item = meta:get_string("item") - minetest.swap_node(pos, node) - if item ~= "" then - local itemstack = ItemStack(minetest.deserialize(meta:get_string("itemdata"))) - local inv = meta:get_inventory() - inv:set_size("main", 1) - if not itemstack:is_empty() then - inv:set_stack("main", 1, itemstack) - end - end - update_item_entity(pos, node) - end, -}) - --- FIXME: Item entities can get destroyed by /clearobjects -minetest.register_lbm({ - label = "Respawn item frame item entities", - name = "mcl_itemframes:respawn_entities", - nodenames = {"mcl_itemframes:item_frame"}, - run_at_every_load = true, - action = function(pos, node) - update_item_entity(pos, node) - end, +minetest.register_craft({ + type = "shapeless", + output = 'mcl_itemframes:glow_item_frame', + recipe = {'mcl_itemframes:item_frame', 'extra_mobs:glow_ink_sac'}, }) minetest.register_alias("itemframes:frame", "mcl_itemframes:item_frame") +minetest.register_alias("extra_mobs:glow_item_frame","mcl_itemframes:glow_item_frame") +minetest.register_alias("extra_mobs:glow_frame","mcl_itemframes:glow_item_frame") +minetest.register_alias("extra_mobs:glow_item_frame_item","mcl_itemframes:glow_item") diff --git a/mods/ITEMS/mcl_itemframes/locale/mcl_itemframes.fr.tr b/mods/ITEMS/mcl_itemframes/locale/mcl_itemframes.fr.tr index 180c5555f..e519db90b 100644 --- a/mods/ITEMS/mcl_itemframes/locale/mcl_itemframes.fr.tr +++ b/mods/ITEMS/mcl_itemframes/locale/mcl_itemframes.fr.tr @@ -3,3 +3,9 @@ Item Frame=Cadre Item frames are decorative blocks in which items can be placed.=Les cadres sont des blocs décoratifs dans lesquels les objets peuvent être placés. Just place any item on the item frame. Use the item frame again to retrieve the item.=Placez simplement n'importe quel objet sur le cadre. Utilisez à nouveau le cadre décoré pour récupérer l'élément. Can hold an item=Peut contenir un objet +Use it to craft the Glow Item Frame.=Utilisez le pour fabriquer le Cadre à Objet Lumineux +Use the Glow Ink Sac and the normal Item Frame to craft the Glow Item Frame.=Utiliser le Sac d'Encre Lumineuse et le Cadre à Objet normal pour fabriquer le Cadre à Objet Lumineux. +Glow Item Frame=Cadre à Objet Lumineux +Can hold an item and glows=Peut exposer un objet et éclairer +Glow Item frames are decorative blocks in which items can be placed.=les Cadres à Objet Lumineux sont des blocs décoratifs pouvant contenir des objets. +Just place any item on the item frame. Use the item frame again to retrieve the item.=Placer n'importe quel objet sur le cadre. Récupérer l'objet en faisant un clic droit sur le cadre. \ No newline at end of file diff --git a/mods/ITEMS/mcl_itemframes/locale/mcl_itemframes.ru.tr b/mods/ITEMS/mcl_itemframes/locale/mcl_itemframes.ru.tr index 81902e716..e82bf24aa 100644 --- a/mods/ITEMS/mcl_itemframes/locale/mcl_itemframes.ru.tr +++ b/mods/ITEMS/mcl_itemframes/locale/mcl_itemframes.ru.tr @@ -3,3 +3,9 @@ Item Frame=Рамка Item frames are decorative blocks in which items can be placed.=Рамки это декоративные блоки, в которые можно помещать предметы. Just place any item on the item frame. Use the item frame again to retrieve the item.=Просто поместите в рамку любой предмет. Используйте рамку вновь, чтобы забрать из неё предмет обратно. Can hold an item=Может хранить предмет +Use it to craft the Glow Item Frame.=Используется для крафта светящейся рамки. +Use the Glow Ink Sac and the normal Item Frame to craft the Glow Item Frame.=Используйте светящийся чернильный мешок и обычную рамку для крафта светящейся рамки. +Glow Item Frame=Светящаяся рамка +Can hold an item and glows=Светится и может хранить предмет +Glow Item frames are decorative blocks in which items can be placed.=Светящаяся рамка это декоративный блок в который можно положить предметы. +Just place any item on the item frame. Use the item frame again to retrieve the item.=Просто используйте любой предмет на рамке. Используйте рамку снова, чтобы забрать предмет. \ No newline at end of file diff --git a/mods/ITEMS/mcl_itemframes/locale/template.txt b/mods/ITEMS/mcl_itemframes/locale/template.txt index bacbfaa69..179738682 100644 --- a/mods/ITEMS/mcl_itemframes/locale/template.txt +++ b/mods/ITEMS/mcl_itemframes/locale/template.txt @@ -3,3 +3,9 @@ Item Frame= Item frames are decorative blocks in which items can be placed.= Just place any item on the item frame. Use the item frame again to retrieve the item.= Can hold an item= +Use it to craft the Glow Item Frame.= +Use the Glow Ink Sac and the normal Item Frame to craft the Glow Item Frame.= +Glow Item Frame= +Can hold an item and glows= +Glow Item frames are decorative blocks in which items can be placed.= +Just place any item on the item frame. Use the item frame again to retrieve the item.= \ No newline at end of file diff --git a/mods/ITEMS/mcl_itemframes/mod.conf b/mods/ITEMS/mcl_itemframes/mod.conf index ff09c3bcc..c8f25009c 100644 --- a/mods/ITEMS/mcl_itemframes/mod.conf +++ b/mods/ITEMS/mcl_itemframes/mod.conf @@ -1,3 +1,3 @@ name = mcl_itemframes -depends = mcl_core, mcl_sounds, mcl_compass, mcl_maps +depends = mcl_core, mcl_sounds, mcl_compass, mcl_maps, extra_mobs optional_depends = screwdriver diff --git a/mods/ENTITIES/extra_mobs/models/extra_mobs_glow_item_frame.obj b/mods/ITEMS/mcl_itemframes/models/extra_mobs_glow_item_frame.obj similarity index 100% rename from mods/ENTITIES/extra_mobs/models/extra_mobs_glow_item_frame.obj rename to mods/ITEMS/mcl_itemframes/models/extra_mobs_glow_item_frame.obj diff --git a/mods/ENTITIES/extra_mobs/textures/extra_mobs_glow_item_frame.png b/mods/ITEMS/mcl_itemframes/textures/extra_mobs_glow_item_frame.png similarity index 100% rename from mods/ENTITIES/extra_mobs/textures/extra_mobs_glow_item_frame.png rename to mods/ITEMS/mcl_itemframes/textures/extra_mobs_glow_item_frame.png diff --git a/mods/ENTITIES/extra_mobs/textures/extra_mobs_glow_item_frame_border.png b/mods/ITEMS/mcl_itemframes/textures/extra_mobs_glow_item_frame_border.png similarity index 100% rename from mods/ENTITIES/extra_mobs/textures/extra_mobs_glow_item_frame_border.png rename to mods/ITEMS/mcl_itemframes/textures/extra_mobs_glow_item_frame_border.png diff --git a/mods/ENTITIES/extra_mobs/textures/extra_mobs_glow_item_frame_item.png b/mods/ITEMS/mcl_itemframes/textures/extra_mobs_glow_item_frame_item.png similarity index 100% rename from mods/ENTITIES/extra_mobs/textures/extra_mobs_glow_item_frame_item.png rename to mods/ITEMS/mcl_itemframes/textures/extra_mobs_glow_item_frame_item.png diff --git a/mods/ITEMS/mcl_jukebox/locale/mcl_jukebox.fr.tr b/mods/ITEMS/mcl_jukebox/locale/mcl_jukebox.fr.tr index f89510fa6..5cbc5afa6 100644 --- a/mods/ITEMS/mcl_jukebox/locale/mcl_jukebox.fr.tr +++ b/mods/ITEMS/mcl_jukebox/locale/mcl_jukebox.fr.tr @@ -1,11 +1,11 @@ # textdomain: mcl_jukebox Music Disc=Disque de musique -A music disc holds a single music track which can be used in a jukebox to play music.=Un disque de musique contient une seule piste musicale qui peut être utilisée dans un juke-box pour lire de la musique. +A music disc holds a single music track which can be used in a jukebox to play music.=Un disque de musique contient une seule piste musicale qui peut être utilisée dans un juke-box pour jouer de la musique. Place a music disc into an empty jukebox to play the music. Use the jukebox again to retrieve the music disc. The music can only be heard by you, not by other players.=Placez un disque de musique dans un juke-box vide pour lire la musique. Utilisez à nouveau le juke-box pour récupérer le disque de musique. La musique ne peut être entendue que par vous, pas par les autres joueurs. Music Disc=Disque de musique @1—@2=@1—@2 Jukebox=Juke-box Jukeboxes play music when they're supplied with a music disc.=Les juke-box diffusent de la musique lorsqu'ils sont fournis avec un disque de musique. -Place a music disc into an empty jukebox to insert the music disc and play music. If the jukebox already has a music disc, you will retrieve this music disc first. The music can only be heard by you, not by other players.=Placez un disque de musique dans un juke-box vide pour insérer le disque de musique et lire de la musique. Si le juke-box possède déjà un disque de musique, vous allez d'abord récupérer ce disque de musique. La musique ne peut être entendue que par vous, pas par les autres joueurs. +Place a music disc into an empty jukebox to insert the music disc and play music. If the jukebox already has a music disc, you will retrieve this music disc first. The music can only be heard by you, not by other players.=Placez un disque de musique dans un juke-box vide pour insérer le disque de musique et jouer de la musique. Si le juke-box contient déjà un disque de musique, vous allez d'abord récupérer ce disque de musique. La musique ne peut être entendue que par vous, pas par les autres joueurs. Now playing: @1—@2=En cours de lecture: @1—@2 -Uses music discs to play music=Utilise des disques de musique pour lire de la musique +Uses music discs to play music=Utilise des disques de musique pour jouer de la musique diff --git a/mods/ITEMS/mcl_lanterns/init.lua b/mods/ITEMS/mcl_lanterns/init.lua index e6707b075..8f99ea151 100644 --- a/mods/ITEMS/mcl_lanterns/init.lua +++ b/mods/ITEMS/mcl_lanterns/init.lua @@ -1,5 +1,5 @@ -local S = minetest.get_translator("mcl_lanterns") -local modpath = minetest.get_modpath("mcl_lanterns") +local S = minetest.get_translator(minetest.get_current_modname()) +local modpath = minetest.get_modpath(minetest.get_current_modname()) mcl_lanterns = {} diff --git a/mods/ITEMS/mcl_lanterns/locale/mcl_lanterns.fr.tr b/mods/ITEMS/mcl_lanterns/locale/mcl_lanterns.fr.tr new file mode 100644 index 000000000..21e7e2af5 --- /dev/null +++ b/mods/ITEMS/mcl_lanterns/locale/mcl_lanterns.fr.tr @@ -0,0 +1,6 @@ +# textdomain: mcl_lanterns +Chain=Chaine +Chains are metallic decoration blocks.=Les chaines sont des blocs de décoration métalliques. +Lantern=Lanterne +Lanterns are light sources which can be placed on the top or the bottom of most blocks.=Les lanternes sont des sources de lumières qui peuvent être placées au sommet ou en-dessous de la plupart des blocs. +Soul Lantern=Lanterne des âmes \ No newline at end of file diff --git a/mods/ITEMS/mcl_lanterns/locale/template.txt b/mods/ITEMS/mcl_lanterns/locale/template.txt new file mode 100644 index 000000000..dc7cf0782 --- /dev/null +++ b/mods/ITEMS/mcl_lanterns/locale/template.txt @@ -0,0 +1,6 @@ +# textdomain: mcl_lanterns +Chain= +Chains are metallic decoration blocks.= +Lantern= +Lanterns are light sources which can be placed on the top or the bottom of most blocks.= +Soul Lantern= \ No newline at end of file diff --git a/mods/ITEMS/mcl_lanterns/register.lua b/mods/ITEMS/mcl_lanterns/register.lua index 7cf03d0d5..fcffbdcb8 100644 --- a/mods/ITEMS/mcl_lanterns/register.lua +++ b/mods/ITEMS/mcl_lanterns/register.lua @@ -1,4 +1,4 @@ -local S = minetest.get_translator("mcl_lanterns") +local S = minetest.get_translator(minetest.get_current_modname()) mcl_lanterns.register_lantern("lantern", { description = S("Lantern"), diff --git a/mods/ITEMS/mcl_loom/README.md b/mods/ITEMS/mcl_loom/README.md new file mode 100644 index 000000000..e91bad8fd --- /dev/null +++ b/mods/ITEMS/mcl_loom/README.md @@ -0,0 +1,19 @@ +mcl_loom +-------- +Looms, by PrairieWind + +Adds Looms to MineClone 2/5. Used to add patterns to banners. + +License of source code +---------------------- +LGPLv2.1 + +License of media +---------------- + +loom_bottom.png +loom_front.png +loom_side.png +loom_top.png +License: CC BY-SA 4.0 +Author: MrRar diff --git a/mods/ITEMS/mcl_loom/init.lua b/mods/ITEMS/mcl_loom/init.lua new file mode 100644 index 000000000..19be8d58b --- /dev/null +++ b/mods/ITEMS/mcl_loom/init.lua @@ -0,0 +1,27 @@ +local S = minetest.get_translator(minetest.get_current_modname()) +-- Loom Code. Used to craft banner designs easier. Still needs a GUI. https://minecraft.fandom.com/wiki/Loom + +minetest.register_node("mcl_loom:loom", { + description = S("Loom"), + _tt_help = S("Used to create banner designs"), + _doc_items_longdesc = S("This is the shepherd villager's work station. It is used to create banner designs."), + tiles = { + "loom_top.png", "loom_bottom.png", + "loom_side.png", "loom_side.png", + "loom_side.png", "loom_front.png" + }, + paramtype2 = "facedir", + groups = { axey = 2, handy = 1, deco_block = 1, material_wood = 1, flammable = 1 }, + _mcl_blast_resistance = 2.5, + _mcl_hardness = 2.5 +}) + + +minetest.register_craft({ + output = "mcl_loom:loom", + recipe = { + { "", "", "" }, + { "mcl_mobitems:string", "mcl_mobitems:string", "" }, + { "group:wood", "group:wood", "" }, + } +}) diff --git a/mods/ITEMS/mcl_loom/locale/mcl_loom.fr.tr b/mods/ITEMS/mcl_loom/locale/mcl_loom.fr.tr new file mode 100644 index 000000000..410099428 --- /dev/null +++ b/mods/ITEMS/mcl_loom/locale/mcl_loom.fr.tr @@ -0,0 +1,4 @@ +# textdomain: mcl_loom +Loom=Métier à tisser +Used to create banner designs=Utilisé pour créer des motifs de bannières +This is the shepherd villager's work station. It is used to create banner designs.=Ceci est le poste de travail du villageois berger. Il est utilisé pour créer des motifs de bannière. \ No newline at end of file diff --git a/mods/ITEMS/mcl_loom/locale/mcl_loom.ru.tr b/mods/ITEMS/mcl_loom/locale/mcl_loom.ru.tr new file mode 100644 index 000000000..2442f76d5 --- /dev/null +++ b/mods/ITEMS/mcl_loom/locale/mcl_loom.ru.tr @@ -0,0 +1,4 @@ +# textdomain: mcl_loom +Loom=Ткацкий станок +Used to create banner designs=Позволяет создавать узоры на флаге +This is the shepherd villager's work station. It is used to create banner designs.=Это рабочее место пастуха. Позволяет создавать узоры на флаге diff --git a/mods/ITEMS/mcl_loom/locale/template.txt b/mods/ITEMS/mcl_loom/locale/template.txt new file mode 100644 index 000000000..31905ea02 --- /dev/null +++ b/mods/ITEMS/mcl_loom/locale/template.txt @@ -0,0 +1,4 @@ +# textdomain: mcl_loom +Loom= +Used to create banner designs= +This is the shepherd villager's work station. It is used to create banner designs.= diff --git a/mods/ITEMS/mcl_loom/mod.conf b/mods/ITEMS/mcl_loom/mod.conf new file mode 100644 index 000000000..9ebb10ff3 --- /dev/null +++ b/mods/ITEMS/mcl_loom/mod.conf @@ -0,0 +1,3 @@ +name = mcl_loom +author = PrairieWind +description = Adds the loom villager workstation to MineClone 2/5. Used to add patterns to banners. \ No newline at end of file diff --git a/mods/ITEMS/mcl_loom/textures/loom_bottom.png b/mods/ITEMS/mcl_loom/textures/loom_bottom.png new file mode 100644 index 000000000..bf4e7c0c5 Binary files /dev/null and b/mods/ITEMS/mcl_loom/textures/loom_bottom.png differ diff --git a/mods/ITEMS/mcl_loom/textures/loom_front.png b/mods/ITEMS/mcl_loom/textures/loom_front.png new file mode 100644 index 000000000..83191e649 Binary files /dev/null and b/mods/ITEMS/mcl_loom/textures/loom_front.png differ diff --git a/mods/ITEMS/mcl_loom/textures/loom_side.png b/mods/ITEMS/mcl_loom/textures/loom_side.png new file mode 100644 index 000000000..3e64107c7 Binary files /dev/null and b/mods/ITEMS/mcl_loom/textures/loom_side.png differ diff --git a/mods/ITEMS/mcl_loom/textures/loom_top.png b/mods/ITEMS/mcl_loom/textures/loom_top.png new file mode 100644 index 000000000..cf0c1e3eb Binary files /dev/null and b/mods/ITEMS/mcl_loom/textures/loom_top.png differ diff --git a/mods/ITEMS/mcl_maps/init.lua b/mods/ITEMS/mcl_maps/init.lua index 413e7382a..34c68f586 100644 --- a/mods/ITEMS/mcl_maps/init.lua +++ b/mods/ITEMS/mcl_maps/init.lua @@ -8,6 +8,8 @@ local map_textures_path = worldpath .. "/mcl_maps/" local math_min = math.min local math_max = math.max +local dynamic_add_media = minetest.dynamic_add_media + minetest.mkdir(map_textures_path) local function load_json_file(name) @@ -55,7 +57,8 @@ function mcl_maps.create_map(pos) local map_y_start = 64 * dx local map_y_limit = 127 * dx - local pixels = {} + --local pixels = "" + local pixels = {} local last_heightmap for x = 1, 128 do local map_x = x + offset @@ -125,40 +128,59 @@ function mcl_maps.create_map(pos) height = map_y - map_z heightmap[z] = height or minp.y - pixels[#pixels + 1] = color and {r = color[1], g = color[2], b = color[3]} or {r = 0, g = 0, b = 0} + pixels[z] = pixels[z] or {} + pixels[z][x] = color or {0, 0, 0} + --if not color then color = {0, 0, 0} end + --pixels = pixels .. minetest.colorspec_to_bytes({r = color[1], g = color[2], b = color[3]}) end last_heightmap = heightmap end - local png = minetest.encode_png(128, 128, pixels) - local f = io.open(map_textures_path .. "mcl_maps_map_texture_" .. id .. ".png", "w") - if not f then return end - f:write(png) - f:close() - creating_maps[id] = nil + --local png = minetest.encode_png(128, 128, pixels) + --local f = io.open(map_textures_path .. "mcl_maps_map_texture_" .. id .. ".png", "wb") + --if not f then return end + --f:write(png) + --f:close() + tga_encoder.image(pixels):save(map_textures_path .. "mcl_maps_map_texture_" .. id .. ".tga") + creating_maps[id] = nil end) return itemstack end -local loading_maps = {} +--local loading_maps = {} -function mcl_maps.load_map(id) - if id == "" or creating_maps[id] or loading_maps[id] then +function mcl_maps.load_map(id, callback) + if id == "" or creating_maps[id] then--or loading_maps[id] then return end - local texture = "mcl_maps_map_texture_" .. id .. ".png" + --local texture = "mcl_maps_map_texture_" .. id .. ".png" + local texture = "mcl_maps_map_texture_" .. id .. ".tga" if not loaded_maps[id] then - loading_maps[id] = true - minetest.dynamic_add_media({filepath = map_textures_path .. texture, ephemeral = true}, function(player_name) - loaded_maps[id] = true - loading_maps[id] = nil - end) - return + --loading_maps[id] = true + if not minetest.features.dynamic_add_media_table then + -- minetest.dynamic_add_media() blocks in + -- Minetest 5.3 and 5.4 until media loads + dynamic_add_media(map_textures_path .. texture, function(player_name) end) + loaded_maps[id] = true + if callback then callback(texture) end + --loading_maps[id] = nil + else + -- minetest.dynamic_add_media() never blocks + -- in Minetest 5.5, callback runs after load + dynamic_add_media(map_textures_path .. texture, function(player_name) + loaded_maps[id] = true + if callback then callback(texture) end + --loading_maps[id] = nil + end) + end end - return texture + if loaded_maps[id] then + if callback then callback(texture) end + return texture + end end function mcl_maps.load_map_item(itemstack) @@ -219,18 +241,33 @@ filled_wield_def.drawtype = "mesh" filled_wield_def.node_placement_prediction = "" filled_wield_def.range = minetest.registered_items[""].range filled_wield_def.on_place = mcl_util.call_on_rightclick +filled_wield_def.groups.no_wieldview = 1 +filled_wield_def._wieldview_item = "mcl_maps:empty_map" -for _, texture in pairs(mcl_skins.list) do - local def = table.copy(filled_wield_def) - def.tiles = {texture .. ".png"} - def.mesh = "mcl_meshhand.b3d" - def._mcl_hand_id = texture - minetest.register_node("mcl_maps:filled_map_" .. texture, def) +local function player_base_to_node_id(base, colorspec, sex) + return base:gsub("%.", "") .. minetest.colorspec_to_colorstring(colorspec):gsub("#", "") .. sex +end - local female_def = table.copy(def) - female_def.mesh = "mcl_meshhand_female.b3d" - female_def._mcl_hand_id = texture .. "_female" - minetest.register_node("mcl_maps:filled_map_" .. texture .. "_female", female_def) +bases = mcl_skins.base +base_colors = mcl_skins.base_color + +for _, base in pairs(bases) do + for _, base_color in pairs(base_colors) do + local node_id = player_base_to_node_id(base, base_color, "male") + local texture = mcl_skins.make_hand_texture(base, base_color) + local def = table.copy(filled_wield_def) + def.tiles = {texture} + def.mesh = "mcl_meshhand.b3d" + def._mcl_hand_id = node_id + minetest.register_node("mcl_maps:filled_map_" .. node_id, def) + + node_id = player_base_to_node_id(base, base_color, "female") + def = table.copy(filled_wield_def) + def.tiles = {texture} + def.mesh = "mcl_meshhand_female.b3d" + def._mcl_hand_id = node_id + minetest.register_node("mcl_maps:filled_map_" .. node_id, def) + end end local old_add_item = minetest.add_item diff --git a/mods/ITEMS/mcl_maps/mod.conf b/mods/ITEMS/mcl_maps/mod.conf index efe1708dd..9134296b9 100644 --- a/mods/ITEMS/mcl_maps/mod.conf +++ b/mods/ITEMS/mcl_maps/mod.conf @@ -1,2 +1,2 @@ name = mcl_maps -depends = mcl_core, mcl_flowers, tt, mcl_colors, mcl_skins, mcl_util, mcl_time +depends = mcl_core, mcl_flowers, tt, mcl_colors, mcl_skins, mcl_util, mcl_time, tga_encoder diff --git a/mods/ITEMS/mcl_mobitems/init.lua b/mods/ITEMS/mcl_mobitems/init.lua index a7b04d3d4..736fe77bd 100644 --- a/mods/ITEMS/mcl_mobitems/init.lua +++ b/mods/ITEMS/mcl_mobitems/init.lua @@ -20,7 +20,7 @@ minetest.register_craftitem("mcl_mobitems:mutton", { wield_image = "mcl_mobitems_mutton_raw.png", on_place = minetest.item_eat(2), on_secondary_use = minetest.item_eat(2), - groups = { food = 2, eatable = 2 }, + groups = { food = 2, eatable = 2, smoker_cookable = 1 }, _mcl_saturation = 1.2, stack_max = 64, }) @@ -44,7 +44,7 @@ minetest.register_craftitem("mcl_mobitems:beef", { wield_image = "mcl_mobitems_beef_raw.png", on_place = minetest.item_eat(3), on_secondary_use = minetest.item_eat(3), - groups = { food = 2, eatable = 3 }, + groups = { food = 2, eatable = 3, smoker_cookable = 1 }, _mcl_saturation = 1.8, stack_max = 64, }) @@ -69,7 +69,7 @@ minetest.register_craftitem("mcl_mobitems:chicken", { wield_image = "mcl_mobitems_chicken_raw.png", on_place = minetest.item_eat(2), on_secondary_use = minetest.item_eat(2), - groups = { food = 2, eatable = 2 }, + groups = { food = 2, eatable = 2, smoker_cookable = 1 }, _mcl_saturation = 1.2, stack_max = 64, }) @@ -93,7 +93,7 @@ minetest.register_craftitem("mcl_mobitems:porkchop", { wield_image = "mcl_mobitems_porkchop_raw.png", on_place = minetest.item_eat(3), on_secondary_use = minetest.item_eat(3), - groups = { food = 2, eatable = 3 }, + groups = { food = 2, eatable = 3, smoker_cookable = 1 }, _mcl_saturation = 1.8, stack_max = 64, }) @@ -117,7 +117,7 @@ minetest.register_craftitem("mcl_mobitems:rabbit", { wield_image = "mcl_mobitems_rabbit_raw.png", on_place = minetest.item_eat(3), on_secondary_use = minetest.item_eat(3), - groups = { food = 2, eatable = 3 }, + groups = { food = 2, eatable = 3, smoker_cookable = 1 }, _mcl_saturation = 1.8, stack_max = 64, }) @@ -321,7 +321,7 @@ minetest.register_tool("mcl_mobitems:carrot_on_a_stick", { _tt_help = S("Lets you ride a saddled pig"), _doc_items_longdesc = S("A carrot on a stick can be used on saddled pigs to ride them."), _doc_items_usagehelp = S("Place it on a saddled pig to mount it. You can now ride the pig like a horse. Pigs will also walk towards you when you just wield the carrot on a stick."), - wield_image = "mcl_mobitems_carrot_on_a_stick.png", + wield_image = "mcl_mobitems_carrot_on_a_stick.png^[transformFY^[transformR90", inventory_image = "mcl_mobitems_carrot_on_a_stick.png", groups = { transport = 1 }, _mcl_toollike_wield = true, diff --git a/mods/ITEMS/mcl_mobitems/textures/mcl_mobitems_carrot_on_a_stick.png b/mods/ITEMS/mcl_mobitems/textures/mcl_mobitems_carrot_on_a_stick.png index ee7b5af7f..e24f624c4 100644 Binary files a/mods/ITEMS/mcl_mobitems/textures/mcl_mobitems_carrot_on_a_stick.png and b/mods/ITEMS/mcl_mobitems/textures/mcl_mobitems_carrot_on_a_stick.png differ diff --git a/mods/ITEMS/mcl_mushroom/init.lua b/mods/ITEMS/mcl_mushroom/init.lua index 46383699a..42c42dab8 100644 --- a/mods/ITEMS/mcl_mushroom/init.lua +++ b/mods/ITEMS/mcl_mushroom/init.lua @@ -19,10 +19,12 @@ end -- Warped fungus -- Crimson fungus --- Functions and Biomes +-- Nether woods +-- Functions -- WARNING: The most comments are in german. Please Translate with an translater if you don't speak good german +---Warped fungus minetest.register_node("mcl_mushroom:warped_fungus", { description = S("Warped Fungus Mushroom"), drawtype = "plantlike", @@ -158,22 +160,6 @@ minetest.register_node("mcl_mushroom:shroomlight", { light_source = 14, }) -minetest.register_node("mcl_mushroom:warped_hyphae", { - description = S("Warped Hyphae"), - tiles = { - "warped_hyphae.png", - "warped_hyphae.png", - "warped_hyphae_side.png", - "warped_hyphae_side.png", - "warped_hyphae_side.png", - "warped_hyphae_side.png", - }, - groups = {handy=5,axey=1, bark=1, building_block=1, material_wood=1,}, - paramtype2 = "facedir", - stack_max = 64, - _mcl_hardness = 2, -}) - minetest.register_node("mcl_mushroom:warped_nylium", { description = S("Warped Nylium"), tiles = { @@ -213,23 +199,7 @@ minetest.register_node("mcl_mushroom:warped_checknode", { drop = "mcl_nether:netherrack" }) -minetest.register_node("mcl_mushroom:warped_hyphae_wood", { - description = S("Warped Hyphae Wood"), - tiles = {"warped_hyphae_wood.png"}, - groups = {handy=5,axey=1, flammable=3,wood=1,building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=20}, - --paramtype2 = "facedir", - stack_max = 64, - _mcl_hardness = 2, -}) -mcl_stairs.register_stair_and_slab_simple("warped_hyphae_wood", "mcl_mushroom:warped_hyphae_wood", S("Warped Stair"), S("Warped Slab"), S("Double Warped Slab"), "woodlike") - -minetest.register_craft({ - output = "mcl_mushroom:warped_hyphae_wood 4", - recipe = { - {"mcl_mushroom:warped_hyphae"}, - } -}) minetest.register_craft({ output = "mcl_mushroom:warped_nylium 2", @@ -257,7 +227,7 @@ minetest.register_abm({ minetest.register_abm({ label = "mcl_mushroom:warped_checknode", nodenames = {"mcl_mushroom:warped_checknode"}, - interval = 0.1, + interval = 1, chance = 1, action = function(pos) local nodepos = minetest.get_node({x = pos.x, y = pos.y + 1, z = pos.z}) @@ -295,8 +265,7 @@ minetest.register_abm({ --max_height = 200, })]] - - +--- Crimson Fungus minetest.register_node("mcl_mushroom:crimson_fungus", { description = S("Crimson Fungus Mushroom"), drawtype = "plantlike", @@ -349,31 +318,6 @@ minetest.register_node("mcl_mushroom:crimson_roots", { stack_max = 64, }) -minetest.register_node("mcl_mushroom:crimson_hyphae", { - description = S("Crimson Hyphae"), - tiles = { - "crimson_hyphae.png", - "crimson_hyphae.png", - "crimson_hyphae_side.png", - "crimson_hyphae_side.png", - "crimson_hyphae_side.png", - "crimson_hyphae_side.png", - }, - groups = {handy=5,axey=1, bark=1, building_block=1, material_wood=1,}, - paramtype2 = "facedir", - stack_max = 64, - _mcl_hardness = 2, -}) - -minetest.register_node("mcl_mushroom:crimson_hyphae_wood", { - description = S("Crimson Hyphae Wood"), - tiles = {"crimson_hyphae_wood.png"}, - groups = {handy=5,axey=1, wood=1,building_block=1, material_wood=1,}, - paramtype2 = "facedir", - stack_max = 64, - _mcl_hardness = 2, -}) - minetest.register_node("mcl_mushroom:crimson_nylium", { description = S("Crimson Nylium"), tiles = { @@ -413,12 +357,6 @@ minetest.register_node("mcl_mushroom:crimson_checknode", { drop = "mcl_nether:netherrack" }) -minetest.register_craft({ - output = "mcl_mushroom:crimson_hyphae_wood 4", - recipe = { - {"mcl_mushroom:crimson_hyphae"}, - } -}) minetest.register_craft({ output = "mcl_mushroom:crimson_nylium 2", @@ -428,8 +366,6 @@ minetest.register_craft({ } }) -mcl_stairs.register_stair_and_slab_simple("crimson_hyphae_wood", "mcl_mushroom:crimson_hyphae_wood", "Crimson Stair", "Crimson Slab", "Double Crimson Slab", "woodlike") - minetest.register_abm({ label = "mcl_mushroom:crimson_fungus", nodenames = {"mcl_mushroom:crimson_fungus"}, @@ -448,7 +384,7 @@ minetest.register_abm({ minetest.register_abm({ label = "mcl_mushroom:crimson_checknode", nodenames = {"mcl_mushroom:crimson_checknode"}, - interval = 0.1, + interval = 1, chance = 1, action = function(pos) local nodepos = minetest.get_node({x = pos.x, y = pos.y + 1, z = pos.z}) @@ -471,6 +407,252 @@ minetest.register_abm({ end }) + +---Nether Woods + +minetest.register_node("mcl_mushroom:warped_hyphae", { + description = S("Warped Hyphae"), + _doc_items_longdesc = S("The stem of a warped hyphae"), + _doc_items_hidden = false, + tiles = { + "warped_hyphae.png", + "warped_hyphae.png", + "warped_hyphae_side.png", + "warped_hyphae_side.png", + "warped_hyphae_side.png", + "warped_hyphae_side.png", + }, + paramtype2 = "facedir", + on_place = mcl_util.rotate_axis, + groups = {handy=1,axey=1, tree=1, building_block=1, material_wood=1}, + sounds = mcl_sounds.node_sound_wood_defaults(), + on_rotate = on_rotate, + _mcl_blast_resistance = 2, + stack_max = 64, + _mcl_hardness = 2, + _mcl_stripped_variant = "mcl_mushroom:stripped_warped_hyphae", +}) +--Stem bark, stripped stem and bark + +minetest.register_node("mcl_mushroom:warped_hyphae_bark", { + description = S("Warped Hyphae Bark"), + _doc_items_longdesc = S("This is a decorative block surrounded by the bark of an hyphae."), + tiles = {"warped_hyphae_side.png"}, + paramtype2 = "facedir", + on_place = mcl_util.rotate_axis, + stack_max = 64, + groups = {handy=1,axey=1, bark=1, building_block=1, material_wood=1}, + sounds = mcl_sounds.node_sound_wood_defaults(), + is_ground_content = false, + on_rotate = on_rotate, + _mcl_blast_resistance = 2, + _mcl_hardness = 2, + _mcl_stripped_variant = "mcl_mushroom:stripped_warped_hyphae_bark", + }) + +minetest.register_craft({ + output = "mcl_mushroom:warped_hyphae_bark 3", + recipe = { + { "mcl_mushroom:warped_hyphae", "mcl_mushroom:warped_hyphae" }, + { "mcl_mushroom:warped_hyphae", "mcl_mushroom:warped_hyphae" }, + } + }) + + +minetest.register_node("mcl_mushroom:stripped_warped_hyphae", { + description = S("Stripped Warped Hyphae"), + _doc_items_longdesc = S("The stripped stem of a warped hyphae"), + _doc_items_hidden = false, + tiles = {"stripped_warped_stem_top.png", "stripped_warped_stem_top.png", "stripped_warped_stem_side.png"}, + paramtype2 = "facedir", + on_place = mcl_util.rotate_axis, + stack_max = 64, + groups = {handy=1, axey=1, tree=1, building_block=1, material_wood=1}, + sounds = mcl_sounds.node_sound_wood_defaults(), + on_rotate = on_rotate, + _mcl_blast_resistance = 2, + _mcl_hardness = 2, + }) + +minetest.register_node("mcl_mushroom:stripped_warped_hyphae_bark", { + description = S("Stripped Warped Hyphae Bark"), + _doc_items_longdesc = S("The stripped wood of a warped hyphae"), + tiles = {"stripped_warped_stem_side.png"}, + paramtype2 = "facedir", + on_place = mcl_util.rotate_axis, + stack_max = 64, + groups = {handy=1, axey=1, bark=1, building_block=1, material_wood=1}, + sounds = mcl_sounds.node_sound_wood_defaults(), + is_ground_content = false, + on_rotate = on_rotate, + _mcl_blast_resistance = 2, + _mcl_hardness = 2, + }) + +minetest.register_craft({ + output = "mcl_mushroom:stripped_warped_hyphae_bark 3", + recipe = { + { "mcl_mushroom:stripped_warped_hyphae", "mcl_mushroom:stripped_warped_hyphae" }, + { "mcl_mushroom:stripped_warped_hyphae", "mcl_mushroom:stripped_warped_hyphae" }, + } + }) + +--Wood + +minetest.register_node("mcl_mushroom:warped_hyphae_wood", { + description = S("Warped Hyphae Wood"), + tiles = {"warped_hyphae_wood.png"}, + groups = {handy=5,axey=1, wood=1,building_block=1, material_wood=1}, + --paramtype2 = "facedir", + stack_max = 64, + _mcl_hardness = 2, +}) + +mcl_stairs.register_stair_and_slab_simple("warped_hyphae_wood", "mcl_mushroom:warped_hyphae_wood", S("Warped Stair"), S("Warped Slab"), S("Double Warped Slab"), "woodlike") + +minetest.register_craft({ + output = "mcl_mushroom:warped_hyphae_wood 4", + recipe = { + {"mcl_mushroom:warped_hyphae"}, + } +}) + +minetest.register_node("mcl_mushroom:crimson_hyphae", { + description = S("Crimson Hyphae"), + _doc_items_longdesc = S("The stem of a crimson hyphae"), + _doc_items_hidden = false, + tiles = { + "crimson_hyphae.png", + "crimson_hyphae.png", + "crimson_hyphae_side.png", + "crimson_hyphae_side.png", + "crimson_hyphae_side.png", + "crimson_hyphae_side.png", + }, + paramtype2 = "facedir", + on_place = mcl_util.rotate_axis, + groups = {handy=1,axey=1, tree=1, building_block=1, material_wood=1}, + sounds = mcl_sounds.node_sound_wood_defaults(), + on_rotate = on_rotate, + _mcl_blast_resistance = 2, + stack_max = 64, + _mcl_hardness = 2, + _mcl_stripped_variant = "mcl_mushroom:stripped_crimson_hyphae", +}) + +--Stem bark, stripped stem and bark + +minetest.register_node("mcl_mushroom:crimson_hyphae_bark", { + description = S("Crimson Hyphae Bark"), + _doc_items_longdesc = S("This is a decorative block surrounded by the bark of an hyphae."), + tiles = {"crimson_hyphae_side.png"}, + paramtype2 = "facedir", + on_place = mcl_util.rotate_axis, + stack_max = 64, + groups = {handy=1,axey=1, bark=1, building_block=1, material_wood=1,}, + sounds = mcl_sounds.node_sound_wood_defaults(), + is_ground_content = false, + on_rotate = on_rotate, + _mcl_blast_resistance = 2, + _mcl_hardness = 2, + _mcl_stripped_variant = "mcl_mushroom:stripped_crimson_hyphae_bark", + }) + +minetest.register_craft({ + output = "mcl_mushroom:crimson_hyphae_bark 3", + recipe = { + { "mcl_mushroom:crimson_hyphae", "mcl_mushroom:crimson_hyphae" }, + { "mcl_mushroom:crimson_hyphae", "mcl_mushroom:crimson_hyphae" }, + } + }) + + +minetest.register_node("mcl_mushroom:stripped_crimson_hyphae", { + description = S("Stripped Crimson Hyphae"), + _doc_items_longdesc = S("The stripped stem of a crimson hyphae"), + _doc_items_hidden = false, + tiles = {"stripped_crimson_stem_top.png", "stripped_crimson_stem_top.png", "stripped_crimson_stem_side.png"}, + paramtype2 = "facedir", + on_place = mcl_util.rotate_axis, + stack_max = 64, + groups = {handy=1, axey=1, tree=1, building_block=1, material_wood=1}, + sounds = mcl_sounds.node_sound_wood_defaults(), + on_rotate = on_rotate, + _mcl_blast_resistance = 2, + _mcl_hardness = 2, + }) + +minetest.register_node("mcl_mushroom:stripped_crimson_hyphae_bark", { + description = S("Stripped Crimson Hyphae Bark"), + _doc_items_longdesc = S("The stripped wood of a crimson hyphae"), + tiles = {"stripped_crimson_stem_side.png"}, + paramtype2 = "facedir", + on_place = mcl_util.rotate_axis, + stack_max = 64, + groups = {handy=1, axey=1, bark=1, building_block=1, material_wood=1}, + sounds = mcl_sounds.node_sound_wood_defaults(), + is_ground_content = false, + on_rotate = on_rotate, + _mcl_blast_resistance = 2, + _mcl_hardness = 2, + }) + +minetest.register_craft({ + output = "mcl_mushroom:stripped_crimson_hyphae_bark 3", + recipe = { + { "mcl_mushroom:stripped_crimson_hyphae", "mcl_mushroom:stripped_crimson_hyphae" }, + { "mcl_mushroom:stripped_crimson_hyphae", "mcl_mushroom:stripped_crimson_hyphae" }, + } + }) + +--Wood + +minetest.register_node("mcl_mushroom:crimson_hyphae_wood", { + description = S("Crimson Hyphae Wood"), + tiles = {"crimson_hyphae_wood.png"}, + groups = {handy=5,axey=1, wood=1,building_block=1, material_wood=1,}, + paramtype2 = "facedir", + stack_max = 64, + _mcl_hardness = 2, +}) + +minetest.register_craft({ + output = "mcl_mushroom:crimson_hyphae_wood 4", + recipe = { + {"mcl_mushroom:crimson_hyphae"}, + } +}) + +mcl_stairs.register_stair_and_slab_simple("crimson_hyphae_wood", "mcl_mushroom:crimson_hyphae_wood", S("Crimson Stair"), S("Crimson Slab"), S("Double Crimson Slab"), "woodlike") + +--Hyphae Stairs and slabs + +local barks = { + { "warped", S("Warped Bark Stair"), S("Warped Bark Slab"), S("Double Warped Bark Slab") }, + { "crimson", S("Crimson Bark Stair"), S("Crimson Bark Slab"), S("Double Crimson Bark Slab") }, +} + +for b=1, #barks do + local bark = barks[b] + local sub = bark[1].."_hyphae_bark" + local id = "mcl_mushroom:"..bark[1].."_hyphae" + + mcl_stairs.register_stair(sub, id, + {handy=1,axey=1, bark_stairs=1, material_wood=1}, + {minetest.registered_nodes[id].tiles[3]}, + bark[2], + mcl_sounds.node_sound_wood_defaults(), 3, 2, + "woodlike") + mcl_stairs.register_slab(sub, id, + {handy=1,axey=1, bark_slab=1, material_wood=1}, + {minetest.registered_nodes[id].tiles[3]}, + bark[3], + mcl_sounds.node_sound_wood_defaults(), 3, 2, + bark[4]) +end + +---Mapgen and fungus tree + function generate_warped_tree(pos) local breakgrow = false local breakgrow2 = false @@ -648,111 +830,7 @@ function generate_crimson_tree(pos) end else if breakgrow2 == false then - minetest.set_node(pos,{ name = "mcl_mushroom:crimson_fungus" }) + minetest.set_node(pos,{ name = "mcl_mushroom:crimson_fungus" }) end end end - - ---[[ -FIXME: Biomes are to rare -FIXME: Decoration don't do generate -WARNING: Outdatet, the biomes gernerate now different, with Ores --- biomes in test! -minetest.register_biome({ - name = "WarpedForest", - node_filler = "mcl_nether:netherrack", - node_stone = "mcl_nether:netherrack", - node_top = "mcl_mushroom:warped_nylium", - node_water = "air", - node_river_water = "air", - y_min = -29065, - y_max = -28940, - heat_point = 100, - humidity_point = 0, - _mcl_biome_type = "hot", - _mcl_palette_index = 19, -}) -minetest.register_decoration({ - deco_type = "simple", - place_on = {"mcl_mushroom:warped_nylium"}, - sidelen = 16, - noise_params = { - offset = 0.01, - scale = 0.0022, - spread = {x = 250, y = 250, z = 250}, - seed = 2, - octaves = 3, - persist = 0.66 - }, - biomes = {"WarpedForest"}, - y_min = -29065, - y_max = -28940 + 80, - decoration = "mcl_mushroom:warped_fungus", -}) -]] -minetest.register_ore({ - ore_type = "sheet", - ore = "mcl_mushroom:warped_checknode", - -- Note: Stone is included only for v6 mapgen support. Netherrack is not generated naturally - -- in v6, but instead set with the on_generated function in mcl_mapgen_core. - wherein = {"mcl_nether:netherrack", "mcl_core:stone"}, - clust_scarcity = 14 * 14 * 14, - clust_size = 10, - y_min = -29065, - y_max = -28940, - noise_threshold = 0.0, - noise_params = { - offset = 0.5, - scale = 0.1, - spread = {x = 8, y = 8, z = 8}, - seed = 4996, - octaves = 1, - persist = 0.0 - }, -}) - -minetest.register_ore({ - ore_type = "sheet", - ore = "mcl_mushroom:crimson_checknode", - -- Note: Stone is included only for v6 mapgen support. Netherrack is not generated naturally - -- in v6, but instead set with the on_generated function in mcl_mapgen_core. - wherein = {"mcl_nether:netherrack", "mcl_core:stone"}, - clust_scarcity = 10 * 10 * 10, - clust_size = 10, - y_min = -29065, - y_max = -28940, - noise_threshold = 0.0, - noise_params = { - offset = 1, - scale = 0.5, - spread = {x = 12, y = 12, z = 12}, - seed = 12948, - octaves = 1, - persist = 0.0 - }, -}) - - -minetest.register_decoration({ - deco_type = "simple", - place_on = {"mcl_mushroom:warped_nylium"}, - sidelen = 16, - fill_ratio = 0.1, - biomes = {"Nether"}, - y_max = -28940, - y_min = -29065, - decoration = "mcl_mushroom:warped_fungus", -}) - - -minetest.register_decoration({ - deco_type = "simple", - place_on = {"mcl_mushroom:crimson_nylium"}, - sidelen = 16, - fill_ratio = 0.1, - biomes = {"Nether"}, - y_max = -28940, - y_min = -29065, - decoration = "mcl_mushroom:crimson_fungus", -}) diff --git a/mods/ITEMS/mcl_mushroom/locale/mcl_mushroom.fr.tr b/mods/ITEMS/mcl_mushroom/locale/mcl_mushroom.fr.tr index e301a8b8a..589817fbc 100644 --- a/mods/ITEMS/mcl_mushroom/locale/mcl_mushroom.fr.tr +++ b/mods/ITEMS/mcl_mushroom/locale/mcl_mushroom.fr.tr @@ -7,6 +7,16 @@ Warped Roots=Racines tordues Warped Wart Block=Bloc de verrues tordu Shroomlight=Champilampe Warped Hyphae=Tige tordue +The stem of a warped hyphae=La tige d'un champigon géant tordu +Warped Hyphae Bark=Ecorce de Tige tordue +This is a decorative block surrounded by the bark of an hyphae.=Ceci est un bloc décoratif entouré par l'écorce d'une tige. +Stripped Warped Hyphae=Tige tordue écorcée +The stripped stem of a warped hyphae=La tige écorcée d'un champignon géant tordu +Stripped Warped Hyphae Bark=Ecorce de Tige tordue +The stripped wood of a warped hyphae=Le bois écorcé d'un champignon géant tordu +Warped Bark Stair=Escalier d'écorce tordue +Warped Bark Slab=Dalle d'écorce tordue +Double Warped Bark Slab=Double dalle d'écorce tordue Warped Nylium=Nylium tordu Warped Checknode - only to check!=Bloc de vérification tordu - seulement pour vérifier ! Warped Hyphae Wood=Planches tordues @@ -15,6 +25,15 @@ Warped Slab=Dalle tordue Crimson Fungus Mushroom=Champignon écarlate Crimson Roots=Racines écarlates Crimson Hyphae=Tige écarlate +The stem of a crimson hyphae=La tige d'un champigon géant tordu +Crimson Hyphae Bark=Ecorce de Tige écarlate +Stripped Crimson Hyphae=Tige écarlate écorcée +The stripped stem of a crimson hyphae=La tige écorcée d'un champignon géant écarlate +Stripped Crimson Hyphae Bark=Ecorce de Tige écarlate +The stripped wood of a crimson hyphae=Le bois écorcé d'un champignon géant écarlate +Crimson Bark Stair=Escalier d'écorce écarlate +Crimson Bark Slab=Dalle d'écorce écarlate +Double Crimson Bark Slab=Double dalle d'écorce écarlate Crimson Hyphae Wood=Planches écarlates Crimson Stair=Escalier écarlate Crimson Slab=Dalle écarlate diff --git a/mods/ITEMS/mcl_mushroom/locale/template.txt b/mods/ITEMS/mcl_mushroom/locale/template.txt index 67d53d790..67e297f7c 100644 --- a/mods/ITEMS/mcl_mushroom/locale/template.txt +++ b/mods/ITEMS/mcl_mushroom/locale/template.txt @@ -7,17 +7,36 @@ Warped Roots= Warped Wart Block= Shroomlight= Warped Hyphae= +The stem of a warped hyphae= +Warped Hyphae Bark= +This is a decorative block surrounded by the bark of an hyphae.= +Stripped Warped Hyphae= +The stripped stem of a warped hyphae= +Stripped Warped Hyphae Bark= +The stripped wood of a warped hyphae= +Warped Hyphae Wood= +Warped Bark Stair= +Warped Bark Slab= +Double Warped Bark Slab= Warped Nylium= Warped Checknode - only to check!= -Warped Hyphae Wood= Warped Stair= Warped Slab= Crimson Fungus Mushroom= Crimson Roots= Crimson Hyphae= +The stem of a crimson hyphae= +Crimson Hyphae Bark= +Stripped Crimson Hyphae= +The stripped stem of a crimson hyphae= +Stripped Crimson Hyphae Bark= +The stripped wood of a crimson hyphae= +Crimson Bark Stair= +Crimson Bark Slab= +Double Crimson Bark Slab= Crimson Hyphae Wood= Crimson Stair= Crimson Slab= Double Crimson Slab= Crimson Nylium= -Crimson Checknode - only to check!= +Crimson Checknode - only to check!= \ No newline at end of file diff --git a/mods/ITEMS/mcl_mushroom/schematics/crimson_fungus_1.mts b/mods/ITEMS/mcl_mushroom/schematics/crimson_fungus_1.mts new file mode 100644 index 000000000..a61712fef Binary files /dev/null and b/mods/ITEMS/mcl_mushroom/schematics/crimson_fungus_1.mts differ diff --git a/mods/ITEMS/mcl_mushroom/schematics/crimson_fungus_2.mts b/mods/ITEMS/mcl_mushroom/schematics/crimson_fungus_2.mts new file mode 100644 index 000000000..b509fae50 Binary files /dev/null and b/mods/ITEMS/mcl_mushroom/schematics/crimson_fungus_2.mts differ diff --git a/mods/ITEMS/mcl_mushroom/schematics/crimson_fungus_3.mts b/mods/ITEMS/mcl_mushroom/schematics/crimson_fungus_3.mts new file mode 100644 index 000000000..84f8fa791 Binary files /dev/null and b/mods/ITEMS/mcl_mushroom/schematics/crimson_fungus_3.mts differ diff --git a/mods/ITEMS/mcl_mushroom/schematics/warped_fungus_1.mts b/mods/ITEMS/mcl_mushroom/schematics/warped_fungus_1.mts new file mode 100644 index 000000000..487e39f1a Binary files /dev/null and b/mods/ITEMS/mcl_mushroom/schematics/warped_fungus_1.mts differ diff --git a/mods/ITEMS/mcl_mushroom/schematics/warped_fungus_2.mts b/mods/ITEMS/mcl_mushroom/schematics/warped_fungus_2.mts new file mode 100644 index 000000000..564731158 Binary files /dev/null and b/mods/ITEMS/mcl_mushroom/schematics/warped_fungus_2.mts differ diff --git a/mods/ITEMS/mcl_mushroom/schematics/warped_fungus_3.mts b/mods/ITEMS/mcl_mushroom/schematics/warped_fungus_3.mts new file mode 100644 index 000000000..079631a20 Binary files /dev/null and b/mods/ITEMS/mcl_mushroom/schematics/warped_fungus_3.mts differ diff --git a/mods/ITEMS/mcl_mushroom/textures/stripped_crimson_stem_side.png b/mods/ITEMS/mcl_mushroom/textures/stripped_crimson_stem_side.png new file mode 100644 index 000000000..ad6a41a2e Binary files /dev/null and b/mods/ITEMS/mcl_mushroom/textures/stripped_crimson_stem_side.png differ diff --git a/mods/ITEMS/mcl_mushroom/textures/stripped_crimson_stem_top.png b/mods/ITEMS/mcl_mushroom/textures/stripped_crimson_stem_top.png new file mode 100644 index 000000000..21696b098 Binary files /dev/null and b/mods/ITEMS/mcl_mushroom/textures/stripped_crimson_stem_top.png differ diff --git a/mods/ITEMS/mcl_mushroom/textures/stripped_warped_stem_side.png b/mods/ITEMS/mcl_mushroom/textures/stripped_warped_stem_side.png new file mode 100644 index 000000000..db93c05cb Binary files /dev/null and b/mods/ITEMS/mcl_mushroom/textures/stripped_warped_stem_side.png differ diff --git a/mods/ITEMS/mcl_mushroom/textures/stripped_warped_stem_top.png b/mods/ITEMS/mcl_mushroom/textures/stripped_warped_stem_top.png new file mode 100644 index 000000000..4a8f14800 Binary files /dev/null and b/mods/ITEMS/mcl_mushroom/textures/stripped_warped_stem_top.png differ diff --git a/mods/ITEMS/mcl_nether/README.txt b/mods/ITEMS/mcl_nether/README.txt new file mode 100644 index 000000000..8deac79a9 --- /dev/null +++ b/mods/ITEMS/mcl_nether/README.txt @@ -0,0 +1,3 @@ +Mod mcl_nether : basic nether blocs, forked from Mineclone 2 + +Texture of mcl_nether_netheritebloc.png from PixelPerfection Legacy by XSSheep edited by Nova_Wostra (CC-BY-SA 4.0) \ No newline at end of file diff --git a/mods/ITEMS/mcl_nether/locale/mcl_nether.fr.tr b/mods/ITEMS/mcl_nether/locale/mcl_nether.fr.tr index ade56c167..864715eb7 100644 --- a/mods/ITEMS/mcl_nether/locale/mcl_nether.fr.tr +++ b/mods/ITEMS/mcl_nether/locale/mcl_nether.fr.tr @@ -37,4 +37,9 @@ Nether warts are plants home to the Nether. They can be planted on soul sand and Place this item on soul sand to plant it and watch it grow.=Placez cet article sur du sable d'âme pour le planter et regardez-le grandir. Burns your feet=Vous brûle les pieds Grows on soul sand=Pousse sur le sable de l'âme -Reduces walking speed=Réduit la vitesse de marche \ No newline at end of file +Reduces walking speed=Réduit la vitesse de marche +Netherite Scrap=Fragments de Netherite +Netherite Ingot=Lingot de Netherite +Ancient Debris=Débris antiques +Netherite Block=Bloc de Netherite +Netherite block is very hard and can be made of 9 netherite ingots.=Les blocs de netherite sont très durs et peuvent être fabriqués à partir de 9 lingots de netherite. \ No newline at end of file diff --git a/mods/ITEMS/mcl_nether/locale/template.txt b/mods/ITEMS/mcl_nether/locale/template.txt index 58aabd72d..283472f63 100644 --- a/mods/ITEMS/mcl_nether/locale/template.txt +++ b/mods/ITEMS/mcl_nether/locale/template.txt @@ -41,3 +41,5 @@ Reduces walking speed= Netherite Scrap= Netherite Ingot= Ancient Debris= +Netherite Block= +Netherite block is very hard and can be made of 9 netherite ingots.= \ No newline at end of file diff --git a/mods/ITEMS/mcl_nether/textures/mcl_nether_netheriteblock.png b/mods/ITEMS/mcl_nether/textures/mcl_nether_netheriteblock.png index 60957f017..5b08c3d03 100644 Binary files a/mods/ITEMS/mcl_nether/textures/mcl_nether_netheriteblock.png and b/mods/ITEMS/mcl_nether/textures/mcl_nether_netheriteblock.png differ diff --git a/mods/ITEMS/mcl_portals/portal_end.lua b/mods/ITEMS/mcl_portals/portal_end.lua index 9e1a67a75..3e4f5ba12 100644 --- a/mods/ITEMS/mcl_portals/portal_end.lua +++ b/mods/ITEMS/mcl_portals/portal_end.lua @@ -235,6 +235,7 @@ function mcl_portals.end_portal_teleport(pos, node) end mcl_portals.end_teleport(obj, objpos) + awards.unlock(obj:get_player_name(), "mcl:enterEndPortal") end end @@ -243,8 +244,9 @@ end minetest.register_abm({ label = "End portal teleportation", nodenames = {"mcl_portals:portal_end"}, - interval = 0.1, + interval = 1, chance = 1, + -- TODO: Move to playerinfo/playerplus/mob api action = mcl_portals.end_portal_teleport, }) diff --git a/mods/ITEMS/mcl_portals/portal_gateway.lua b/mods/ITEMS/mcl_portals/portal_gateway.lua index 505935105..4d79dce53 100644 --- a/mods/ITEMS/mcl_portals/portal_gateway.lua +++ b/mods/ITEMS/mcl_portals/portal_gateway.lua @@ -106,9 +106,10 @@ local function teleport(pos, obj) end minetest.register_abm({ + -- TODO: Move to playerinfo/playerplus/mob api label = "End gateway portal teleportation", nodenames = {"mcl_portals:portal_gateway"}, - interval = 0.1, + interval = 1, chance = 1, action = function(pos) if preparing[minetest.pos_to_string(pos)] then return end diff --git a/mods/ITEMS/mcl_portals/portal_nether.lua b/mods/ITEMS/mcl_portals/portal_nether.lua index 7390bbb2f..a8fdc51b2 100644 --- a/mods/ITEMS/mcl_portals/portal_nether.lua +++ b/mods/ITEMS/mcl_portals/portal_nether.lua @@ -729,8 +729,8 @@ mcl_structures.register_structure({name = "nether_portal", place_function = mcl_ minetest.register_abm({ label = "Nether portal teleportation and particles", nodenames = {PORTAL}, - interval = 0.8, - chance = 3, + interval = 1, + chance = 2, action = function(pos, node) -- Don't use call stack! local upper_node_name = get_node({x = pos.x, y = pos.y + 1, z = pos.z}).name @@ -811,6 +811,7 @@ minetest.register_abm({ }) end end + -- TODO: Move to playerinfo/playerplus/mob api for _, obj in pairs(minetest.get_objects_inside_radius(pos, 1)) do --maikerumine added for objects to travel local lua_entity = obj:get_luaentity() --maikerumine added for objects to travel if (obj:is_player() or lua_entity) and prevent_portal_chatter(obj) then diff --git a/mods/ITEMS/mcl_raw_ores/init.lua b/mods/ITEMS/mcl_raw_ores/init.lua index eca70004e..2fc65813b 100644 --- a/mods/ITEMS/mcl_raw_ores/init.lua +++ b/mods/ITEMS/mcl_raw_ores/init.lua @@ -10,7 +10,7 @@ local function register_raw_ore(description, n) _doc_items_longdesc = S("Raw "..ore..". Mine a"..n.." "..ore.." ore to get it."), inventory_image = texture..".png", stack_max = 64, - groups = { craftitem = 1 }, + groups = { craftitem = 1, blast_furnace_smeltable=1 }, }) minetest.register_node(raw_ingot.."_block", { description = S("Block of Raw "..description), diff --git a/mods/ITEMS/mcl_raw_ores/locale/mcl_raw_ores.fr.tr b/mods/ITEMS/mcl_raw_ores/locale/mcl_raw_ores.fr.tr new file mode 100644 index 000000000..bf9c08c4e --- /dev/null +++ b/mods/ITEMS/mcl_raw_ores/locale/mcl_raw_ores.fr.tr @@ -0,0 +1,9 @@ +# textdomain: mcl_raw_ores +Raw Iron=Fer Brut +Raw Gold=Or Brut +Raw Iron. Mine an Iron ore to get it.=Fer Brut. Miner du minerai de fer pour en obtenir. +Raw Gold. Mine a Gold ore to get it.=Or Brut. Miner du minerai d'or pour en obtenir. +Block of Raw Iron=Bloc de Fer Brut +Block of Raw Gold=Bloc d'Or Brut +A block of raw Iron is mostly a decorative block but also useful as a compact storage of raw Iron.=Un bloc de Fer brut est principalement un bloc décoratif mais aussi utile comme stockage compact de Fer brut. +A block of raw Gold is mostly a decorative block but also useful as a compact storage of raw Gold.=Un bloc d'Or brut est principalement un bloc décoratif mais aussi utile comme stockage compact d'Or brut. \ No newline at end of file diff --git a/mods/ITEMS/mcl_raw_ores/locale/template.txt b/mods/ITEMS/mcl_raw_ores/locale/template.txt index af375fef4..c9913e5c9 100644 --- a/mods/ITEMS/mcl_raw_ores/locale/template.txt +++ b/mods/ITEMS/mcl_raw_ores/locale/template.txt @@ -3,3 +3,7 @@ Raw Iron= Raw Gold= Raw Iron. Mine an Iron ore to get it.= Raw Gold. Mine a Gold ore to get it.= +Block of Raw Iron= +Block of Raw Gold= +A block of raw Iron is mostly a decorative block but also useful as a compact storage of raw Iron.= +A block of raw Gold is mostly a decorative block but also useful as a compact storage of raw Gold.= \ No newline at end of file diff --git a/mods/ITEMS/mcl_shields/init.lua b/mods/ITEMS/mcl_shields/init.lua index feff76cd8..24a26fd79 100644 --- a/mods/ITEMS/mcl_shields/init.lua +++ b/mods/ITEMS/mcl_shields/init.lua @@ -14,6 +14,7 @@ mcl_shields = { enchantments = {"mending", "unbreaking"}, players = {}, } +local players = mcl_shields.players local interact_priv = minetest.registered_privileges.interact interact_priv.give_to_singleplayer = false @@ -110,7 +111,7 @@ end function mcl_shields.is_blocking(obj) if not mcl_util or not mcl_util.is_player(obj) then return end - local blocking = mcl_shields.players[obj].blocking + local blocking = players[obj].blocking if blocking > 0 then local shieldstack = obj:get_wielded_item() if blocking == 1 then @@ -155,7 +156,7 @@ local function modify_shield(player, vpos, vrot, i) if i == 1 then arm = "Left" end - local player_data = mcl_shields.players[player] + local player_data = players[player] if not player_data then return end local shields = player_data.shields if not shields then return end @@ -178,7 +179,10 @@ local function set_shield(player, block, i) modify_shield(player, vector.new(3, -5, 0), vector.new(0, 0, 0), i) end end - local shield = mcl_shields.players[player].shields[i] + local player_data = players[player] + if not player_data then return end + local player_shields = player_data.shields + local shield = player_shields[i] if not shield then return end local luaentity = shield:get_luaentity() if not luaentity then return end @@ -219,12 +223,12 @@ end local function add_shield_entity(player, i) local shield = minetest.add_entity(player:get_pos(), "mcl_shields:shield_entity") shield:get_luaentity()._shield_number = i - mcl_shields.players[player].shields[i] = shield + players[player].shields[i] = shield set_shield(player, false, i) end local function remove_shield_entity(player, i) - local shields = mcl_shields.players[player].shields + local shields = players[player].shields if shields[i] then shields[i]:remove() shields[i] = nil @@ -232,7 +236,7 @@ local function remove_shield_entity(player, i) end local function handle_blocking(player) - local player_shield = mcl_shields.players[player] + local player_shield = players[player] local rmb = player:get_player_control().RMB if rmb then local shield_in_offhand = mcl_shields.wielding_shield(player, 1) @@ -274,7 +278,7 @@ local function handle_blocking(player) end local function update_shield_entity(player, blocking, i) - local shield = mcl_shields.players[player].shields[i] + local shield = players[player].shields[i] if mcl_shields.wielding_shield(player, i) then if not shield then add_shield_entity(player, i) @@ -378,7 +382,7 @@ end) minetest.register_on_leaveplayer(function(player) shield_hud[player] = nil - mcl_shields.players[player] = nil + players[player] = nil end) minetest.register_craft({ @@ -468,7 +472,7 @@ minetest.register_on_craft(function(itemstack, player, old_craft_grid, craft_inv end) minetest.register_on_joinplayer(function(player) - mcl_shields.players[player] = { + players[player] = { shields = {}, blocking = 0, } diff --git a/mods/ITEMS/mcl_smithing_table/README.md b/mods/ITEMS/mcl_smithing_table/README.md new file mode 100644 index 000000000..0fca6833d --- /dev/null +++ b/mods/ITEMS/mcl_smithing_table/README.md @@ -0,0 +1,14 @@ +# mcl_smithing_table + +By EliasFleckenstein03 and Code-Sploit + + +## License of source code + +See the game LEGAL.md + + +## License of textures + +Author: RandomLegoBrick +License: CC0 diff --git a/mods/ITEMS/mcl_smithing_table/init.lua b/mods/ITEMS/mcl_smithing_table/init.lua index 5e0610f44..1f2e2fbc6 100644 --- a/mods/ITEMS/mcl_smithing_table/init.lua +++ b/mods/ITEMS/mcl_smithing_table/init.lua @@ -125,6 +125,11 @@ minetest.register_node("mcl_smithing_table:table", { -- ToDo: make epic sound minetest.sound_play("mcl_smithing_table_upgrade", {pos = pos, max_hear_distance = 16}) end + if listname == "upgraded_item" then + if stack:get_name() == "mcl_farming:hoe_netherite" then + awards.unlock(player:get_player_name(), "mcl:seriousDedication") + end + end reset_upgraded_item(pos) end, @@ -133,6 +138,7 @@ minetest.register_node("mcl_smithing_table:table", { _mcl_hardness = 2.5 }) + minetest.register_craft({ output = "mcl_smithing_table:table", recipe = { diff --git a/mods/ITEMS/mcl_smithing_table/locale/mcl_smithing_table.fr.tr b/mods/ITEMS/mcl_smithing_table/locale/mcl_smithing_table.fr.tr new file mode 100644 index 000000000..7b51df899 --- /dev/null +++ b/mods/ITEMS/mcl_smithing_table/locale/mcl_smithing_table.fr.tr @@ -0,0 +1,4 @@ +# textdomain: mcl_smithing_table +Inventory=Inventaire +Upgrade Gear=Améliorer l'équipement +Smithing table=Table de Forgeron diff --git a/mods/ITEMS/mcl_smithing_table/textures/mcl_smithing_table_bottom.png b/mods/ITEMS/mcl_smithing_table/textures/mcl_smithing_table_bottom.png index e650781df..66a1a9a7a 100644 Binary files a/mods/ITEMS/mcl_smithing_table/textures/mcl_smithing_table_bottom.png and b/mods/ITEMS/mcl_smithing_table/textures/mcl_smithing_table_bottom.png differ diff --git a/mods/ITEMS/mcl_smithing_table/textures/mcl_smithing_table_front.png b/mods/ITEMS/mcl_smithing_table/textures/mcl_smithing_table_front.png index 81ed31c91..15c0a943f 100644 Binary files a/mods/ITEMS/mcl_smithing_table/textures/mcl_smithing_table_front.png and b/mods/ITEMS/mcl_smithing_table/textures/mcl_smithing_table_front.png differ diff --git a/mods/ITEMS/mcl_smithing_table/textures/mcl_smithing_table_side.png b/mods/ITEMS/mcl_smithing_table/textures/mcl_smithing_table_side.png index 8572b4c6e..37458771d 100644 Binary files a/mods/ITEMS/mcl_smithing_table/textures/mcl_smithing_table_side.png and b/mods/ITEMS/mcl_smithing_table/textures/mcl_smithing_table_side.png differ diff --git a/mods/ITEMS/mcl_smithing_table/textures/mcl_smithing_table_top.png b/mods/ITEMS/mcl_smithing_table/textures/mcl_smithing_table_top.png index 3384d2b25..2ec0468c7 100644 Binary files a/mods/ITEMS/mcl_smithing_table/textures/mcl_smithing_table_top.png and b/mods/ITEMS/mcl_smithing_table/textures/mcl_smithing_table_top.png differ diff --git a/mods/ITEMS/mcl_smoker/README.md b/mods/ITEMS/mcl_smoker/README.md new file mode 100644 index 000000000..ba7565f0e --- /dev/null +++ b/mods/ITEMS/mcl_smoker/README.md @@ -0,0 +1,13 @@ +Smoker for MineClone 5. +Heavily based on Minetest Game (default/furnace.lua) and the MineClone 5 Furnaces. + +License of source code +---------------------- +LGPLv2.1 +Based on code from Minetest Game. +Modified by Wuzzy. +MCl 2 Furances modified by PrairieWind. + +License of media +---------------- +See the main MineClone 5 README.md file. diff --git a/mods/ITEMS/mcl_furnaces/smoker.lua b/mods/ITEMS/mcl_smoker/init.lua similarity index 89% rename from mods/ITEMS/mcl_furnaces/smoker.lua rename to mods/ITEMS/mcl_smoker/init.lua index 8e3cdcd42..595e27eb6 100644 --- a/mods/ITEMS/mcl_furnaces/smoker.lua +++ b/mods/ITEMS/mcl_smoker/init.lua @@ -1,4 +1,3 @@ - local S = minetest.get_translator(minetest.get_current_modname()) local LIGHT_ACTIVE_FURNACE = 13 @@ -198,7 +197,7 @@ local function swap_node(pos, name) end node.name = name minetest.swap_node(pos, node) - if name == "mcl_furnaces:smoker_active" then + if name == "mcl_smoker:smoker_active" then spawn_flames(pos, node.param2) else mcl_particles.delete_node_particlespawners(pos) @@ -244,15 +243,7 @@ local function furnace_node_timer(pos, elapsed) -- Check if we have cookable content: cookable local aftercooked cooked, aftercooked = minetest.get_craft_result({method = "cooking", width = 1, items = srclist}) - cookable = false - cookableItems = {"mcl_fishing:fish_raw", "mcl_fishing:salmon_raw", "mcl_farming:potato_item", "mcl_mobitems:mutton", "mcl_mobitems:beef", "mcl_mobitems:chicken", "mcl_mobitems:porkchop", "mcl_mobitems:rabbit"} - --for _, item in ipairs(cookableItems) do - for _,item in ipairs(cookableItems) do - local stack = inv:get_stack("src",1) - if stack:get_name() == item then - cookable = true - end - end + cookable = minetest.get_item_group(inv:get_stack("src", 1):get_name(), "smoker_cookable") == 1 if cookable then -- Successful cooking requires space in dst slot and time if not inv:room_for_item("dst", cooked.item) then @@ -288,13 +279,13 @@ local function furnace_node_timer(pos, elapsed) elseif active then el = math.min(el, fuel_totaltime - fuel_time) -- The furnace is currently active and has enough fuel - fuel_time = fuel_time + el + fuel_time = (fuel_time + el)*2 end -- If there is a cookable item then check if it is ready yet if cookable and active then - -- in the src_time variable, the *1.5 is the multiplication that makes the smoker work faster than a normal furnace. I (PrairieWind) have it at 1.5 times faster, but it can be OP and 2 times faster, or 1.2 times faster. All are good numbers. - src_time = (src_time + el)*1.5 + -- in the src_time variable, the *2 is the multiplication that makes the smoker work faster than a normal furnace. + src_time = (src_time + el)*2 -- Place result in dst list if done if src_time >= cooked.time then inv:add_item("dst", cooked.item) @@ -334,11 +325,11 @@ local function furnace_node_timer(pos, elapsed) fuel_percent = math.floor(fuel_time / fuel_totaltime * 100) end formspec = active_formspec(fuel_percent, item_percent) - swap_node(pos, "mcl_furnaces:smoker_active") + swap_node(pos, "mcl_smoker:smoker_active") -- make sure timer restarts automatically result = true else - swap_node(pos, "mcl_furnaces:smoker") + swap_node(pos, "mcl_smoker:smoker") -- stop timer on the inactive furnace minetest.get_node_timer(pos):stop() end @@ -365,17 +356,17 @@ if minetest.get_modpath("screwdriver") then after_rotate_active = function(pos) local node = minetest.get_node(pos) mcl_particles.delete_node_particlespawners(pos) - if node.name == "mcl_furnaces:smoker" then + if node.name == "mcl_smoker:smoker" then return end spawn_flames(pos, node.param2) end end -minetest.register_node("mcl_furnaces:smoker", { +minetest.register_node("mcl_smoker:smoker", { description = S("Smoker"), - _tt_help = S("Uses fuel to smelt or cook items"), - _doc_items_longdesc = S("Smokers cook or smelt several items, using a furnace fuel, into something else, but faster than a normal furnace."), + _tt_help = S("Cooks food faster than furnace"), + _doc_items_longdesc = S("Smokers cook several items, mainly raw foods, into cooked foods, but twice as fast as a normal furnace."), _doc_items_usagehelp = S([[ Use the furnace to open the furnace menu. @@ -455,8 +446,8 @@ minetest.register_node("mcl_furnaces:smoker", { on_rotate = on_rotate, }) -minetest.register_node("mcl_furnaces:smoker_active", { - description = S("Burning Furnace"), +minetest.register_node("mcl_smoker:smoker_active", { + description = S("Burning Smoker"), _doc_items_create_entry = false, tiles = { "smoker_top.png", "smoker_top.png", @@ -467,7 +458,7 @@ minetest.register_node("mcl_furnaces:smoker_active", { paramtype2 = "facedir", paramtype = "light", light_source = LIGHT_ACTIVE_FURNACE, - drop = "mcl_furnaces:smoker", + drop = "mcl_smoker:smoker", groups = {pickaxey=1, container=4, deco_block=1, not_in_creative_inventory=1, material_stone=1}, is_ground_content = false, sounds = mcl_sounds.node_sound_stone_defaults(), @@ -510,7 +501,7 @@ minetest.register_node("mcl_furnaces:smoker_active", { }) minetest.register_craft({ - output = "mcl_furnaces:smoker", + output = "mcl_smoker:smoker", recipe = { { "", "group:tree", "" }, { "group:tree", "mcl_furnaces:furnace", "group:tree" }, @@ -518,30 +509,20 @@ minetest.register_craft({ } }) +minetest.register_alias("mcl_smoker:smoker", "mcl_furnaces:smoker") +minetest.register_alias("mcl_smoker:smoker_active", "mcl_furnaces:smoker_active") + -- Add entry alias for the Help if minetest.get_modpath("doc") then - doc.add_entry_alias("nodes", "mcl_furnaces:smoker", "nodes", "mcl_furnaces:smoker_active") + doc.add_entry_alias("nodes", "mcl_smoker:smoker", "nodes", "mcl_smoker:smoker_active") end minetest.register_lbm({ label = "Active furnace flame particles", - name = "mcl_furnaces:flames", - nodenames = {"mcl_furnaces:smoker_active"}, + name = "mcl_smoker:flames", + nodenames = {"mcl_smoker:smoker_active"}, run_at_every_load = true, action = function(pos, node) spawn_flames(pos, node.param2) end, }) - --- Legacy -minetest.register_lbm({ - label = "Update furnace formspecs (0.60.0)", - name = "mcl_furnaces:update_formspecs_0_60_0", - -- Only update inactive furnaces because active ones should update themselves - nodenames = { "mcl_furnaces:smoker" }, - run_at_every_load = false, - action = function(pos, node) - local meta = minetest.get_meta(pos) - meta:set_string("formspec", inactive_formspec) - end, -}) diff --git a/mods/ITEMS/mcl_smoker/locale/mcl_smoker.fr.tr b/mods/ITEMS/mcl_smoker/locale/mcl_smoker.fr.tr new file mode 100644 index 000000000..55f6a2ba8 --- /dev/null +++ b/mods/ITEMS/mcl_smoker/locale/mcl_smoker.fr.tr @@ -0,0 +1,8 @@ +# textdomain: mcl_smoker +Inventory=Inventaire +Smoker=Fumoir +Cooks food faster than furnace=Cuit la nourriture plus vite qu'un fourneau +Use the recipe book to see what you can smelt, what you can use as fuel and how long it will burn.=Utiliser le livre de recettes pour voir ce que vous pouvez fondre, ce que vous pouvez utiliser comme combustible et combien de temps ça va brûler. +Use the furnace to open the furnace menu.\nPlace a furnace fuel in the lower slot and the source material in the upper slot.\nThe furnace will slowly use its fuel to smelt the item.\nThe result will be placed into the output slot at the right side.=Utiliser le fourneau pour ouvrir le menu.\nPlacer le combustible dans la case en bas et le matériau source dans la case du haut.\nLe fourneau utilisera son combustible pour fondre lentement l'objet.\nLe résultat sera placé dans la case de sortie à droite. +Smokers cook several items, mainly raw foods, into cooked foods, but twice as fast as a normal furnace.=Les fumoirs cuisent plusieurs objets, surtout de la nourriture crue, en de la nourriture cuite. +Burning Smoker=Fumoir actif \ No newline at end of file diff --git a/mods/ITEMS/mcl_smoker/locale/template.txt b/mods/ITEMS/mcl_smoker/locale/template.txt new file mode 100644 index 000000000..dcf0be9b3 --- /dev/null +++ b/mods/ITEMS/mcl_smoker/locale/template.txt @@ -0,0 +1,8 @@ +# textdomain: mcl_smoker +Inventory= +Smoker= +Cooks food faster than furnace= +Use the recipe book to see what you can smelt, what you can use as fuel and how long it will burn.= +Use the furnace to open the furnace menu.\nPlace a furnace fuel in the lower slot and the source material in the upper slot.\nThe furnace will slowly use its fuel to smelt the item.\nThe result will be placed into the output slot at the right side.= +Smokers cook several items, mainly raw foods, into cooked foods, but twice as fast as a normal furnace.= +Burning Smoker= diff --git a/mods/ITEMS/mcl_smoker/mod.conf b/mods/ITEMS/mcl_smoker/mod.conf new file mode 100644 index 000000000..c6bda0fc1 --- /dev/null +++ b/mods/ITEMS/mcl_smoker/mod.conf @@ -0,0 +1,3 @@ +name = mcl_smoker +depends = mcl_init, mcl_formspec, mcl_core, mcl_furnaces, mcl_sounds, mcl_craftguide, mcl_achievements, mcl_particles +optional_depends = doc, screwdriver diff --git a/mods/ITEMS/mcl_furnaces/textures/smoker_bottom.png b/mods/ITEMS/mcl_smoker/textures/smoker_bottom.png similarity index 100% rename from mods/ITEMS/mcl_furnaces/textures/smoker_bottom.png rename to mods/ITEMS/mcl_smoker/textures/smoker_bottom.png diff --git a/mods/ITEMS/mcl_furnaces/textures/smoker_front.png b/mods/ITEMS/mcl_smoker/textures/smoker_front.png similarity index 100% rename from mods/ITEMS/mcl_furnaces/textures/smoker_front.png rename to mods/ITEMS/mcl_smoker/textures/smoker_front.png diff --git a/mods/ITEMS/mcl_furnaces/textures/smoker_front_on.png b/mods/ITEMS/mcl_smoker/textures/smoker_front_on.png similarity index 100% rename from mods/ITEMS/mcl_furnaces/textures/smoker_front_on.png rename to mods/ITEMS/mcl_smoker/textures/smoker_front_on.png diff --git a/mods/ITEMS/mcl_furnaces/textures/smoker_front_on_e.png b/mods/ITEMS/mcl_smoker/textures/smoker_front_on_e.png similarity index 100% rename from mods/ITEMS/mcl_furnaces/textures/smoker_front_on_e.png rename to mods/ITEMS/mcl_smoker/textures/smoker_front_on_e.png diff --git a/mods/ITEMS/mcl_furnaces/textures/smoker_front_on_e_s.png b/mods/ITEMS/mcl_smoker/textures/smoker_front_on_e_s.png similarity index 100% rename from mods/ITEMS/mcl_furnaces/textures/smoker_front_on_e_s.png rename to mods/ITEMS/mcl_smoker/textures/smoker_front_on_e_s.png diff --git a/mods/ITEMS/mcl_furnaces/textures/smoker_side.png b/mods/ITEMS/mcl_smoker/textures/smoker_side.png similarity index 100% rename from mods/ITEMS/mcl_furnaces/textures/smoker_side.png rename to mods/ITEMS/mcl_smoker/textures/smoker_side.png diff --git a/mods/ITEMS/mcl_furnaces/textures/smoker_top.png b/mods/ITEMS/mcl_smoker/textures/smoker_top.png similarity index 100% rename from mods/ITEMS/mcl_furnaces/textures/smoker_top.png rename to mods/ITEMS/mcl_smoker/textures/smoker_top.png diff --git a/mods/ITEMS/mcl_spyglass/locale/mcl_spyglass.fr.tr b/mods/ITEMS/mcl_spyglass/locale/mcl_spyglass.fr.tr new file mode 100644 index 000000000..5fb2f9bd9 --- /dev/null +++ b/mods/ITEMS/mcl_spyglass/locale/mcl_spyglass.fr.tr @@ -0,0 +1,3 @@ +# textdomain: mcl_spyglass +Spyglass=Longue-vue +A spyglass is an item that can be used for zooming in on specific locations.=Une longue-vue peut servir à agrandir l'image dans une direction spécifique. \ No newline at end of file diff --git a/mods/ITEMS/mcl_throwing/register.lua b/mods/ITEMS/mcl_throwing/register.lua index 605ee1386..e261840ef 100644 --- a/mods/ITEMS/mcl_throwing/register.lua +++ b/mods/ITEMS/mcl_throwing/register.lua @@ -142,14 +142,14 @@ local function egg_on_step(self, dtime) if not object then return end local ent = object:get_luaentity() object:set_properties({ - visual_size = { x = ent.base_size.x/2, y = ent.base_size.y/2 }, + visual_size = { x = ent.base_size.x*ent.baby_size, y = ent.base_size.y*ent.baby_size }, collisionbox = { - ent.base_colbox[1]/2, - ent.base_colbox[2]/2, - ent.base_colbox[3]/2, - ent.base_colbox[4]/2, - ent.base_colbox[5]/2, - ent.base_colbox[6]/2, + ent.base_colbox[1]*ent.baby_size, + ent.base_colbox[2]*ent.baby_size, + ent.base_colbox[3]*ent.baby_size, + ent.base_colbox[4]*ent.baby_size, + ent.base_colbox[5]*ent.baby_size, + ent.base_colbox[6]*ent.baby_size, } }) ent.child = true diff --git a/mods/ITEMS/mcl_tools/locale/mcl_tools.fr.tr b/mods/ITEMS/mcl_tools/locale/mcl_tools.fr.tr index a30f8c0a1..f01c6c4fe 100644 --- a/mods/ITEMS/mcl_tools/locale/mcl_tools.fr.tr +++ b/mods/ITEMS/mcl_tools/locale/mcl_tools.fr.tr @@ -14,19 +14,23 @@ Stone Pickaxe=Pioche en Pierre Iron Pickaxe=Pioche en Fer Golden Pickaxe=Pioche en Or Diamond Pickaxe=Pioche en Diamant +Netherite Pickaxe=Pioche en Netherite Wooden Shovel=Pelle en Bois Stone Shovel=Pelle en Pierre Iron Shovel=Pelle en Fer Golden Shovel=Pelle en Or Diamond Shovel=Pelle en Diamant +Netherite Shovel=Pelle en Netherite Wooden Axe=Hache en Bois Stone Axe=Hache en Pierre Iron Axe=Hache en Fer Golden Axe=Hache en Or Diamond Axe=Hache en Diamant +Netherite Axe=Hache en Netherite Wooden Sword=Épée en Bois Stone Sword=Épée en Pierre Iron Sword=Épée en Fer Golden Sword=Épée en Or Diamond Sword=Épée en Diamant +Netherite Sword=Épée en Netherite Shears=Cisailles diff --git a/mods/ITEMS/mcl_totems/init.lua b/mods/ITEMS/mcl_totems/init.lua index 7a45ea58f..5cf5f27a3 100644 --- a/mods/ITEMS/mcl_totems/init.lua +++ b/mods/ITEMS/mcl_totems/init.lua @@ -43,6 +43,7 @@ mcl_damage.register_modifier(function(obj, damage, reason) obj:set_wielded_item(wield) end end + awards.unlock(obj:get_player_name(), "mcl:postMortal") -- Effects minetest.sound_play({name = "mcl_totems_totem", gain = 1}, {pos=ppos, max_hear_distance = 16}, true) diff --git a/mods/ITEMS/mcl_tridents/init.lua b/mods/ITEMS/mcl_tridents/init.lua index b20616f16..8d2a68489 100644 --- a/mods/ITEMS/mcl_tridents/init.lua +++ b/mods/ITEMS/mcl_tridents/init.lua @@ -62,7 +62,6 @@ local spawn_trident = function(player) durability = durability * (unbreaking + 1) end wielditem:add_wear(65535/durability) - minetest.chat_send_all(wielditem:get_wear()) obj:set_velocity(vector.multiply(player:get_look_dir(), 20)) obj:set_acceleration({x=0, y=-GRAVITY, z=0}) obj:set_yaw(yaw) @@ -78,10 +77,10 @@ minetest.register_tool("mcl_tridents:trident", { stack_max = 1, groups = {weapon=1,weapon_ranged=1,trident=1,enchantability=1}, _mcl_uses = TRIDENT_DURABILITY, - on_place = function(itemstack, placer, pointed_thing) - spawn_trident(placer) - end, - on_secondary_use = function(itemstack, user, pointed_thing) - spawn_trident(user) - end + on_place = function(itemstack, placer, pointed_thing) + spawn_trident(placer) + end, + on_secondary_use = function(itemstack, user, pointed_thing) + spawn_trident(user) + end }) diff --git a/mods/ITEMS/mcl_tridents/locale/mcl_trident.fr.tr b/mods/ITEMS/mcl_tridents/locale/mcl_trident.fr.tr new file mode 100644 index 000000000..7bb33182e --- /dev/null +++ b/mods/ITEMS/mcl_tridents/locale/mcl_trident.fr.tr @@ -0,0 +1,3 @@ +# textdomain: mcl_tridents +Trident=Trident +Launches a trident when you rightclick and it is in your hand=Lance un trident lorsque vous cliquez droit et qu'il est dans votre main diff --git a/mods/ITEMS/mclx_fences/init.lua b/mods/ITEMS/mclx_fences/init.lua index 53aab68b2..a4fa0b169 100644 --- a/mods/ITEMS/mclx_fences/init.lua +++ b/mods/ITEMS/mclx_fences/init.lua @@ -30,7 +30,7 @@ mcl_fences.register_fence_and_fence_gate( "crimson_wood_fence", S("Crimson Hyphae Wood Fence"), S("Crimson Hyphae Wood Fence Gate"), "mcl_fences_fence_crimson.png", - {handy=1,axey=1, flammable=2,fence_wood=1, fire_encouragement=5, fire_flammability=20}, + {handy=1,axey=1, fence_wood=1}, minetest.registered_nodes["mcl_core:wood"]._mcl_hardness, minetest.registered_nodes["mcl_core:wood"]._mcl_blast_resistance, {"group:fence_wood"}, @@ -43,7 +43,7 @@ mcl_fences.register_fence_and_fence_gate( "warped_wood_fence", S("Warped Hyphae Wood Fence"), S("Warped Hyphae Wood Fence Gate"), "mcl_fences_fence_warped.png", - {handy=1,axey=1, flammable=2,fence_wood=1, fire_encouragement=5, fire_flammability=20}, + {handy=1,axey=1, fence_wood=1}, minetest.registered_nodes["mcl_core:wood"]._mcl_hardness, minetest.registered_nodes["mcl_core:wood"]._mcl_blast_resistance, {"group:fence_wood"}, diff --git a/mods/ITEMS/mclx_stairs/locale/mclx_stairs.fr.tr b/mods/ITEMS/mclx_stairs/locale/mclx_stairs.fr.tr index f8f86b1a1..23c672c5e 100644 --- a/mods/ITEMS/mclx_stairs/locale/mclx_stairs.fr.tr +++ b/mods/ITEMS/mclx_stairs/locale/mclx_stairs.fr.tr @@ -1,20 +1,20 @@ # textdomain: mclx_stairs -Oak Bark Stairs=Escalier en écorse de Chêne +Oak Bark Stairs=Escalier en écorce de Chêne Oak Bark Slab=Dalle d'écorce de Chêne Double Oak Bark Slab=Double Dalle d'écorce de Chêne Acacia Bark Stairs=Escalier en écorce d'Acacia Acacia Bark Slab=Dalle d'écorce d'Acacia Double Acacia Bark Slab=Double Dalle d'écorce d'Acacia -Spruce Bark Stairs=Escalier en écorse de Sapin +Spruce Bark Stairs=Escalier en écorce de Sapin Spruce Bark Slab=Dalle d'écorce de Sapin Double Spruce Bark Slab=Double Dalle d'écorce de Sapin -Birch Bark Stairs=Escalier en écorse de Bouleau +Birch Bark Stairs=Escalier en écorce de Bouleau Birch Bark Slab=Dalle d'écorce de Bouleau Double Birch Bark Slab=Double Dalle d'écorce de Bouleau -Jungle Bark Stairs=Escalier en écorse d'Acajou +Jungle Bark Stairs=Escalier en écorce d'Acajou Jungle Bark Slab=Dalle d'écorce d'Acajou Double Jungle Bark Slab=Double Dalle d'écorce d'Acajou -Dark Oak Bark Stairs=Escalier en écorse de Chêne Noir +Dark Oak Bark Stairs=Escalier en écorce de Chêne Noir Dark Oak Bark Slab=Dalle d'écorce de Chêne Noir Double Dark Oak Bark Slab=Double Dalle d'écorce de Chêne Noir Lapis Lazuli Slab=Dalle de Lapis Lazuli diff --git a/mods/ITEMS/screwdriver/locale/screwdriver.fr.tr b/mods/ITEMS/screwdriver/locale/screwdriver.fr.tr index ae014ea09..cce37b34a 100644 --- a/mods/ITEMS/screwdriver/locale/screwdriver.fr.tr +++ b/mods/ITEMS/screwdriver/locale/screwdriver.fr.tr @@ -1,2 +1,2 @@ -#textdomain: screwdriver +# textdomain: screwdriver Screwdriver=Tournevis diff --git a/mods/ITEMS/screwdriver/locale/screwdriver.pl.tr b/mods/ITEMS/screwdriver/locale/screwdriver.pl.tr index b9adac135..d4c0436ab 100644 --- a/mods/ITEMS/screwdriver/locale/screwdriver.pl.tr +++ b/mods/ITEMS/screwdriver/locale/screwdriver.pl.tr @@ -1,2 +1,2 @@ -#textdomain: screwdriver +# textdomain: screwdriver Screwdriver=Śrubokręt diff --git a/mods/ITEMS/screwdriver/locale/screwdriver.ru.tr b/mods/ITEMS/screwdriver/locale/screwdriver.ru.tr index fb6321684..6d7605ae5 100644 --- a/mods/ITEMS/screwdriver/locale/screwdriver.ru.tr +++ b/mods/ITEMS/screwdriver/locale/screwdriver.ru.tr @@ -1,2 +1,2 @@ -#textdomain: screwdriver +# textdomain: screwdriver Screwdriver=Отвёртка diff --git a/mods/ITEMS/screwdriver/locale/template.txt b/mods/ITEMS/screwdriver/locale/template.txt index b3871a116..41309d57e 100644 --- a/mods/ITEMS/screwdriver/locale/template.txt +++ b/mods/ITEMS/screwdriver/locale/template.txt @@ -1,2 +1,2 @@ -#textdomain: screwdriver +# textdomain: screwdriver Screwdriver= diff --git a/mods/MAPGEN/mcl_biomes/init.lua b/mods/MAPGEN/mcl_biomes/init.lua index 56a3cfe11..1e43d80fa 100644 --- a/mods/MAPGEN/mcl_biomes/init.lua +++ b/mods/MAPGEN/mcl_biomes/init.lua @@ -8,6 +8,8 @@ local generate_fallen_logs = minetest.settings:get_bool("mcl_generate_fallen_log local mod_mcl_structures = minetest.get_modpath("mcl_structures") local mod_mcl_core = minetest.get_modpath("mcl_core") local mod_mcl_mushrooms = minetest.get_modpath("mcl_mushrooms") +local mod_mcl_mushroom = minetest.get_modpath("mcl_mushroom") +local mod_mcl_blackstone = minetest.get_modpath("mcl_blackstone") -- Jungle bush schematic. In PC/Java Edition it's Jungle Wood + Oak Leaves local jungle_bush_schematic = mod_mcl_core.."/schematics/mcl_core_jungle_bush_oak_leaves.mts" @@ -22,6 +24,10 @@ local OCEAN_MIN = -15 local DEEP_OCEAN_MAX = OCEAN_MIN - 1 local DEEP_OCEAN_MIN = -31 +local minetest_get_perlin = minetest.get_perlin +local math_floor = math.floor +local math_abs = math.abs + --[[ Special biome field: _mcl_biome_type: Rough categorization of biomes: One of "snowy", "cold", "medium" and "hot" Based off ]] @@ -1478,6 +1484,12 @@ end -- Register biomes of non-Overworld biomes local function register_dimension_biomes() + --mcl2 schematic compat + minetest.register_alias("mcl_crimson:warped_wart_block", "mcl_mushroom:warped_wart_block") + minetest.register_alias("mcl_crimson:warped_hyphae", "mcl_mushroom:warped_hyphae") + minetest.register_alias("mcl_crimson:shroomlight", "mcl_mushroom:shroomlight") + minetest.register_alias("mcl_crimson:crimson_hyphae", "mcl_mushroom:crimson_hyphae") + --[[ REALMS ]] --[[ THE NETHER ]] @@ -1489,8 +1501,7 @@ local function register_dimension_biomes() node_river_water = "air", node_cave_liquid = "air", y_min = mcl_mapgen.nether.min, - -- FIXME: For some reason the Nether stops generating early if this constant is not added. - -- Figure out why. + y_max = mcl_mapgen.nether.max + 80, heat_point = 100, humidity_point = 0, @@ -1498,6 +1509,176 @@ local function register_dimension_biomes() _mcl_palette_index = 17, }) + minetest.register_decoration({ + deco_type = "simple", + place_on = {"mcl_nether:netherrack","mcl_nether:glowstone","mcl_blackstone:nether_gold","mcl_nether:quartz_ore","mcl_core:gravel","mcl_nether:soul_sand"}, + sidelen = 16, + fill_ratio = 10, + biomes = { "Nether" }, + y_min = -31000, + y_max = mcl_mapgen.nether.max, + decoration = "mcl_nether:netherrack", + flags = "all_floors", + param2 = 0, + }) + + minetest.register_biome({ + name = "SoulsandValley", + node_filler = "mcl_nether:netherrack", + node_stone = "mcl_nether:netherrack", + node_top = "mcl_blackstone:soul_soil", + node_water = "air", + node_river_water = "air", + node_cave_liquid = "air", + y_min = mcl_mapgen.nether.min, + + y_max = mcl_mapgen.nether.max + 80, + heat_point = 77, + humidity_point = 33, + _mcl_biome_type = "hot", + _mcl_palette_index = 17, + }) + minetest.register_decoration({ + deco_type = "simple", + place_on = {"mcl_nether:netherrack","mcl_nether:glowstone"}, + sidelen = 16, + fill_ratio = 10, + biomes = { "SoulsandValley" }, + y_min = -31000, + y_max = mcl_mapgen.nether.max, + decoration = "mcl_blackstone:soul_soil", + flags = "all_floors, all_ceilings", + param2 = 0, + }) + + minetest.register_ore({ + ore_type = "blob", + ore = "mcl_nether:soul_sand", + wherein = { "mcl_nether:netherrack", "mcl_blackstone:soul_soil" }, + clust_scarcity = 100, + clust_num_ores = 225, + clust_size = 15, + biomes = { "SoulsandValley" }, + y_min = mcl_mapgen.nether.min, + y_max = mcl_mapgen.nether.max + 80, + noise_params = { + offset = 0, + scale = 1, + spread = { x = 250, y = 250, z = 250 }, + seed = 12345, + octaves = 3, + persist = 0.6, + lacunarity = 2, + flags = "defaults", + } + }) + minetest.register_biome({ + name = "CrimsonForest", + node_filler = "mcl_nether:netherrack", + node_stone = "mcl_nether:netherrack", + node_top = "mcl_mushroom:crimson_nylium", + node_water = "air", + node_river_water = "air", + node_cave_liquid = "air", + y_min = mcl_mapgen.nether.min, + + y_max = mcl_mapgen.nether.max + 80, + heat_point = 60, + humidity_point = 47, + _mcl_biome_type = "hot", + _mcl_palette_index = 17, + }) + minetest.register_decoration({ + deco_type = "simple", + place_on = {"mcl_nether:netherrack","mcl_nether:glowstone","mcl_blackstone:nether_gold","mcl_nether:quartz_ore","mcl_core:gravel","mcl_nether:soul_sand"}, + sidelen = 16, + fill_ratio = 10, + biomes = { "CrimsonForest" }, + y_min = -31000, + y_max = mcl_mapgen.nether.max, + decoration = "mcl_mushroom:crimson_nylium", + flags = "all_floors", + param2 = 0, + }) + minetest.register_biome({ + name = "WarpedForest", + node_filler = "mcl_nether:netherrack", + node_stone = "mcl_nether:netherrack", + node_top = "mcl_mushroom:warped_nylium", + node_water = "air", + node_river_water = "air", + node_cave_liquid = "air", + y_min = mcl_mapgen.nether.min, + y_max = mcl_mapgen.nether.max + 80, + heat_point = 37, + humidity_point = 70, + _mcl_biome_type = "hot", + _mcl_palette_index = 17, + }) + minetest.register_decoration({ + deco_type = "simple", + place_on = {"mcl_nether:netherrack","mcl_nether:glowstone","mcl_blackstone:nether_gold","mcl_nether:quartz_ore","mcl_core:gravel","mcl_nether:soul_sand"}, + sidelen = 16, + fill_ratio = 10, + biomes = { "WarpedForest" }, + y_min = -31000, + y_max = mcl_mapgen.nether.max, + decoration = "mcl_mushroom:warped_nylium", + flags = "all_floors", + param2 = 0, + }) + minetest.register_biome({ + name = "BasaltDelta", + node_filler = "mcl_nether:netherrack", + node_stone = "mcl_nether:netherrack", + node_top = "mcl_blackstone:basalt", + node_water = "air", + node_river_water = "air", + node_cave_liquid = "air", + y_min = mcl_mapgen.nether.min, + y_max = mcl_mapgen.nether.max + 80, + heat_point = 27, + humidity_point = 80, + _mcl_biome_type = "hot", + _mcl_palette_index = 17, + }) + + minetest.register_ore({ + ore_type = "blob", + ore = "mcl_blackstone:blackstone", + wherein = {"mcl_nether:netherrack","mcl_nether:glowstone","mcl_core:gravel","mcl_nether:soul_sand"}, + clust_scarcity = 100, + clust_num_ores = 400, + clust_size = 20, + biomes = { "BasaltDelta" }, + y_min = mcl_mapgen.nether.min, + y_max = mcl_mapgen.nether.max + 80, + noise_params = { + offset = 0, + scale = 1, + spread = { x = 250, y = 250, z = 250 }, + seed = 12345, + octaves = 3, + persist = 0.6, + lacunarity = 2, + flags = "defaults", + } + }) + + minetest.register_decoration({ + deco_type = "simple", + place_on = {"mcl_nether:netherrack","mcl_nether:glowstone","mcl_blackstone:nether_gold","mcl_nether:quartz_ore","mcl_core:gravel","mcl_nether:soul_sand","mcl_blackstone:blackstone"}, + sidelen = 16, + fill_ratio = 10, + biomes = { "BasaltDelta" }, + y_min = -31000, + y_max = mcl_mapgen.nether.max, + decoration = "mcl_blackstone:basalt", + flags = "all_floors", + param2 = 0, + }) + + --[[ THE END ]] minetest.register_biome({ name = "End", @@ -3041,8 +3222,8 @@ local function register_decorations() octaves = 3, persist = 0.6 }, - y_min = 4, - y_max = mcl_mapgen.overworld.max, + spawn_by = "air", + num_spawn_by = 8, decoration = "mcl_core:cactus", biomes = {"Desert", "Mesa","Mesa_sandlevel", @@ -3922,9 +4103,343 @@ local function register_decorations() end -- Decorations in non-Overworld dimensions + +local chorus_noise_params = { + offset = -0.012, + scale = 0.024, + spread = {x = 100, y = 100, z = 100}, + seed = 257, + octaves = 3, + persistence = 0.6, +} + local function register_dimension_decorations() --[[ NETHER ]] - -- TODO: Nether + --NETHER WASTES (Nether) + minetest.register_decoration({ + deco_type = "simple", + place_on = {"mcl_nether:netherrack","mcl_nether:magma"}, + sidelen = 16, + fill_ratio = 0.04, + biomes = {"Nether"}, + y_min = mcl_mapgen.nether.lava_max + 1, + y_max = mcl_mapgen.nether.max - 1, + flags = "all_floors", + decoration = "mcl_fire:eternal_fire", + }) + minetest.register_decoration({ + deco_type = "simple", + place_on = {"mcl_nether:netherrack"}, + sidelen = 16, + fill_ratio = 0.013, + biomes = {"Nether"}, + y_min = mcl_mapgen.nether.lava_max + 1, + y_max = mcl_mapgen.nether.max - 1, + flags = "all_floors", + decoration = "mcl_mushrooms:mushroom_brown", + }) + minetest.register_decoration({ + deco_type = "simple", + place_on = {"mcl_nether:netherrack"}, + sidelen = 16, + fill_ratio = 0.012, + biomes = {"Nether"}, + y_min = mcl_mapgen.nether.lava_max + 1, + y_max = mcl_mapgen.nether.max - 1, + flags = "all_floors", + decoration = "mcl_mushrooms:mushroom_red", + }) + minetest.register_decoration({ + deco_type = "simple", + place_on = {"mcl_nether:soul_sand"}, + sidelen = 16, + fill_ratio = 0.0032, + biomes = {"Nether","SoulsandValley"}, + y_min = mcl_mapgen.nether.lava_max + 1, + y_max = mcl_mapgen.nether.max - 1, + flags = "all_floors", + decoration = "mcl_nether:nether_wart", + }) + + -- WARPED FOREST + minetest.register_decoration({ + deco_type = "simple", + place_on = {"mcl_mushroom:warped_nylium"}, + sidelen = 16, + fill_ratio = 0.02, + biomes = {"WarpedForest"}, + y_min = mcl_mapgen.nether.lava_max + 1, + y_max = mcl_mapgen.nether.max - 10, + flags = "all_floors", + decoration = "mcl_mushroom:warped_fungus", + }) + minetest.register_decoration({ + deco_type = "schematic", + name = "mcl_biomes:warped_tree1", + place_on = {"mcl_mushroom:warped_nylium"}, + sidelen = 16, + fill_ratio = 0.007, + biomes = {"WarpedForest"}, + y_min = mcl_mapgen.nether.lava_max + 1, + y_max = mcl_mapgen.nether.max - 15, + flags = "all_floors, place_center_x, place_center_z", + schematic = mod_mcl_mushroom.."/schematics/warped_fungus_1.mts", + size = {x = 5, y = 11, z = 5}, + rotation = "random", + }) + minetest.register_decoration({ + deco_type = "schematic", + name = "mcl_biomes:warped_tree2", + place_on = {"mcl_mushroom:warped_nylium"}, + sidelen = 16, + fill_ratio = 0.005, + biomes = {"WarpedForest"}, + y_min = mcl_mapgen.nether.lava_max + 1, + y_max = mcl_mapgen.nether.max - 10, + flags = "all_floors, place_center_x, place_center_z", + schematic = mod_mcl_mushroom.."/schematics/warped_fungus_2.mts", + size = {x = 5, y = 6, z = 5}, + rotation = "random", + }) + minetest.register_decoration({ + deco_type = "schematic", + name = "mcl_biomes:warped_tree3", + place_on = {"mcl_mushroom:warped_nylium"}, + sidelen = 16, + fill_ratio = 0.03, + biomes = {"WarpedForest"}, + y_min = mcl_mapgen.nether.lava_max + 1, + y_max = mcl_mapgen.nether.max - 14, + flags = "all_floors, place_center_x, place_center_z", + schematic = mod_mcl_mushroom.."/schematics/warped_fungus_3.mts", + size = {x = 5, y = 12, z = 5}, + rotation = "random", + }) + minetest.register_decoration({ + deco_type = "simple", + place_on = {"mcl_mushroom:warped_nylium","mcl_mushroom:twisting_vines"}, + sidelen = 16, + fill_ratio = 0.012, + biomes = {"WarpedForest"}, + y_min = mcl_mapgen.nether.lava_max + 1, + flags = "all_floors", + height = 2, + height_max = 8, + decoration = "mcl_mushroom:twisting_vines", + }) + minetest.register_decoration({ + deco_type = "simple", + place_on = {"mcl_mushroom:warped_nylium"}, + sidelen = 16, + fill_ratio = 0.0812, + biomes = {"WarpedForest"}, + y_min = mcl_mapgen.nether.lava_max + 1, + flags = "all_floors", + max_height = 5, + decoration = "mcl_mushroom:warped_roots", + }) + minetest.register_decoration({ + deco_type = "simple", + place_on = {"mcl_mushroom:crimson_nylium"}, + sidelen = 16, + fill_ratio = 0.052, + biomes = {"WarpedForest"}, + y_min = mcl_mapgen.nether.lava_max + 1, + flags = "all_floors", + decoration = "mcl_mushroom:nether_sprouts", + }) + -- CRIMSON FOREST + minetest.register_decoration({ + deco_type = "simple", + place_on = {"mcl_mushroom:crimson_nylium"}, + sidelen = 16, + fill_ratio = 0.02, + biomes = {"CrimsonForest"}, + y_min = mcl_mapgen.nether.lava_max + 1, + y_max = mcl_mapgen.nether.lava_max - 10, + flags = "all_floors", + decoration = "mcl_mushroom:crimson_fungus", + }) + minetest.register_decoration({ + deco_type = "schematic", + name = "mcl_biomes:crimson_tree", + place_on = {"mcl_mushroom:crimson_nylium"}, + sidelen = 16, + fill_ratio = 0.008, + biomes = {"CrimsonForest"}, + y_min = mcl_mapgen.nether.lava_max + 1, + y_max = mcl_mapgen.nether.max - 10, + flags = "all_floors, place_center_x, place_center_z", + schematic = mod_mcl_mushroom.."/schematics/crimson_fungus_1.mts", + size = {x = 5, y = 8, z = 5}, + rotation = "random", + }) + minetest.register_decoration({ + deco_type = "schematic", + name = "mcl_biomes:crimson_tree2", + place_on = {"mcl_mushroom:crimson_nylium"}, + sidelen = 16, + fill_ratio = 0.006, + biomes = {"CrimsonForest"}, + y_min = mcl_mapgen.nether.lava_max + 1, + y_max = mcl_mapgen.nether.max - 15, + flags = "all_floors, place_center_x, place_center_z", + schematic = mod_mcl_mushroom.."/schematics/crimson_fungus_2.mts", + size = {x = 5, y = 12, z = 5}, + rotation = "random", + }) + minetest.register_decoration({ + deco_type = "schematic", + name = "mcl_biomes:crimson_tree3", + place_on = {"mcl_mushroom:crimson_nylium"}, + sidelen = 16, + fill_ratio = 0.004, + biomes = {"CrimsonForest"}, + y_min = mcl_mapgen.nether.lava_max + 1, + y_max = mcl_mapgen.nether.max - 20, + flags = "all_floors, place_center_x, place_center_z", + schematic = mod_mcl_mushroom.."/schematics/crimson_fungus_3.mts", + size = {x = 7, y = 13, z = 7}, + rotation = "random", + }) + minetest.register_decoration({ + deco_type = "simple", + place_on = {"mcl_mushroom:crimson_nylium"}, + sidelen = 16, + fill_ratio = 0.082, + biomes = {"CrimsonForest"}, + y_min = mcl_mapgen.nether.lava_max + 1, + flags = "all_floors", + max_height = 5, + decoration = "mcl_mushroom:crimson_roots", + }) + + --SOULSAND VALLEY + minetest.register_decoration({ + deco_type = "simple", + place_on = {"mcl_blackstone:soul_soil","mcl_nether:soul_sand"}, + sidelen = 16, + fill_ratio = 0.062, + biomes = {"SoulsandValley"}, + y_min = mcl_mapgen.nether.lava_max + 1, + flags = "all_floors", + max_height = 5, + decoration = "mcl_blackstone:soul_fire", + }) + minetest.register_decoration({ + deco_type = "schematic", + place_on = {"mcl_blackstone:soul_soil","mcl_nether:soulsand"}, + sidelen = 16, + fill_ratio = 0.000212, + biomes = {"SoulsandValley"}, + y_min = mcl_mapgen.nether.lava_max + 1, + flags = "all_floors, place_center_x, place_center_z", + schematic = mod_mcl_blackstone.."/schematics/mcl_blackstone_nether_fossil_1.mts", + size = {x = 5, y = 8, z = 5}, + rotation = "random", + }) + minetest.register_decoration({ + deco_type = "schematic", + place_on = {"mcl_blackstone:soul_soil","mcl_nether:soulsand"}, + sidelen = 16, + fill_ratio = 0.0002233, + biomes = {"SoulsandValley"}, + y_min = mcl_mapgen.nether.lava_max + 1, + flags = "all_floors, place_center_x, place_center_z", + schematic = mod_mcl_blackstone.."/schematics/mcl_blackstone_nether_fossil_2.mts", + size = {x = 5, y = 8, z = 5}, + rotation = "random", + }) + minetest.register_decoration({ + deco_type = "schematic", + place_on = {"mcl_blackstone:soul_soil","mcl_nether:soulsand"}, + sidelen = 16, + fill_ratio = 0.000225, + biomes = {"SoulsandValley"}, + y_min = mcl_mapgen.nether.lava_max + 1, + flags = "all_floors, place_center_x, place_center_z", + schematic = mod_mcl_blackstone.."/schematics/mcl_blackstone_nether_fossil_3.mts", + size = {x = 5, y = 8, z = 5}, + rotation = "random", + }) + minetest.register_decoration({ + deco_type = "schematic", + place_on = {"mcl_blackstone:soul_soil","mcl_nether:soulsand"}, + sidelen = 16, + fill_ratio = 0.00022323, + biomes = {"SoulsandValley"}, + y_min = mcl_mapgen.nether.lava_max + 1, + flags = "all_floors, place_center_x, place_center_z", + schematic = mod_mcl_blackstone.."/schematics/mcl_blackstone_nether_fossil_4.mts", + size = {x = 5, y = 8, z = 5}, + rotation = "random", + }) + --BASALT DELTA + minetest.register_decoration({ + deco_type = "simple", + decoration = "mcl_blackstone:basalt", + place_on = {"mcl_blackstone:basalt","mcl_nether:netherrack","mcl_blackstone:blackstone"}, + sidelen = 80, + height_max = 55, + noise_params={ + offset = -0.0085, + scale = 0.002, + spread = {x = 25, y = 120, z = 25}, + seed = 2325, + octaves = 5, + persist = 2, + lacunarity = 3.5, + flags = "absvalue" + }, + biomes = {"BasaltDelta"}, + y_min = mcl_mapgen.nether.lava_max + 1, + flags = "all_floors, all ceilings", + }) + minetest.register_decoration({ + deco_type = "simple", + decoration = "mcl_blackstone:basalt", + place_on = {"mcl_blackstone:basalt","mcl_nether:netherrack","mcl_blackstone:blackstone"}, + sidelen = 80, + height_max = 15, + noise_params={ + offset = -0.0085, + scale = 0.004, + spread = {x = 25, y = 120, z = 25}, + seed = 235, + octaves = 5, + persist = 2.5, + lacunarity = 3.5, + flags = "absvalue" + }, + biomes = {"BasaltDelta"}, + y_min = mcl_mapgen.nether.lava_max + 1, + flags = "all_floors, all ceilings", + }) + minetest.register_decoration({ + deco_type = "simple", + decoration = "mcl_nether:magma", + place_on = {"mcl_blackstone:basalt","mcl_nether:netherrack","mcl_blackstone:blackstone"}, + sidelen = 80, + fill_ratio = 0.082323, + biomes = {"BasaltDelta"}, + place_offset_y = -1, + y_min = mcl_mapgen.nether.lava_max + 1, + flags = "all_floors, all ceilings", + }) + minetest.register_decoration({ + deco_type = "simple", + decoration = "mcl_nether:nether_lava_source", + place_on = {"mcl_blackstone:basalt","mcl_nether:netherrack","mcl_blackstone:blackstone"}, + spawn_by = {"mcl_blackstone:basalt","mcl_blackstone:blackstone"}, + num_spawn_by = 14, + sidelen = 80, + fill_ratio = 4, + biomes = {"BasaltDelta"}, + place_offset_y = -1, + y_min = mcl_mapgen.nether.lava_max + 1, + y_max = mcl_mapgen.nether.max - 5, + flags = "all_floors, force_placement", + }) --[[ THE END ]] @@ -3935,14 +4450,7 @@ local function register_dimension_decorations() place_on = {"mcl_end:end_stone", "air"}, flags = "all_floors", sidelen = 16, - noise_params = { - offset = -0.012, - scale = 0.024, - spread = {x = 100, y = 100, z = 100}, - seed = 257, - octaves = 3, - persist = 0.6 - }, + noise_params = chorus_noise_params, y_min = mcl_mapgen.end_.min, y_max = mcl_mapgen.end_.max, decoration = "mcl_end:chorus_flower", @@ -3962,6 +4470,8 @@ end -- Detect mapgen to select functions -- +local chorus_perlin_noise + if not mcl_mapgen.singlenode then if not superflat then if not mcl_mapgen.v6 then @@ -3994,8 +4504,10 @@ if not mcl_mapgen.singlenode then vm_context.gennotify = vm_context.gennotify or minetest.get_mapgen_object("gennotify") local gennotify = vm_context.gennotify for _, pos in pairs(gennotify["decoration#"..deco_id_chorus_plant] or {}) do + chorus_perlin_noise = chorus_perlin_noise or minetest_get_perlin(chorus_noise_params) local realpos = { x = pos.x, y = pos.y + 1, z = pos.z } - local pr = PseudoRandom(vm_context.blockseed) + local noise = chorus_perlin_noise:get_3d(realpos) + local pr = PseudoRandom(math_floor(math_abs(noise * 32767)) % 32768) minetest.after(1, mcl_end.grow_chorus_plant, realpos, false, pr) end return vm_context @@ -4003,4 +4515,3 @@ if not mcl_mapgen.singlenode then end end - diff --git a/mods/MAPGEN/mcl_mapgen_core/init.lua b/mods/MAPGEN/mcl_mapgen_core/init.lua index f8a5d1b53..abb75baeb 100644 --- a/mods/MAPGEN/mcl_mapgen_core/init.lua +++ b/mods/MAPGEN/mcl_mapgen_core/init.lua @@ -670,8 +670,8 @@ local function register_mgv6_decorations() octaves = 3, persist = 0.6 }, - y_min = 4, - y_max = mcl_mapgen.overworld.max, + spawn_by = "air", + num_spawn_by = 8, decoration = "mcl_core:cactus", height = 1, height_max = 3, diff --git a/mods/MAPGEN/mcl_structures/init.lua b/mods/MAPGEN/mcl_structures/init.lua index c99970813..13609be59 100644 --- a/mods/MAPGEN/mcl_structures/init.lua +++ b/mods/MAPGEN/mcl_structures/init.lua @@ -75,6 +75,7 @@ local function spawnstruct_function(name, param) local pos = player:get_pos() if not pos then return end + pos.y = math.floor(pos.y) + 1 local pr = PseudoRandom(math.floor(pos.x * 333 + pos.y * 19 - pos.z + 4)) pos = vector.round(pos) local dir = minetest.yaw_to_dir(player:get_look_horizontal()) diff --git a/mods/MAPGEN/mcl_structures/ruined_portal.lua b/mods/MAPGEN/mcl_structures/ruined_portal.lua index 40484f9c9..303955ee4 100644 --- a/mods/MAPGEN/mcl_structures/ruined_portal.lua +++ b/mods/MAPGEN/mcl_structures/ruined_portal.lua @@ -1,11 +1,8 @@ -local modname = minetest.get_current_modname() -local modpath = minetest.get_modpath(modname) - local chance_per_chunk = 400 local noise_multiplier = 2.5 local random_offset = 9159 local scanning_ratio = 0.001 -local struct_threshold = 396 +local struct_threshold = 393.91 local mcl_structures_get_perlin_noise_level = mcl_structures.get_perlin_noise_level local minetest_find_nodes_in_area = minetest.find_nodes_in_area @@ -13,6 +10,223 @@ local minetest_swap_node = minetest.swap_node local math_round = math.round local math_abs = math.abs +local function insert_times(how_many_times, what, where) + for i = 1, how_many_times do + where[#where + 1] = what + end +end + +local function create_probability_picker(table_of_how_many_times_what) + local picker = {} + for _, v in pairs(table_of_how_many_times_what) do + insert_times(v[1], v[2], picker) + end + return picker +end + +local STONE_DECOR = { + "mcl_core:stonebrickcarved", + "mcl_blackstone:blackstone_chiseled_polished", +} +local PANE_OR_CHAIN = { + "xpanes:bar", + "mcl_lanterns:chain", +} +local PANE_OR_CHAIN_FLAT = { + "xpanes:bar_flat", + "mcl_lanterns:chain", +} +local STAIR1 = { + "mcl_stairs:stair_stonebrickcracked", + + -- TODO: stair_blackstone_brick_polished_cracked: + "mcl_stairs:stair_deepslate_bricks", +} +local STAIR2 = { + "mcl_stairs:stair_stonebrickmossy", + "mcl_stairs:stair_blackstone_brick_polished", +} +local STAIR3 = { + "mcl_stairs:stair_stone_rough", + "mcl_stairs:stair_blackstone_chiseled_polished", +} +local STAIR4 = { + "mcl_stairs:stair_stonebrick", + "mcl_stairs:stair_blackstone_brick_polished", +} +local STAIR_OUTER1 = { + "mcl_stairs:stair_stonebrickcracked_outer", + + -- TODO: stair_blackstone_brick_polished_cracked_outer: + "mcl_stairs:stair_deepslate_bricks_outer", +} +local STAIR_OUTER2 = { + "mcl_stairs:stair_stonebrickmossy_outer", + "mcl_stairs:stair_blackstone_brick_polished_outer", +} +local STAIR_OUTER3 = { + "mcl_stairs:stair_stone_rough_outer", + "mcl_stairs:stair_blackstone_chiseled_polished_outer", +} +local STAIR_OUTER4 = { + "mcl_stairs:stair_stonebrick_outer", + "mcl_stairs:stair_blackstone_brick_polished_outer", +} +local TOP_DECOR1 = { + "mcl_core:goldblock", + "mcl_core:goldblock", +} +local TOP_DECOR2 = { + "mcl_core:stone_with_gold", + "mcl_core:stone_with_gold", +} +local STONE1 = { + "mcl_core:stonebrickcracked", + + -- TODO: polished_blackstone_brick_cracked: + "mcl_deepslate:deepslate_bricks_cracked", +} +local STONE2 = { + "mcl_core:stonebrickmossy", + "mcl_blackstone:blackstone_brick_polished", +} +local STONE3 = { + "mcl_nether:magma", + "mcl_core:packed_ice", +} +local STONE4 = { + "mcl_core:stonebrick", + "mcl_blackstone:blackstone_brick_polished", +} +local STONE5 = { + "mcl_core:stone", + "mcl_blackstone:blackstone", +} +local STONE6 = { + "mcl_core:cobble", + "mcl_blackstone:basalt_polished", +} +local STONE7 = { + "mcl_core:mossycobble", + "mcl_blackstone:blackstone_chiseled_polished", +} +local SLAB_TOP1 = { + "mcl_stairs:slab_stonebrickcracked_top", + + -- TODO: slab_polished_blackstone_brick_cracked_top: + "mcl_stairs:slab_goldblock_top", +} +local SLAB_TOP2 = { + "mcl_stairs:slab_stonebrickmossy_top", + "mcl_stairs:slab_blackstone_brick_polished_top", +} +local SLAB_TOP3 = { + "mcl_stairs:slab_stone_top", + "mcl_stairs:slab_blackstone_top", +} +local SLAB_TOP4 = { + "mcl_stairs:slab_stonebrick_top", + "mcl_stairs:slab_blackstone_brick_polished_top", +} +local SLAB1 = { + "mcl_stairs:slab_stone", + "mcl_stairs:slab_blackstone", +} +local SLAB2 = { + "mcl_stairs:slab_stonebrick", + "mcl_stairs:slab_blackstone_brick_polished", +} +local SLAB3 = { + "mcl_stairs:slab_stonebrickcracked", + + -- TODO: slab_polished_blackstone_brick_cracked: + "mcl_stairs:slab_goldblock", +} +local SLAB4 = { + "mcl_stairs:slab_stonebrickmossy", + "mcl_stairs:slab_blackstone_brick_polished", +} +local GARBAGE1 = { + "mcl_nether:netherrack", + "mcl_core:stone", +} +local LAVA_SOURCE = { + "mcl_nether:nether_lava_source", + "mcl_core:lava_source", +} +local GARBAGE3 = { + "mcl_nether:magma", + "mcl_nether:magma", +} + +local stair_set_for_frame = create_probability_picker({ + { 3, STAIR1,}, + { 1, STAIR2,}, + { 1, STAIR3,}, + {10, STAIR4,}, +}) +local stone_set_for_frame = create_probability_picker({ + { 3, STONE1,}, + { 1, STONE2,}, + { 1, STONE3,}, + {10, STONE4,}, +}) +local slab_set_for_frame = create_probability_picker({ + { 3, SLAB_TOP1,}, + { 1, SLAB_TOP2,}, + { 1, SLAB_TOP3,}, + {10, SLAB_TOP4,}, +}) +local stair_set_for_stairs = create_probability_picker({ + { 1, STAIR1,}, + { 2, STAIR2,}, + { 7, STAIR3,}, + { 3, STAIR4,}, +}) +local top_decoration_list = create_probability_picker({ + { 2, TOP_DECOR1,}, + { 1, TOP_DECOR2,}, +}) +local node_garbage = create_probability_picker({ + { 4, GARBAGE1,}, + { 1, LAVA_SOURCE,}, + { 1, GARBAGE3,}, +}) +local stair_replacement_list = { + "air", + "group:water", + "group:lava", + "group:buildable_to", + "group:deco_block", +} +local stair_outer_names = { + STAIR_OUTER1, + STAIR_OUTER2, + STAIR_OUTER3, + STAIR_OUTER4, +} +local stair_content = create_probability_picker({ + {1, LAVA_SOURCE,}, + {5, STONE5,}, + {1, STONE4,}, + {1, STONE3,}, + {2, GARBAGE1,}, +}) +local stair_content_bottom = create_probability_picker({ + {2, STONE3,}, + {4, GARBAGE1,}, +}) +local slabs = create_probability_picker({ + {5, SLAB1,}, + {2, SLAB2,}, + {1, SLAB3,}, + {1, SLAB4,}, +}) +local stones = create_probability_picker({ + {3, STONE5,}, + {1, STONE6,}, + {1, STONE7,}, +}) local rotation_to_orientation = { ["0"] = 1, @@ -28,39 +242,11 @@ local rotation_to_param2 = { ["270"] = 2, } -local node_top = { - "mcl_core:goldblock", - "mcl_core:stone_with_gold", - "mcl_core:goldblock", -} - -local node_garbage = { - "mcl_nether:netherrack", - "mcl_core:lava_source", - "mcl_nether:netherrack", - "mcl_nether:netherrack", - "mcl_nether:magma", - "mcl_nether:netherrack", -} - -local stone1 = {name = "mcl_core:stonebrickcracked"} -local stone2 = {name = "mcl_core:stonebrickmossy"} -local stone3 = {name = "mcl_nether:magma"} -local stone4 = {name = "mcl_core:stonebrick"} - -local slab1 = {name = "mcl_stairs:slab_stonebrickcracked_top"} -local slab2 = {name = "mcl_stairs:slab_stonebrickmossy_top"} -local slab3 = {name = "mcl_stairs:slab_stone_top"} -local slab4 = {name = "mcl_stairs:slab_stonebrick_top"} - -local stair1 = "mcl_stairs:stair_stonebrickcracked" -local stair2 = "mcl_stairs:stair_stonebrickmossy" -local stair3 = "mcl_stairs:stair_stone_rough" -local stair4 = "mcl_stairs:stair_stonebrick" -local function draw_frame(frame_pos, frame_width, frame_height, orientation, pr, is_chain, rotation) +local function draw_frame(frame_pos, frame_width, frame_height, orientation, pr, is_chain, rotation, is_blackstone) local param2 = rotation_to_param2[rotation] + local variant = is_blackstone and 2 or 1 local function set_ruined_node(pos, node) if pr:next(1, 5) == 4 then return end @@ -68,28 +254,20 @@ local function draw_frame(frame_pos, frame_width, frame_height, orientation, pr, end local function get_random_stone_material() - local rnd = pr:next(1, 15) - if rnd < 4 then return stone1 end - if rnd == 4 then return stone2 end - if rnd == 5 then return stone3 end - return stone4 + local rnd = pr:next(1, #stone_set_for_frame) + return {name = stone_set_for_frame[rnd][variant]} end local function get_random_slab() local rnd = pr:next(1, 15) - if rnd < 4 then return slab1 end - if rnd == 4 then return slab2 end - if rnd == 5 then return slab3 end - return slab4 + return {name = slab_set_for_frame[rnd][variant]} end local function get_random_stair(param2_offset) local param2 = (param2 + (param2_offset or 0)) % 4 - local rnd = pr:next(1, 15) - if rnd < 4 then return {name = stair1, param2 = param2} end - if rnd == 4 then return {name = stair2, param2 = param2} end - if rnd == 5 then return {name = stair3, param2 = param2} end - return {name = stair4, param2 = param2} + local rnd = pr:next(1, #stair_set_for_frame) + local stare_name = stair_set_for_frame[rnd][variant] + return {name = stare_name, param2 = param2} end local function set_frame_stone_material(pos) @@ -118,7 +296,6 @@ local function draw_frame(frame_pos, frame_width, frame_height, orientation, pr, local air_nodes = frame_nodes - obsidian_nodes local function set_frame_node(pos) - -- local node_choice = pr:next(1, air_nodes + obsidian_nodes) local node_choice = math_round(mcl_structures_get_perlin_noise_level(pos) * (air_nodes + obsidian_nodes)) if node_choice > obsidian_nodes and air_nodes > 0 then air_nodes = air_nodes - 1 @@ -141,7 +318,7 @@ local function draw_frame(frame_pos, frame_width, frame_height, orientation, pr, local is_top_hole = is_top and frame_width > 5 and ((pos2.x == x1 + slide_x * 2 and pos2.z == z1 + slide_z * 2) or (pos2.x == last_x - slide_x * 2 and pos2.z == last_z - slide_z * 2)) if is_top_hole then if pr:next(1, 7) > 1 then - minetest_swap_node(pos2, {name = "xpanes:bar_flat", param2 = orientation}) + minetest_swap_node(pos2, {name = PANE_OR_CHAIN_FLAT[variant], param2 = orientation}) end else set_frame_stone_material(pos2) @@ -152,18 +329,18 @@ local function draw_frame(frame_pos, frame_width, frame_height, orientation, pr, local pos = def.pos_outer1 local is_decor_here = not is_top and pos.y % 3 == 2 if is_decor_here then - minetest_swap_node(pos, {name = "mcl_core:stonebrickcarved"}) + minetest_swap_node(pos, {name = STONE_DECOR[variant]}) elseif is_chain then if not is_top and not is_obsidian then - minetest_swap_node(pos, {name = "xpanes:bar"}) + minetest_swap_node(pos, {name = PANE_OR_CHAIN[variant]}) else - minetest_swap_node(pos, {name = "xpanes:bar_flat", param2 = orientation}) + minetest_swap_node(pos, {name = PANE_OR_CHAIN_FLAT[variant], param2 = orientation}) end else if pr:next(1, 5) == 3 then - minetest_swap_node(pos, {name = "mcl_core:stonebrickcracked"}) + minetest_swap_node(pos, {name = STONE1[variant]}) else - minetest_swap_node(pos, {name = "mcl_core:stonebrick"}) + minetest_swap_node(pos, {name = STONE4[variant]}) end end end @@ -253,7 +430,7 @@ local function draw_frame(frame_pos, frame_width, frame_height, orientation, pr, }) end end - local node_top = {name = node_top[pr:next(1, #node_top)]} + local node_top = {name = top_decoration_list[pr:next(1, #top_decoration_list)][variant]} if is_chain then set_ruined_frame_stone_material({x = x1 + slide_x * 2, y = last_y + 3, z = z1 + slide_z * 2}) set_ruined_frame_stone_material({x = x1 + slide_x , y = last_y + 3, z = z1 + slide_z }) @@ -281,7 +458,9 @@ end local possible_rotations = {"0", "90", "180", "270"} -local function draw_trash(pos, width, height, lift, orientation, pr) +local function draw_trash(pos, width, height, lift, orientation, pr, is_blackstone) + local variant = is_blackstone and 2 or 1 + local pos = pos local slide_x = (1 - orientation) local slide_z = orientation local x1 = pos.x - lift - 1 @@ -297,7 +476,7 @@ local function draw_trash(pos, width, height, lift, orientation, pr) for x = x1 + pr:next(0, 2), x2 - pr:next(0, 2) do for z = z1 + pr:next(0, 2), z2 - pr:next(0, 2) do if inverted_opacity_0_5 == 0 or (x % inverted_opacity_0_5 ~= pr:next(0, 1) and z % inverted_opacity_0_5 ~= pr:next(0, 1)) then - minetest_swap_node({x = x, y = y, z = z}, {name = node_garbage[pr:next(1, #node_garbage)]}) + minetest_swap_node({x = x, y = y, z = z}, {name = node_garbage[pr:next(1, #node_garbage)][variant]}) end end end @@ -305,77 +484,6 @@ local function draw_trash(pos, width, height, lift, orientation, pr) end end -local stair_replacement_list = { - "air", - "group:water", - "group:lava", - "group:buildable_to", - "group:deco_block", -} - -local stair_names = { - "mcl_stairs:stair_stonebrickcracked", - "mcl_stairs:stair_stonebrickmossy", - "mcl_stairs:stair_stone_rough", - "mcl_stairs:stair_stone_rough", - "mcl_stairs:stair_stone_rough", - "mcl_stairs:stair_stone_rough", - "mcl_stairs:stair_stone_rough", - "mcl_stairs:stair_stone_rough", - "mcl_stairs:stair_stone_rough", - "mcl_stairs:stair_stonebrick", - "mcl_stairs:stair_stonebrick", - "mcl_stairs:stair_stonebrick", -} -local stair_outer_names = { - "mcl_stairs:stair_stonebrickcracked_outer", - "mcl_stairs:stair_stonebrickmossy_outer", - "mcl_stairs:stair_stone_rough_outer", - "mcl_stairs:stair_stonebrick_outer", -} - -local stair_content = { - {name = "mcl_core:lava_source"}, - {name = "mcl_core:stone"}, - {name = "mcl_core:stone"}, - {name = "mcl_core:stone"}, - {name = "mcl_core:stone"}, - {name = "mcl_core:stone"}, - {name = "mcl_core:stonebrick"}, - {name = "mcl_nether:magma"}, - {name = "mcl_nether:netherrack"}, - {name = "mcl_nether:netherrack"}, -} - -local stair_content_bottom = { - {name = "mcl_nether:magma"}, - {name = "mcl_nether:magma"}, - {name = "mcl_nether:netherrack"}, - {name = "mcl_nether:netherrack"}, - {name = "mcl_nether:netherrack"}, - {name = "mcl_nether:netherrack"}, -} - -local slabs = { - {name = "mcl_stairs:slab_stone"}, - {name = "mcl_stairs:slab_stone"}, - {name = "mcl_stairs:slab_stone"}, - {name = "mcl_stairs:slab_stone"}, - {name = "mcl_stairs:slab_stone"}, - {name = "mcl_stairs:slab_stonebrick"}, - {name = "mcl_stairs:slab_stonebrick"}, - {name = "mcl_stairs:slab_stonebrickcracked"}, - {name = "mcl_stairs:slab_stonebrickmossy"}, -} - -local stones = { - {name = "mcl_core:stone"}, - {name = "mcl_core:stone"}, - {name = "mcl_core:stone"}, - {name = "mcl_core:cobble"}, - {name = "mcl_core:mossycobble"}, -} - local stair_selector = { [-1] = { [-1] = { @@ -383,7 +491,7 @@ local stair_selector = { param2 = 1, }, [0] = { - names = stair_names, + names = stair_set_for_stairs, param2 = 1, }, [1] = { @@ -393,14 +501,14 @@ local stair_selector = { }, [0] = { [-1] = { - names = stair_names, + names = stair_set_for_stairs, param2 = 0, }, [0] = { names = stair_content, }, [1] = { - names = stair_names, + names = stair_set_for_stairs, param2 = 2, }, }, @@ -410,7 +518,7 @@ local stair_selector = { param2 = 0, }, [0] = { - names = stair_names, + names = stair_set_for_stairs, param2 = 3, }, [1] = { @@ -422,25 +530,14 @@ local stair_selector = { local stair_offset_from_bottom = 2 -local function draw_stairs(pos, width, height, lift, orientation, pr, is_chain, param2) - +local function draw_stairs(pos, width, height, lift, orientation, pr, is_chain, param2, is_blackstone) + local variant = is_blackstone and 2 or 1 local current_stair_content = stair_content local current_stones = stones - - local function set_ruined_node(pos, node) - if pr:next(1, 7) < 3 then return end - minetest_swap_node(pos, node) - return true - end - local param2 = param2 local mirror = param2 == 1 or param2 == 2 - if mirror then - param2 = (param2 + 2) % 4 - end - + if mirror then param2 = (param2 + 2) % 4 end local chain_offset = is_chain and 1 or 0 - local lift = lift + stair_offset_from_bottom local slide_x = (1 - orientation) local slide_z = orientation @@ -455,52 +552,63 @@ local function draw_stairs(pos, width, height, lift, orientation, pr, is_chain, local y = y2 local place_slabs = true local x_key, z_key - local need_to_place_chest = true local chest_pos - local bad_nodes_ratio = 0 - while (y >= y1) or (bad_nodes_ratio > 0.07) do - local good_nodes_counter = 0 - for x = x1, x2 do - x_key = (x == x1) and -1 or (x == x2) and 1 or 0 - for z = z1, z2 do - local pos = {x = x, y = y, z = z} - if #minetest_find_nodes_in_area(pos, pos, stair_replacement_list, false) > 0 then - z_key = (z == z1) and -1 or (z == z2) and 1 or 0 - local stair_coverage = (x_key ~= 0) or (z_key ~= 0) - if stair_coverage then - if stair_layer then - local stair = stair_selector[x_key][z_key] - local names = stair.names - set_ruined_node(pos, {name = names[pr:next(1, #names)], param2 = stair.param2}) - elseif place_slabs then - set_ruined_node(pos, slabs[pr:next(1, #slabs)]) - else - local placed = set_ruined_node(pos, current_stones[pr:next(1, #current_stones)]) - if need_to_place_chest and placed then - chest_pos = {x = pos.x, y = pos.y + 1, z = pos.z} - minetest_swap_node(chest_pos, {name = "mcl_chests:chest_small"}) - need_to_place_chest = false - end + local ruinity = height + lift + local y_layer_to_start_squeezing = y1 - 2 * lift + while (true) do + local x11 = math_round(x1) + local x22 = math_round(x2) + local z11 = math_round(z1) + local z22 = math_round(z2) + local good_nodes = minetest_find_nodes_in_area({x = x11, y = y, z = z11}, {x = x22, y = y, z = z22}, stair_replacement_list, false) + local good_nodes_ratio = #good_nodes / (x22 - x11 + 1) / (z22 - z11 + 1) + if y < y1 and good_nodes_ratio <= 0.07 then return chest_pos end + for _, pos in pairs(good_nodes) do + if pr:next(1, ruinity) > 1 then + local x, z = pos.x, pos.z + x_key = (x == x11) and -1 or (x == x22) and 1 or 0 + z_key = (z == z11) and -1 or (z == z22) and 1 or 0 + local should_be_a_stair_here = (x_key ~= 0) or (z_key ~= 0) + if should_be_a_stair_here then + if stair_layer then + local stair = stair_selector[x_key][z_key] + local names = stair.names + minetest_swap_node(pos, {name = names[pr:next(1, #names)][variant], param2 = stair.param2}) + elseif place_slabs then + minetest_swap_node(pos, {name = slabs[pr:next(1, #slabs)][variant]}) + else + minetest_swap_node(pos, {name = current_stones[pr:next(1, #current_stones)][variant]}) + if not chest_pos then + chest_pos = {x = pos.x, y = pos.y + 1, z = pos.z} + minetest_swap_node(chest_pos, {name = "mcl_chests:chest_small"}) end - elseif not stair_layer then - set_ruined_node(pos, current_stair_content[pr:next(1, #current_stair_content)]) end - else - good_nodes_counter = good_nodes_counter + 1 + elseif not stair_layer then + minetest_swap_node(pos, {name = current_stair_content[pr:next(1, #current_stair_content)][variant]}) end end end - bad_nodes_ratio = 1 - good_nodes_counter / ((x2 - x1 + 1) * (z2 - z1 + 1)) - if y >= y1 then + if y >= y1 - lift then x1 = x1 - 1 x2 = x2 + 1 z1 = z1 - 1 z2 = z2 + 1 + elseif y < y_layer_to_start_squeezing then + local noise = mcl_structures_get_perlin_noise_level(pos) + 0.5 + x1 = x1 + noise * pr:next(0,2) + x2 = x2 - noise * pr:next(0,2) + z1 = z1 + noise * pr:next(0,2) + z2 = z2 - noise * pr:next(0,2) + if x1 >= x2 then return chest_pos end + if z1 >= z2 then return chest_pos end + elseif y == y_layer_to_start_squeezing then + current_stones = stair_content_bottom + end + if y >= y1 then if (stair_layer or place_slabs) then y = y - 1 if y <= y1 then current_stair_content = stair_content_bottom - current_stones = stair_content_bottom end end place_slabs = not place_slabs @@ -508,19 +616,9 @@ local function draw_stairs(pos, width, height, lift, orientation, pr, is_chain, else place_slabs = false y = y - 1 - local dx1 = pr:next(0, 10) - if dx1 < 3 then x1 = x1 + dx1 end - local dx2 = pr:next(0, 10) - if dx2 < 3 then x2 = x2 - dx1 end - if x1 >= x2 then return chest_pos end - local dz1 = pr:next(0, 10) - if dz1 < 3 then z1 = z1 + dz1 end - local dz2 = pr:next(0, 10) - if dz2 < 3 then z2 = z2 - dz1 end - if z1 >= z2 then return chest_pos end end + if ruinity > 2 then ruinity = math.max(ruinity - pr:next(0,2), 2) end end - return chest_pos end local function enchant(stack, pr) @@ -533,19 +631,18 @@ local function enchant_armor(stack, pr) mcl_enchanting.enchant_randomly(stack, 30, false, false, false, pr) end -local function place(pos, rotation, pr) - local width = pr:next(2, 10) - local height = pr:next(((width < 3) and 3 or 2), 10) - local lift = pr:next(0, 4) - local rotation = rotation or possible_rotations[pr:next(1, #possible_rotations)] +local function common_place(pos, rotation, pr, width, height, lift, is_blackstone) + local pos = pos + local width = width + local height = height + local lift = lift + local rotation = rotation local orientation = rotation_to_orientation[rotation] - assert(orientation) local param2 = rotation_to_param2[rotation] - assert(param2) local is_chain = pr:next(1, 3) > 1 - draw_trash(pos, width, height, lift, orientation, pr) - local chest_pos = draw_stairs(pos, width, height, lift, orientation, pr, is_chain, param2) - draw_frame({x = pos.x, y = pos.y + lift, z = pos.z}, width + 2, height + 2, orientation, pr, is_chain, rotation) + draw_trash(pos, width, height, lift, orientation, pr, is_blackstone) + local chest_pos = draw_stairs(pos, width, height, lift, orientation, pr, is_chain, param2, is_blackstone) + draw_frame({x = pos.x, y = pos.y + lift, z = pos.z}, width + 2, height + 2, orientation, pr, is_chain, rotation, is_blackstone) if not chest_pos then return end local lootitems = mcl_loot.get_loot( @@ -575,7 +672,7 @@ local function place(pos, rotation, pr) {itemstring = "mcl_clock:clock", weight = 5}, {itemstring = "mesecons_pressureplates:pressure_plate_gold_off", weight = 5}, {itemstring = "mobs_mc:gold_horse_armor", weight = 5}, - {itemstring = "mcl_core:goldblock", weight = 1, amount_min = 1, amount_max = 2}, + {itemstring = TOP_DECOR1, weight = 1, amount_min = 1, amount_max = 2}, {itemstring = "mcl_bells:bell", weight = 1}, {itemstring = "mcl_core:apple_gold_enchanted", weight = 1}, } @@ -588,6 +685,24 @@ local function place(pos, rotation, pr) mcl_loot.fill_inventory(inv, "main", lootitems, pr) end +local function place(pos, rotation, pr) + local width = pr:next(2, 10) + local height = pr:next(((width < 3) and 3 or 2), math.floor((10 + width/2))) + local lift = pr:next(0, 2) + local rotation = rotation or possible_rotations[pr:next(1, #possible_rotations)] + common_place(pos, rotation, pr, width, height, lift, false) + minetest.log("action","Ruined portal generated at " .. minetest.pos_to_string(pos)) +end + +local function place_blackstone(pos, rotation, pr) + local width = pr:next(2, 5) + local height = pr:next(((width < 3) and 3 or 2), math.floor((5 + width/2))) + local lift = pr:next(0, 1) + local rotation = rotation or possible_rotations[pr:next(1, #possible_rotations)] + common_place(pos, rotation, pr, width, height, lift, true) + minetest.log("action","Ruined portal v2 generated at " .. minetest.pos_to_string(pos)) +end + local function get_place_rank(pos) local x, y, z = pos.x, pos.y, pos.z local p1 = {x = x , y = y, z = z } @@ -630,3 +745,35 @@ mcl_structures.register_structure({ end, place_function = place, }) + +mcl_structures.register_structure({ + name = "ruined_portal_black", + decoration = { + deco_type = "simple", + flags = "all_floors", + fill_ratio = scanning_ratio, + height = 1, + place_on = {"mcl_nether:netherrack", "mcl_nether:soul_sand", "mcl_nether:nether_lava_source", "mcl_core:lava_source"}, + }, + on_finished_chunk = function(minp, maxp, seed, vm_context, pos_list) + if minp.y > mcl_mapgen.nether.max then return end + local pr = PseudoRandom(seed + random_offset) + local random_number = pr:next(1, chance_per_chunk) + local noise = mcl_structures_get_perlin_noise_level(minp) * noise_multiplier + if (random_number + noise) < struct_threshold then return end + local pos = pos_list[1] + if #pos_list > 1 then + local count = get_place_rank(pos) + for i = 2, #pos_list do + local pos_i = pos_list[i] + local count_i = get_place_rank(pos_i) + if count_i > count then + count = count_i + pos = pos_i + end + end + end + place_blackstone(pos, nil, pr) + end, + place_function = place_blackstone, +}) diff --git a/mods/MAPGEN/mcl_villages/locale/mcl_villages.fr.tr b/mods/MAPGEN/mcl_villages/locale/mcl_villages.fr.tr new file mode 100644 index 000000000..86b7d1b33 --- /dev/null +++ b/mods/MAPGEN/mcl_villages/locale/mcl_villages.fr.tr @@ -0,0 +1,3 @@ +# textdomain: mcl_villages +Chiseled Stone Village Bricks=Pierre sculptée du village +Map chunk @1 to @2 is not suitable for placing villages.=La partie de la carte de @1 à @2 n'est pas propice au placement d'un village. diff --git a/mods/MISC/mcl_commands/locale/mcl_commands.fr.tr b/mods/MISC/mcl_commands/locale/mcl_commands.fr.tr index 1223c24ec..f9a1fa064 100644 --- a/mods/MISC/mcl_commands/locale/mcl_commands.fr.tr +++ b/mods/MISC/mcl_commands/locale/mcl_commands.fr.tr @@ -21,6 +21,10 @@ Ban list: @1=Liste d'interdiction: @1 Show who is logged on=Afficher qui est connecté Displays the world seed=Affiche la graine du monde Only peaceful mobs allowed!=Seuls les mobs pacifiques sont autorisés! -@1[]=@1[] +@1[]=@1[] Set game mode for player or yourself=Choisir le mode de jeu pour vous ou pour les joueurs Error: No game mode specified.=Erreur : mode de jeu non spécifié. + = +Play a sound. Arguments: : name of the sound. : Target.=Jouer un son. Arguments: : nom d'un son. : Cible. +Sound name is invalid!=Le nom du son est invalide ! +Target is invalid!!=La cible est invalide ! diff --git a/mods/MISC/mcl_commands/summon.lua b/mods/MISC/mcl_commands/summon.lua index 69da0a66c..2a2792f5f 100644 --- a/mods/MISC/mcl_commands/summon.lua +++ b/mods/MISC/mcl_commands/summon.lua @@ -3,13 +3,41 @@ local S = minetest.get_translator(minetest.get_current_modname()) local orig_func = minetest.registered_chatcommands["spawnentity"].func local cmd = table.copy(minetest.registered_chatcommands["spawnentity"]) cmd.func = function(name, param) - local ent = minetest.registered_entities[param] - if minetest.settings:get_bool("only_peaceful_mobs", false) and ent and ent._cmi_is_mob and ent.type == "monster" then - return false, S("Only peaceful mobs allowed!") - else - local bool, msg = orig_func(name, param) - return bool, msg + local params = param:split(" ") + if not params[1] or params[3] then + return false, S("Usage: /spawnentity [,,]") end + local entity_name = params[1] + local pos = params[2] + local entity_def = minetest.registered_entities[entity_name] + if not entity_def then + entity_name = "mobs_mc:" .. entity_name + entity_def = minetest.registered_entities[entity_name] + if not entity_def then + return false, S("Error: Unknown entity name") + end + end + if entity_def._cmi_is_mob then + if minetest.settings:get_bool("only_peaceful_mobs", false) and entity_def.type == "monster" then + return false, S("Only peaceful mobs allowed!") + end + mobs.spawn_mob( + entity_name, + pos + and minetest.string_to_pos(pos) + or vector.add( + minetest.get_player_by_name(name):get_pos(), + { + x = math.random()-0.5, + y = math.random(), + z = math.random()-0.5 + } + ) + ) + return true, S("Mob @1 spawned", entity_name) + end + local bool, msg = orig_func(name, param) + return bool, msg end minetest.unregister_chatcommand("spawnentity") minetest.register_chatcommand("summon", cmd) \ No newline at end of file diff --git a/mods/PLAYER/mcl_anticheat/init.lua b/mods/PLAYER/mcl_anticheat/init.lua index 2e3f427a6..cadad5c92 100644 --- a/mods/PLAYER/mcl_anticheat/init.lua +++ b/mods/PLAYER/mcl_anticheat/init.lua @@ -1,3 +1,6 @@ +local modpath = minetest.get_modpath(minetest.get_current_modname()) +dofile(modpath .. "/ratelimit.lua") + local enable_anticheat = true local kick_cheaters = false local kick_threshold = 10 diff --git a/mods/PLAYER/mcl_anticheat/ratelimit.lua b/mods/PLAYER/mcl_anticheat/ratelimit.lua new file mode 100644 index 000000000..4e4f5bd2d --- /dev/null +++ b/mods/PLAYER/mcl_anticheat/ratelimit.lua @@ -0,0 +1,21 @@ +-- by LoneWolfHT +-- https://github.com/minetest/minetest/issues/12220#issuecomment-1108789409 + +local ratelimit = {} +local after = minetest.after +local LIMIT = 2 + +local function remove_entry(ip) + ratelimit[ip] = nil +end + +minetest.register_on_mods_loaded(function() + table.insert(core.registered_on_prejoinplayers, 1, function(player, ip) + if ratelimit[ip] then + return "You are joining too fast, please try again" + else + ratelimit[ip] = true + after(LIMIT, remove_entry, ip) + end + end) +end) diff --git a/mods/PLAYER/mcl_antispam/init.lua b/mods/PLAYER/mcl_antispam/init.lua new file mode 100644 index 000000000..11431d5ba --- /dev/null +++ b/mods/PLAYER/mcl_antispam/init.lua @@ -0,0 +1,112 @@ +local ban_spammers = true +local kick_spammers = true +local revoke_shout_for_spammers = true +local limit_messages = 10 +local limit_message_length = 200 +local block_special_chars = true +local enable_antispam = ban_spammers or kick_spammers or revoke_shout_for_spammers + +local function update_settings() + ban_spammers = minetest.settings:get_bool("ban_spammers", true) + kick_spammers = minetest.settings:get_bool("kick_spammers", true) + revoke_shout_for_spammers = minetest.settings:get_bool("revoke_shout_for_spammers", true) + limit_messages = tonumber(minetest.settings:get("limit_messages") or 10) + limit_message_length = tonumber(minetest.settings:get("limit_message_length") or 200) + block_special_chars = minetest.settings:get_bool("block_special_chars", true) + enable_antispam = ban_spammers or kick_spammers or revoke_shout_for_spammers + minetest.after(7, update_settings) +end +update_settings() + +local last_messages = {} +local exceeders = {} +local special_users = {} + +local function ban(name) + if revoke_shout_for_spammers then + local privs = minetest.get_player_privs(name) + if privs then + privs.shout = nil + minetest.set_player_privs(name, privs) + end + end + if ban_spammers then + minetest.ban_player(name) + elseif kick_spammers then + minetest.kick_player(name) + end +end + +local last_char = string.char(127) + +local function on_chat_message(name, message) + if not enable_antispam then return end + local length = message:len() + if last_messages.job then + last_messages.job:cancel() + last_messages.job = nil + end + if last_messages.name and last_messages.name == name then + last_messages.count = last_messages.count + 1 + last_messages.summary_length = last_messages.summary_length + length + if last_messages.count >= limit_messages then + ban(name) + end + else + last_messages.name = name + last_messages.count = 1 + last_messages.summary_length = length + end + last_messages.job = minetest.after(30, function() + last_messages.name = nil + last_messages.job = nil + end) + if limit_message_length > 0 and message:len() > limit_message_length then + if exceeders[name] then + exceeders[name] = exceeders[name] + 1 + if exceeders[name] > limit_messages then + ban(name) + end + else + exceeders[name] = 1 + end + message = message:sub(1, limit_message_length) .. ">8 >8 >8" + minetest.chat_send_all("<" .. name .. "> " .. message) + return true + else + if exceeders[name] then + exceeders[name] = nil + end + end + if block_special_chars then + local sc = false + local msg = "" + for i = 1, #message do + local c = message:sub(i,i) + if c >= " " and c <= last_char then + msg = msg .. c + else + sc = true + end + end + if sc then + if special_users[name] then + special_users[name] = special_users[name] + 1 + if special_users[name] > limit_messages then + ban(name) + end + else + special_users[name] = 1 + end + message = msg + minetest.chat_send_all("<" .. name .. "> " .. message) + return true + else + if special_users[name] then + special_users[name] = nil + end + end + end +end + +minetest.register_on_chat_message(on_chat_message) diff --git a/mods/PLAYER/mcl_antispam/mod.conf b/mods/PLAYER/mcl_antispam/mod.conf new file mode 100644 index 000000000..ef259eab0 --- /dev/null +++ b/mods/PLAYER/mcl_antispam/mod.conf @@ -0,0 +1,2 @@ +name = mcl_antispam +author = kay27 diff --git a/mods/PLAYER/mcl_death_drop/init.lua b/mods/PLAYER/mcl_death_drop/init.lua index bfeee0c3e..5ea548ecc 100644 --- a/mods/PLAYER/mcl_death_drop/init.lua +++ b/mods/PLAYER/mcl_death_drop/init.lua @@ -1,56 +1,57 @@ -local random = math.random - -local ipairs = ipairs - -mcl_death_drop = {} - -mcl_death_drop.registered_dropped_lists = {} - -function mcl_death_drop.register_dropped_list(inv, listname, drop) - table.insert(mcl_death_drop.registered_dropped_lists, {inv = inv, listname = listname, drop = drop}) -end - -mcl_death_drop.register_dropped_list("PLAYER", "main", true) -mcl_death_drop.register_dropped_list("PLAYER", "craft", true) -mcl_death_drop.register_dropped_list("PLAYER", "armor", true) - -minetest.register_on_dieplayer(function(player) - local keep = minetest.settings:get_bool("mcl_keepInventory", false) - if keep == false then - -- Drop inventory, crafting grid and armor - local playerinv = player:get_inventory() - local pos = player:get_pos() - -- No item drop if in deep void - local _, void_deadly = mcl_worlds.is_in_void(pos) - - for l=1,#mcl_death_drop.registered_dropped_lists do - local inv = mcl_death_drop.registered_dropped_lists[l].inv - if inv == "PLAYER" then - inv = playerinv - elseif type(inv) == "function" then - inv = inv(player) - end - local listname = mcl_death_drop.registered_dropped_lists[l].listname - local drop = mcl_death_drop.registered_dropped_lists[l].drop - if inv then - for i, stack in ipairs(inv:get_list(listname)) do - local x = random(0, 9)/3 - local z = random(0, 9)/3 - pos.x = pos.x + x - pos.z = pos.z + z - if not void_deadly and drop and not mcl_enchanting.has_enchantment(stack, "curse_of_vanishing") then - local def = minetest.registered_items[stack:get_name()] - if def and def.on_drop then - stack = def.on_drop(stack, player, pos) - end - minetest.add_item(pos, stack) - end - pos.x = pos.x - x - pos.z = pos.z - z - end - inv:set_list(listname, {}) - end - end - mcl_armor.update(player) - end -end) +local random = math.random + +local ipairs = ipairs + +mcl_death_drop = {} + +mcl_death_drop.registered_dropped_lists = {} + +function mcl_death_drop.register_dropped_list(inv, listname, drop) + table.insert(mcl_death_drop.registered_dropped_lists, {inv = inv, listname = listname, drop = drop}) +end + +mcl_death_drop.register_dropped_list("PLAYER", "main", true) +mcl_death_drop.register_dropped_list("PLAYER", "craft", true) +mcl_death_drop.register_dropped_list("PLAYER", "armor", true) +mcl_death_drop.register_dropped_list("PLAYER", "offhand", true) + +minetest.register_on_dieplayer(function(player) + local keep = minetest.settings:get_bool("mcl_keepInventory", false) + if keep == false then + -- Drop inventory, crafting grid and armor + local playerinv = player:get_inventory() + local pos = player:get_pos() + -- No item drop if in deep void + local _, void_deadly = mcl_worlds.is_in_void(pos) + + for l=1,#mcl_death_drop.registered_dropped_lists do + local inv = mcl_death_drop.registered_dropped_lists[l].inv + if inv == "PLAYER" then + inv = playerinv + elseif type(inv) == "function" then + inv = inv(player) + end + local listname = mcl_death_drop.registered_dropped_lists[l].listname + local drop = mcl_death_drop.registered_dropped_lists[l].drop + if inv then + for i, stack in ipairs(inv:get_list(listname)) do + local x = random(0, 9)/3 + local z = random(0, 9)/3 + pos.x = pos.x + x + pos.z = pos.z + z + if not void_deadly and drop and not mcl_enchanting.has_enchantment(stack, "curse_of_vanishing") then + local def = minetest.registered_items[stack:get_name()] + if def and def.on_drop then + stack = def.on_drop(stack, player, pos) + end + minetest.add_item(pos, stack) + end + pos.x = pos.x - x + pos.z = pos.z - z + end + inv:set_list(listname, {}) + end + end + mcl_armor.update(player) + end +end) diff --git a/mods/PLAYER/mcl_meshhand/init.lua b/mods/PLAYER/mcl_meshhand/init.lua index 93f22c325..608c9b1c3 100644 --- a/mods/PLAYER/mcl_meshhand/init.lua +++ b/mods/PLAYER/mcl_meshhand/init.lua @@ -1,79 +1,56 @@ -local has_mcl_skins = minetest.get_modpath("mcl_skins") ~= nil - local def = minetest.registered_items[""] -local list --- mcl_skins is enabled -if has_mcl_skins == true then - list = mcl_skins.list -else - list = { "hand" } +local bases = mcl_skins.base +local base_colors = mcl_skins.base_color + +local function player_base_to_node_id(base, colorspec, sex) + return base:gsub("%.", "") .. minetest.colorspec_to_colorstring(colorspec):gsub("#", "") .. sex end ---generate a node for every skin -for _,texture in pairs(list) do - -- This is a fake node that should never be placed in the world - minetest.register_node("mcl_meshhand:"..texture, { - description = "", - tiles = {texture..".png"}, - use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "opaque" or false, - visual_scale = 1, - wield_scale = {x=1,y=1,z=1}, - paramtype = "light", - drawtype = "mesh", - mesh = "mcl_meshhand.b3d", - -- Prevent construction - node_placement_prediction = "", - on_construct = function(pos) - minetest.log("error", "[mcl_meshhand] Trying to construct mcl_meshhand:"..texture.." at "..minetest.pos_to_string(pos)) - minetest.remove_node(pos) - end, - drop = "", - on_drop = function() - return "" - end, - groups = { dig_immediate = 3, not_in_creative_inventory = 1 }, - range = def.range, - _mcl_hand_id = texture, - }) +-- This is a fake node that should never be placed in the world +local node_def = { + description = "", + use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "opaque" or false, + visual_scale = 1, + wield_scale = {x=1,y=1,z=1}, + paramtype = "light", + drawtype = "mesh", + node_placement_prediction = "", + on_construct = function(pos) + local name = get_node(pos).name + local message = "[mcl_meshhand] Trying to construct " .. name .. " at " .. minetest.pos_to_string(pos) + minetest.log("error", message) + minetest.remove_node(pos) + end, + drop = "", + on_drop = function() return "" end, + groups = { dig_immediate = 3, not_in_creative_inventory = 1 }, + range = def.range +} - minetest.register_node("mcl_meshhand:"..texture.. "_female", { - description = "", - tiles = {texture..".png"}, - use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "opaque" or false, - visual_scale = 1, - wield_scale = {x=1,y=1,z=1}, - paramtype = "light", - drawtype = "mesh", - mesh = "mcl_meshhand_female.b3d", - -- Prevent construction - node_placement_prediction = "", - on_construct = function(pos) - minetest.log("error", "[mcl_meshhand] Trying to construct mcl_meshhand:"..texture.." at "..minetest.pos_to_string(pos)) - minetest.remove_node(pos) - end, - drop = "", - on_drop = function() - return "" - end, - groups = { dig_immediate = 3, not_in_creative_inventory = 1 }, - range = def.range, - _mcl_hand_id = texture .. "_female", - }) +-- Generate a node for every skin +for _, base in pairs(bases) do + for _, base_color in pairs(base_colors) do + local node_id = player_base_to_node_id(base, base_color, "male") + local texture = mcl_skins.make_hand_texture(base, base_color) + local male = table.copy(node_def) + male._mcl_hand_id = node_id + male.mesh = "mcl_meshhand.b3d" + male.tiles = {texture} + minetest.register_node("mcl_meshhand:" .. node_id, male) + + node_id = player_base_to_node_id(base, base_color, "female") + local female = table.copy(node_def) + female._mcl_hand_id = node_id + female.mesh = "mcl_meshhand_female.b3d" + female.tiles = {texture} + minetest.register_node("mcl_meshhand:" .. node_id, female) + end end -if has_mcl_skins == true then - --change the player's hand to their skin - mcl_skins.register_on_set_skin(function(player, skin) - local meta = mcl_skins.meta[skin] - if meta.gender == "female" then - player:get_inventory():set_stack("hand", 1, "mcl_meshhand:"..skin.."_female") - else - player:get_inventory():set_stack("hand", 1, "mcl_meshhand:"..skin) - end - end) -else - minetest.register_on_joinplayer(function(player) - player:get_inventory():set_stack("hand", 1, "mcl_meshhand:hand") - end) -end +-- Change the player's hand to their skin +mcl_skins.register_on_set_skin(function(player) + local data = mcl_skins.players[player:get_player_name()] + local node_id = player_base_to_node_id(data.base, data.base_color, data.slim_arms and "female" or "male") + player:get_inventory():set_stack("hand", 1, "mcl_meshhand:" .. node_id) +end) diff --git a/mods/PLAYER/mcl_meshhand/mod.conf b/mods/PLAYER/mcl_meshhand/mod.conf index 6a988417f..b6ff804c2 100644 --- a/mods/PLAYER/mcl_meshhand/mod.conf +++ b/mods/PLAYER/mcl_meshhand/mod.conf @@ -1,6 +1,4 @@ name = mcl_meshhand author = jordan4ibanez description = Applies the player skin texture to the hand. -depends = mcl_tools -optional_depends = mcl_skins - +depends = mcl_tools, mcl_skins diff --git a/mods/PLAYER/mcl_player/init.lua b/mods/PLAYER/mcl_player/init.lua index 9d910a89a..a06913896 100644 --- a/mods/PLAYER/mcl_player/init.lua +++ b/mods/PLAYER/mcl_player/init.lua @@ -95,37 +95,18 @@ local function set_texture(player, index, texture) player:set_properties({textures = textures}) end -local function set_preview(player, field, preview) - player:get_meta():set_string("mcl_player:" .. field .. "_preview", preview) -end - -function mcl_player.player_set_skin(player, texture, preview) +function mcl_player.player_set_skin(player, texture) set_texture(player, 1, texture) - set_preview(player, "skin", preview) end -function mcl_player.player_set_armor(player, texture, preview) +function mcl_player.player_set_armor(player, texture) set_texture(player, 2, texture) - set_preview(player, "armor", preview) end function mcl_player.player_set_wielditem(player, texture) set_texture(player, 3, texture) end -function mcl_player.player_get_preview(player) - local preview = player:get_meta():get_string("mcl_player:skin_preview") - if preview == "" then - preview = "player.png" - end - local armor_preview = player:get_meta():set_string("mcl_player:armor_preview") - if armor_preview ~= "" then - preview = preview .. "^" .. armor_preview - end - return preview - -end - function mcl_player.get_player_formspec_model(player, x, y, w, h, fsname) if not mcl_util then return end if not mcl_util.is_player(player) then return end diff --git a/mods/PLAYER/mcl_playerplus/init.lua b/mods/PLAYER/mcl_playerplus/init.lua index 85755e0de..7d282d9ca 100644 --- a/mods/PLAYER/mcl_playerplus/init.lua +++ b/mods/PLAYER/mcl_playerplus/init.lua @@ -229,7 +229,6 @@ local function set_bone_position_conditional(player,b,p,r) --bone,position,rotat end player:set_bone_position(b,p,r) end - minetest.register_globalstep(function(dtime) time = time + dtime @@ -255,7 +254,7 @@ minetest.register_globalstep(function(dtime) local wielded_def = wielded:get_definition() local c_x, c_y = unpack(player_collision(player)) - + --[[ if player_velocity.x + player_velocity.y < .5 and c_x + c_y > 0 then local add_velocity = player.add_player_velocity or player.add_velocity @@ -278,11 +277,20 @@ minetest.register_globalstep(function(dtime) local fly_pos = player:get_pos() local fly_node = minetest.get_node({x = fly_pos.x, y = fly_pos.y - 0.5, z = fly_pos.z}).name local elytra = mcl_playerplus.elytra[name] - - elytra.active = player:get_inventory():get_stack("armor", 3):get_name() == "mcl_armor:elytra" - and not player:get_attach() - and (elytra.active or control.jump and player_velocity.y < -6) - and (fly_node == "air" or fly_node == "ignore") + elytra.inv = player:get_inventory():get_stack("armor", 3):get_name() == "mcl_armor:elytra" + elytra.enchanted = player:get_inventory():get_stack("armor", 3):get_name() == "mcl_armor:elytra_enchanted" + if not elytra.active then + elytra.active = player:get_inventory():get_stack("armor", 3):get_name() == "mcl_armor:elytra_enchanted" and not player:get_attach() and (elytra.active or control.jump and player_velocity.y < -6) and (fly_node == "air" or fly_node == "ignore") + if not elytra.active then + elytra.active = player:get_inventory():get_stack("armor", 3):get_name() == "mcl_armor:elytra" and not player:get_attach() and (elytra.active or control.jump and player_velocity.y < -6) and (fly_node == "air" or fly_node == "ignore") + end + end + if not (fly_node == "air" or fly_node == "ignore") then + elytra.active = false + end + if (not elytra.inv and not elytra.enchanted) then + elytra.active = false + end if elytra.active then mcl_player.player_set_animation(player, "fly") @@ -324,15 +332,17 @@ minetest.register_globalstep(function(dtime) end if wielded_def and wielded_def._mcl_toollike_wield then - set_bone_position_conditional(player,"Wield_Item", vector.new(0,3.9,1.3), vector.new(90,0,0)) + set_bone_position_conditional(player,"Wield_Item", vector.new(0,4.7,3.1), vector.new(-90,225,90)) elseif string.find(wielded:get_name(), "mcl_bows:bow") then - set_bone_position_conditional(player,"Wield_Item", vector.new(.5,4.5,-1.6), vector.new(90,0,20)) + set_bone_position_conditional(player,"Wield_Item", vector.new(1,4,0), vector.new(90,130,115)) elseif string.find(wielded:get_name(), "mcl_bows:crossbow_loaded") then - set_bone_position_conditional(player,"Wield_Item", vector.new(-1.5,5.7,1.8), vector.new(64,90,0)) + set_bone_position_conditional(player,"Wield_Item", vector.new(0,5.2,1.2), vector.new(0,180,73)) elseif string.find(wielded:get_name(), "mcl_bows:crossbow") then - set_bone_position_conditional(player,"Wield_Item", vector.new(-1.5,5.7,1.8), vector.new(90,90,0)) + set_bone_position_conditional(player,"Wield_Item", vector.new(0,5.2,1.2), vector.new(0,180,45)) + elseif wielded_def.inventory_image == "" then + set_bone_position_conditional(player,"Wield_Item", vector.new(0,6,2), vector.new(180,-45,0)) else - set_bone_position_conditional(player,"Wield_Item", vector.new(-1.5,4.9,1.8), vector.new(135,0,90)) + set_bone_position_conditional(player,"Wield_Item", vector.new(0,5.3,2), vector.new(90,0,0)) end -- controls right and left arms pitch when shooting a bow or blocking diff --git a/mods/PLAYER/mcl_skins/LICENSE.txt b/mods/PLAYER/mcl_skins/LICENSE.txt index fec6f6aa5..14ffbdee0 100644 --- a/mods/PLAYER/mcl_skins/LICENSE.txt +++ b/mods/PLAYER/mcl_skins/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 TenPlus1 +Copyright (c) 2022 MrRar Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/mods/PLAYER/mcl_skins/README.md b/mods/PLAYER/mcl_skins/README.md index bbe5309ab..8e0049b34 100644 --- a/mods/PLAYER/mcl_skins/README.md +++ b/mods/PLAYER/mcl_skins/README.md @@ -1,13 +1,77 @@ -= Skins for MineClone 2 = +# Skins for MineClone 5 -Simple mod to allow players to select a skin. -Use the chat command /setskin to change skin. +This mod allows advanced skin customization. +Use the /skin command to open the skin configuration screen. -Forked from Simple Skins by TenPlus1. -https://forum.minetest.net/viewtopic.php?id=9100 - -== License == +## License Code under MIT license -Origial authors: -- TenPlus1 -- Zeg9 +Author: MrRar + +See image_credits.txt for image licensing. + +## API + +### `mcl_skins.register_item(item)` +Register a skin item. `item` is a table with item properties listed below. + +### Item properties +`type` +Set the item type. Valid values are: "base", "footwear", "eye", "mouth", "bottom", "top", "hair", "headwear" + +`texture` +Set to the image file that will be used. If this property is omitted "blank.png" is used. +If texture is not 64x32 then the automatic preview will not display properly. + +`mask` +Set the color mask texture. Coloring is only applied to non transparent areas of the texture. +Coloring only works for "base", "bottom, "top", and "hair". +If texture is not 64x32 then the automatic preview will not display properly. + +`preview` +Set a custom preview texture. You can use texture modifiers. If preview contains the string `{color}` it will be replaced with the item's colorstring. + +`alex` +If set to true the item will be default for female character. + +`steve` +If set to true the item will be default for male character. + + +### `mcl_skins.show_formspec(player, active_tab, page_num)` +Show the skin configuration screen. +`player` is a player ObjectRef. +`active_tab` is the tab that will be displayed. This parameter is optional. +Can be one of: "arm", "base", "footwear", "eye", "mouth", "bottom", "top", "hair", "headwear" + +`page_num` The page number to display of there are multiple pages of items. +This parameter is optional. Must be a number. If it is not a valid page number the closest page number will be shown. + +### `mcl_skins.register_on_set_skin(func)` +Register a function to be called whenever a player skin changes. +The function will be given a player ObjectRef as a parameter. + +### `mcl_skins.make_hand_texture(base, colorspec)` +Generate a texture string from a base texture and color. +This function is used by mods that want to have a first person hand textured like the player skin. + +### `mcl_skins.save(player)` +Save player skin. `player` is a player ObjectRef. + +### `mcl_skins.update_player_skin(player)` +Update a player based on skin data in mcl_skins.players. +`player` is a player ObjectRef. + +### `mcl_skins.base_color` +A table of ColorSpec integers that the player can select to color the base item. +These colors are separate from `mcl_skins.color` because some mods register two nodes per base color so the amount of base colors needs to be limited. + +### `mcl_skins.color` +A table of ColorSpec integers that the player can select to color colorable skin items. + +### `mcl_skins.players` +A table mapped by player name containing tables holding the player's selected skin items and colors. +Only stores skin information for logged in users. + +### mcl_skins.compile_skin(skin) +`skin` is a table with skin item properties. +Returns an image string. diff --git a/mods/PLAYER/mcl_skins/image_credits.txt b/mods/PLAYER/mcl_skins/image_credits.txt new file mode 100644 index 000000000..eac723b8d --- /dev/null +++ b/mods/PLAYER/mcl_skins/image_credits.txt @@ -0,0 +1,106 @@ +mcl_skins_base_1.png +mcl_skins_button.png +mcl_skins_footwear_3.png +mcl_skins_headgear_1.png +mcl_skins_headgear_3.png +mcl_skins_headgear_4.png +mcl_skins_headgear_5.png +mcl_skins_mouth_2.png +mcl_skins_mouth_3.png +mcl_skins_mouth_4.png +mcl_skins_mouth_5.png +mcl_skins_select_overlay.png +mcl_skins_slim_arms.png +mcl_skins_thick_arms.png +mcl_skins_top_2.png +mcl_skins_top_5.png +mcl_skins_eye_5.png +mcl_skins_hair_8.png +mcl_skins_top_6.png +mcl_skins_bottom_3.png +mcl_skins_eye_7.png +mcl_skins_mouth_7.png +Original work by MrRar +License: CC BY-SA 4.0 + +mcl_skins_top_1.png +mcl_skins_mouth_1.png +mcl_skins_hair_1.png +mcl_skins_hair_2.png +mcl_skins_eye_1.png +mcl_skins_eye_2.png +mcl_skins_footwear_1.png +mcl_skins_headgear_2.png +mcl_skins_mouth_1.png +mcl_skins_top_1.png +mcl_skins_mouth_2.png +Name: Pixel Perfection resource pack for Minecraft 1.11 +Author: XSSheep. Adapted for mcl_skins by MrRar. +License: CC BY-SA 4.0 +Source: https://www.planetminecraft.com/texture_pack/131pixel-perfection/ + +mcl_skins_hair_3.png +mcl_skins_eye_3.png +mcl_skins_footwear_2.png +Name: the 10the doctor +Author: lovehart. Adapted for mcl_skins by MrRar. +License: CC BY-SA 3.0 +Source: http://minetest.fensta.bplaced.net/#!page:1,filtertype:Id,filter:367 + +mcl_skins_hair_4.png +Blonde Girl +Author: Rin. Adapted for mcl_skins by MrRar. +License: CC BY-SA 3.0 +Source: http://minetest.fensta.bplaced.net/#id=918 + +mcl_skins_hair_5.png +Name: hobbit from lottmob +Author: lovehart. Adapted for mcl_skins by MrRar. +License: CC BY-SA 3.0 +Source: http://minetest.fensta.bplaced.net/#id=336 + +mcl_skins_top_4.png +Name: Oliver_MV +Author: hansuke123. Adapted for mcl_skins by MrRar. +License: CC BY-SA 3.0 +Source: http://minetest.fensta.bplaced.net/#!page:1,filtertype:Id,filter:291 + +mcl_skins_hair_6.png +mcl_skins_eye_6.png +Name: Mumbo Jumbo +Author: ZestyZachary +License: CC 0 (1.0) +Source: http://minetest.fensta.bplaced.net/#!page:1,filtertype:Id,filter:2100 + +mcl_skins_eye_4.png +Name: lisa +Author: hansuke123 +License: CC BY-SA 3.0 +Source: http://minetest.fensta.bplaced.net/#!page:1,filtertype:Id,filter:88 + +mcl_skins_headwear_7.png +Name: Ryu +Author: Ginsu23. Adapted for mcl_skins by MrRar. +License: CC BY-SA 3.0 +Source: http://minetest.fensta.bplaced.net/#id=464 + +mcl_skins_top_8.png +Name: Hoodie Enderman +Author: Kpenguin. Adapted for mcl_skins by MrRar. +License: CC BY-SA 3.0 +Source: http://minetest.fensta.bplaced.net/#id=962 + +mcl_skins_hair_9.png +Name: Trader 1 +Author: TenPlus1. Adapted for mcl_skins by MrRar. +License: CC BY-SA 3.0 +Source: http://minetest.fensta.bplaced.net/#id=1258 + +mcl_skins_bottom_4.png +mcl_skins_top_9.png +mcl_skins_top_10.png +mcl_skins_hair_10.png +mcl_skins_hair_11.png +Name: Pixel Perfection Legacy 1.19 +Author: Nova_Wostra. Adapted for mcl_skins by MrRar. +Source: https://www.planetminecraft.com/texture-pack/pixel-perfection-chorus-edit/ \ No newline at end of file diff --git a/mods/PLAYER/mcl_skins/init.lua b/mods/PLAYER/mcl_skins/init.lua index 6d5461a98..92b0cde82 100644 --- a/mods/PLAYER/mcl_skins/init.lua +++ b/mods/PLAYER/mcl_skins/init.lua @@ -1,157 +1,165 @@ --- Skins for MineClone 2 +-- Skins for MineClone 5 -local modname = minetest.get_current_modname() +local S = minetest.get_translator("mcl_skins") +local color_to_string = minetest.colorspec_to_colorstring mcl_skins = { - skins = {}, list = {}, previews = {}, meta = {}, has_preview = {}, - modpath = minetest.get_modpath(modname), - skin_count = 0, -- counter of _custom_ skins (all skins except character.png) + tab_names = {"base", "footwear", "eye", "mouth", "bottom", "top", "hair", "headwear"}, -- Rendering order + tab_names_display_order = {"template", "base", "headwear", "hair", "eye", "mouth", "top", "arm", "bottom", "footwear"}, + tab_descriptions = { + template = S("Templates"), + arm = S("Arm size"), + base = S("Bases"), + footwear = S("Footwears"), + eye = S("Eyes"), + mouth = S("Mouths"), + bottom = S("Bottoms"), + top = S("Tops"), + hair = S("Hairs"), + headwear = S("Headwears") + }, + steve = {}, -- Stores skin values for Steve skin + alex = {}, -- Stores skin values for Alex skin + base = {}, -- List of base textures + + -- Base color is separate to keep the number of junk nodes registered in check + base_color = {0xffeeb592, 0xffb47a57, 0xff8d471d}, + color = { + 0xff613915, -- 1 Dark brown Steve hair, Alex bottom + 0xff97491b, -- 2 Medium brown + 0xffb17050, -- 3 Light brown + 0xffe2bc7b, -- 4 Beige + 0xff706662, -- 5 Gray + 0xff151515, -- 6 Black + 0xffc21c1c, -- 7 Red + 0xff178c32, -- 8 Green Alex top + 0xffae2ad3, -- 9 Plum + 0xffebe8e4, -- 10 White + 0xffe3dd26, -- 11 Yellow + 0xff449acc, -- 12 Light blue Steve top + 0xff124d87, -- 13 Dark blue Steve bottom + 0xfffc0eb3, -- 14 Pink + 0xffd0672a, -- 15 Orange Alex hair + }, + footwear = {}, + mouth = {}, + eye = {}, + bottom = {}, + top = {}, + hair = {}, + headwear = {}, + masks = {}, + previews = {}, + players = {} } -local S = minetest.get_translator(modname) -local has_mcl_inventory = minetest.get_modpath("mcl_inventory") - --- load skin list and metadata -local id, f, data, skin = 0 - -while true do - - if id == 0 then - skin = "character" - mcl_skins.has_preview[id] = true - else - skin = "mcl_skins_character_" .. id - local preview = "mcl_skins_player_" .. id - - -- Does skin file exist? - f = io.open(mcl_skins.modpath .. "/textures/" .. skin .. ".png") - - -- escape loop if not found - if not f then - break - end - f:close() - - -- Does skin preview file exist? - local file_preview = io.open(mcl_skins.modpath .. "/textures/" .. preview .. ".png") - if file_preview == nil then - minetest.log("warning", "[mcl_skins] Player skin #"..id.." does not have preview image (player_"..id..".png)") - mcl_skins.has_preview[id] = false - else - mcl_skins.has_preview[id] = true - file_preview:close() - end +function mcl_skins.register_item(item) + assert(mcl_skins[item.type], "Skin item type " .. item.type .. " does not exist.") + local texture = item.texture or "blank.png" + if item.steve then + mcl_skins.steve[item.type] = texture end - - mcl_skins.list[id] = skin - - -- does metadata exist for that skin file ? - if id == 0 then - metafile = "mcl_skins_character.txt" - else - metafile = "mcl_skins_character_"..id..".txt" + + if item.alex then + mcl_skins.alex[item.type] = texture end - f = io.open(mcl_skins.modpath .. "/meta/" .. metafile) - - data = nil - if f then - data = minetest.deserialize("return {" .. f:read("*all") .. "}") - f:close() - end - - -- add metadata to list - mcl_skins.meta[skin] = { - name = data and data.name or "", - author = data and data.author or "", - gender = data and data.gender or "", - } - - if id > 0 then - mcl_skins.skin_count = mcl_skins.skin_count + 1 - end - id = id + 1 + + table.insert(mcl_skins[item.type], texture) + mcl_skins.masks[texture] = item.mask + if item.preview then mcl_skins.previews[texture] = item.preview end end -function mcl_skins.cycle_skin(player) - local skin_id = tonumber(player:get_meta():get_string("mcl_skins:skin_id")) - if not skin_id then - skin_id = 0 - end - skin_id = skin_id + 1 - if skin_id > mcl_skins.skin_count then - skin_id = 0 - end - mcl_skins.set_player_skin(player, skin_id) +function mcl_skins.save(player) + if not player or not player:is_player() then return end + local name = player:get_player_name() + local skin = mcl_skins.players[name] + if not skin then return end + player:get_meta():set_string("mcl_skins:skin", minetest.serialize(skin)) end -function mcl_skins.set_player_skin(player, skin_id) - if not player then - return false +minetest.register_chatcommand("skin", { + description = S("Open skin configuration screen."), + privs = {}, + func = function(name, param) mcl_skins.show_formspec(minetest.get_player_by_name(name)) end +}) + +function mcl_skins.make_hand_texture(base, colorspec) + local output = "" + if mcl_skins.masks[base] then + output = mcl_skins.masks[base] .. + "^[colorize:" .. color_to_string(colorspec) .. ":alpha" end - local playername = player:get_player_name() - local skin, preview - if skin_id == nil or type(skin_id) ~= "number" or skin_id < 0 or skin_id > mcl_skins.skin_count then - return false - elseif skin_id == 0 then - skin = "character" - preview = "player" - mcl_player.player_set_model(player, "mcl_armor_character.b3d") - else - skin = "mcl_skins_character_" .. tostring(skin_id) - local meta = mcl_skins.meta[skin] - if meta.gender == "female" then - mcl_player.player_set_model(player, "mcl_armor_character_female.b3d") - else - mcl_player.player_set_model(player, "mcl_armor_character.b3d") - end - if mcl_skins.has_preview[skin_id] then - preview = "mcl_skins_player_" .. tostring(skin_id) - else - -- Fallback preview image if preview image is missing - preview = "mcl_skins_player_dummy" + if #output > 0 then output = output .. "^" end + output = output .. base + return output +end + +function mcl_skins.compile_skin(skin) + local output = "" + for i, tab in pairs(mcl_skins.tab_names) do + local texture = skin[tab] + if texture and texture ~= "blank.png" then + + if skin[tab .. "_color"] and mcl_skins.masks[texture] then + if #output > 0 then output = output .. "^" end + local color = color_to_string(skin[tab .. "_color"]) + output = output .. + "(" .. mcl_skins.masks[texture] .. "^[colorize:" .. color .. ":alpha)" + end + if #output > 0 then output = output .. "^" end + output = output .. texture end end - --local skin_file = skin .. ".png" - mcl_skins.skins[playername] = skin - mcl_skins.previews[playername] = preview - player:get_meta():set_string("mcl_skins:skin_id", tostring(skin_id)) - mcl_skins.update_player_skin(player) - if has_mcl_inventory then - mcl_inventory.update_inventory_formspec(player) - end - for i=1, #mcl_skins.registered_on_set_skins do - mcl_skins.registered_on_set_skins[i](player, skin) - end - minetest.log("action", "[mcl_skins] Player skin for "..playername.." set to skin #"..skin_id) - return true + return output end function mcl_skins.update_player_skin(player) if not player then return end - local playername = player:get_player_name() - mcl_player.player_set_skin(player, mcl_skins.skins[playername] .. ".png", mcl_skins.previews[playername] .. ".png") + + local skin = mcl_skins.players[player:get_player_name()] + + mcl_player.player_set_skin(player, mcl_skins.compile_skin(skin)) + + local model = skin.slim_arms and "mcl_armor_character_female.b3d" or "mcl_armor_character.b3d" + mcl_player.player_set_model(player, model) + + mcl_inventory.update_inventory_formspec(player) + + for i=1, #mcl_skins.registered_on_set_skins do + mcl_skins.registered_on_set_skins[i](player) + end end --- load player skin on join +-- Load player skin on join minetest.register_on_joinplayer(function(player) + local function table_get_random(t) + return t[math.random(#t)] + end local name = player:get_player_name() - local skin_id = player:get_meta():get_string("mcl_skins:skin_id") - local set_skin - -- do we already have a skin in player attributes? - if skin_id and skin_id ~= "" then - set_skin = tonumber(skin_id) - -- otherwise use random skin if not set + local skin = player:get_meta():get_string("mcl_skins:skin") + if skin then + skin = minetest.deserialize(skin) end - if not set_skin then - set_skin = math.random(0, mcl_skins.skin_count) + if skin then + mcl_skins.players[name] = skin + else + if math.random() > 0.5 then + skin = table.copy(mcl_skins.steve) + else + skin = table.copy(mcl_skins.alex) + end + mcl_skins.players[name] = skin end - local ok = mcl_skins.set_player_skin(player, set_skin) - if not ok then - set_skin = math.random(0, mcl_skins.skin_count) - minetest.log("warning", "[mcl_skins] Player skin for "..name.." not found, falling back to skin #"..set_skin) - mcl_skins.set_player_skin(player, set_skin) + mcl_skins.save(player) + mcl_skins.update_player_skin(player) +end) + +minetest.register_on_leaveplayer(function(player) + local name = player:get_player_name() + if name then + mcl_skins.players[name] = nil end end) @@ -161,134 +169,298 @@ function mcl_skins.register_on_set_skin(func) table.insert(mcl_skins.registered_on_set_skins, func) end --- command to set player skin (usually for custom skins) -minetest.register_chatcommand("setskin", { - params = S("[] []"), - description = S("Select player skin of yourself or another player"), - privs = {}, - func = function(name, param) - - if param == "" and name ~= "" then - mcl_skins.show_formspec(name) - return true - end - local playername, skin_id = string.match(param, "([^ ]+) (%d+)") - if not playername or not skin_id then - skin_id = string.match(param, "(%d+)") - if not skin_id then - return false, S("Insufficient or wrong parameters") - end - playername = name - end - skin_id = tonumber(skin_id) - - local player = minetest.get_player_by_name(playername) - - if not player then - return false, S("Player @1 not online!", playername) - end - if name ~= playername then - local privs = minetest.get_player_privs(name) - if not privs.server then - return false, S("You need the “server” privilege to change the skin of other players!") - end - end - - local ok = mcl_skins.set_player_skin(player, skin_id) - if not ok then - return false, S("Invalid skin number! Valid numbers: 0 to @1", mcl_skins.skin_count) - end - local skinfile = "#"..skin_id - - local meta = mcl_skins.meta[mcl_skins.skins[playername]] - local your_msg - if not meta.name or meta.name == "" then - your_msg = S("Your skin has been set to: @1", skinfile) - else - your_msg = S("Your skin has been set to: @1 (@2)", meta.name, skinfile) - end - if name == playername then - return true, your_msg - else - minetest.chat_send_player(playername, your_msg) - return true, S("Skin of @1 set to: @2 (@3)", playername, meta.name, skinfile) - end - - end, -}) - -minetest.register_on_player_receive_fields(function(player, formname, fields) - if fields.__mcl_skins then - if mcl_skins.skin_count <= 6 then - -- Change skin immediately if there are not many skins - mcl_skins.cycle_skin(player) - if player:get_attach() then - mcl_player.player_set_animation(player, "sit") - end - else - -- Show skin selection formspec otherwise - mcl_skins.show_formspec(player:get_player_name()) +function mcl_skins.show_formspec(player, active_tab, page_num) + active_tab = active_tab or "template" + page_num = page_num or 1 + + local page_count + if page_num < 1 then page_num = 1 end + if mcl_skins[active_tab] then + page_count = math.ceil(#mcl_skins[active_tab] / 25) + if page_num > page_count then + page_num = page_count end + else + page_num = 1 + page_count = 1 end -end) - -function mcl_skins.show_formspec(playername) - local formspec = "size[7,8.5]" - - formspec = formspec .. "label[2,2;" .. minetest.formspec_escape(minetest.colorize("#383838", S("Select player skin:"))) .. "]" - .. "textlist[0,2.5;6.8,6;skins_set;" - - local meta - local selected = 1 - - for i = 0, mcl_skins.skin_count do - - local label = S("@1 (@2)", mcl_skins.meta[mcl_skins.list[i]].name, "#"..i) - - formspec = formspec .. minetest.formspec_escape(label) - - if mcl_skins.skins[playername] == mcl_skins.list[i] then - selected = i + 1 - meta = mcl_skins.meta[mcl_skins.list[i]] - end - - if i < #mcl_skins.list then - formspec = formspec .."," + + local player_name = player:get_player_name() + local skin = mcl_skins.players[player_name] + local formspec = "formspec_version[3]" .. + "size[13,10]" + + for i, tab in pairs(mcl_skins.tab_names_display_order) do + if tab == active_tab then + formspec = formspec .. + "style[" .. tab .. ";bgcolor=green]" end + + local y = 0.3 + (i - 1) * 0.8 + formspec = formspec .. + "button[0.3," .. y .. ";3,0.8;" .. tab .. ";" .. mcl_skins.tab_descriptions[tab] .. "]" end - formspec = formspec .. ";" .. selected .. ";false]" + local mesh = skin.slim_arms and "mcl_armor_character_female.b3d" or "mcl_armor_character.b3d" + + formspec = formspec .. + "model[9.5,0.3;3,7;player_mesh;" .. mesh .. ";" .. + mcl_skins.compile_skin(skin) .. + ",blank.png,blank.png;0,180;false;true;0,0;0]" + + if mcl_skins[active_tab] then + local textures = mcl_skins[active_tab] + local page_start = (page_num - 1) * 25 + 1 + local page_end = math.min(page_start + 25 - 1, #textures) + + for j = page_start, page_end do + local i = j - page_start + 1 + local texture = textures[j] + local preview = "" + if mcl_skins.previews[texture] then + preview = mcl_skins.previews[texture] + if skin[active_tab .. "_color"] then + local color = minetest.colorspec_to_colorstring(skin[active_tab .. "_color"]) + preview = preview:gsub("{color}", color) + end + elseif active_tab == "base" then + if mcl_skins.masks[texture] then + preview = mcl_skins.masks[texture] .. "^[sheet:8x4:1,1" .. + "^[colorize:" .. color_to_string(skin.base_color) .. ":alpha" + end + if #preview > 0 then preview = preview .. "^" end + preview = preview .. "(" .. texture .. "^[sheet:8x4:1,1)" + elseif active_tab == "mouth" or active_tab == "eye" then + preview = texture .. "^[sheet:8x4:1,1" + elseif active_tab == "headwear" then + preview = texture .. "^[sheet:8x4:5,1^(" .. texture .. "^[sheet:8x4:1,1)" + elseif active_tab == "hair" then + if mcl_skins.masks[texture] then + preview = mcl_skins.masks[texture] .. "^[sheet:8x4:1,1" .. + "^[colorize:" .. color_to_string(skin.hair_color) .. ":alpha^(" .. + texture .. "^[sheet:8x4:1,1)^(" .. + mcl_skins.masks[texture] .. "^[sheet:8x4:5,1" .. + "^[colorize:" .. color_to_string(skin.hair_color) .. ":alpha)" .. + "^(" .. texture .. "^[sheet:8x4:5,1)" + else + preview = texture .. "^[sheet:8x4:5,1" + end + elseif active_tab == "top" then + if mcl_skins.masks[texture] then + preview = "[combine:12x12:-18,-20=" .. mcl_skins.masks[texture] .. + "^[colorize:" .. color_to_string(skin.top_color) .. ":alpha" + end + if #preview > 0 then preview = preview .. "^" end + preview = preview .. "[combine:12x12:-18,-20=" .. texture .. "^[mask:mcl_skins_top_preview_mask.png" + elseif active_tab == "bottom" then + if mcl_skins.masks[texture] then + preview = "[combine:12x12:0,-20=" .. mcl_skins.masks[texture] .. + "^[colorize:" .. color_to_string(skin.bottom_color) .. ":alpha" + end + if #preview > 0 then preview = preview .. "^" end + preview = preview .. "[combine:12x12:0,-20=" .. texture .. "^[mask:mcl_skins_bottom_preview_mask.png" + elseif active_tab == "footwear" then + preview = "[combine:12x12:0,-20=" .. texture .. "^[mask:mcl_skins_bottom_preview_mask.png" + end + + if skin[active_tab] == texture then + preview = preview .. "^mcl_skins_select_overlay.png" + end + + i = i - 1 + local x = 3.6 + i % 5 * 1.1 + local y = 0.3 + math.floor(i / 5) * 1.1 + formspec = formspec .. + "image_button[" .. x .. "," .. y .. + ";1,1;" .. preview .. ";" .. texture .. ";]" + end + elseif active_tab == "arm" then + local thick_overlay = not skin.slim_arms and "^mcl_skins_select_overlay.png" or "" + local slim_overlay = skin.slim_arms and "^mcl_skins_select_overlay.png" or "" + formspec = formspec .. + "image_button[3.6,0.3;1,1;mcl_skins_thick_arms.png" .. thick_overlay ..";thick_arms;]" .. + "image_button[4.7,0.3;1,1;mcl_skins_slim_arms.png" .. slim_overlay ..";slim_arms;]" + + elseif active_tab == "template" then + formspec = formspec .. + "model[4,2;2,3;player_mesh;" .. mesh .. ";" .. + mcl_skins.compile_skin(mcl_skins.steve) .. + ",blank.png,blank.png;0,180;false;true;0,0;0]" .. - formspec = formspec .. "image[0,0;1.35,2.7;" .. mcl_skins.previews[playername] .. ".png]" + "button[4,5.2;2,0.8;steve;" .. S("Select") .. "]" .. - if meta then - if meta.name and meta.name ~= "" then - formspec = formspec .. "label[2,0.5;" .. minetest.formspec_escape(minetest.colorize("#383838", S("Name: @1", meta.name))) .. "]" + "model[6.5,2;2,3;player_mesh;" .. mesh .. ";" .. + mcl_skins.compile_skin(mcl_skins.alex) .. + ",blank.png,blank.png;0,180;false;true;0,0;0]" .. + + "button[6.5,5.2;2,0.8;alex;" .. S("Select") .. "]" + + end + + if skin[active_tab .. "_color"] then + local colors = mcl_skins.color + if active_tab == "base" then colors = mcl_skins.base_color end + + local tab_color = active_tab .. "_color" + + for i, colorspec in pairs(colors) do + local overlay = "" + if skin[tab_color] == colorspec then + overlay = "^mcl_skins_select_overlay.png" + end + + local color = minetest.colorspec_to_colorstring(colorspec) + i = i - 1 + local x = 3.6 + i % 8 * 1.1 + local y = 7 + math.floor(i / 8) * 1.1 + formspec = formspec .. + "image_button[" .. x .. "," .. y .. + ";1,1;blank.png^[noalpha^[colorize:" .. + color .. ":alpha" .. overlay .. ";" .. colorspec .. ";]" end end + + if page_num > 1 then + formspec = formspec .. + "image_button[3.6,5.8;1,1;mcl_skins_arrow.png^[transformFX;previous_page;]" + end + + if page_num < page_count then + formspec = formspec .. + "image_button[8,5.8;1,1;mcl_skins_arrow.png;next_page;]" + end + + if page_count > 1 then + formspec = formspec .. + "label[5.9,6.3;" .. page_num .. " / " .. page_count .. "]" + end - minetest.show_formspec(playername, "mcl_skins:skin_select", formspec) + minetest.show_formspec(player_name, "mcl_skins:" .. active_tab .. "_" .. page_num, formspec) end minetest.register_on_player_receive_fields(function(player, formname, fields) + if fields.__mcl_skins then + mcl_skins.show_formspec(player) + return false + end - if formname == "mcl_skins:skin_select" then - - local name = player:get_player_name() - - local event = minetest.explode_textlist_event(fields["skins_set"]) - - if event.type == "CHG" or event.type == "DCL" then - - local skin_id = math.min(event.index - 1, mcl_skins.skin_count) - if not mcl_skins.list[skin_id] then - return -- Do not update wrong skin number + if not formname:find("^mcl_skins:") then return false end + local _, _, active_tab, page_num = formname:find("^mcl_skins:(%a+)_(%d+)") + if not page_num or not active_tab then return true end + page_num = math.floor(tonumber(page_num) or 1) + local player_name = player:get_player_name() + + for field, value in pairs(fields) do + if field == "quit" then + mcl_skins.save(player) + return true + end + + if field == "alex" then + mcl_skins.players[player_name] = table.copy(mcl_skins.alex) + mcl_skins.update_player_skin(player) + mcl_skins.show_formspec(player, active_tab, page_num) + return true + elseif field == "steve" then + mcl_skins.players[player_name] = table.copy(mcl_skins.steve) + mcl_skins.update_player_skin(player) + mcl_skins.show_formspec(player, active_tab, page_num) + return true + end + + for i, tab in pairs(mcl_skins.tab_names_display_order) do + if field == tab then + mcl_skins.show_formspec(player, tab, page_num) + return true + end + end + + local skin = mcl_skins.players[player_name] + if not skin then return true end + + if field == "next_page" then + page_num = page_num + 1 + mcl_skins.show_formspec(player, active_tab, page_num) + return true + elseif field == "previous_page" then + page_num = page_num - 1 + mcl_skins.show_formspec(player, active_tab, page_num) + return true + end + + if active_tab == "arm" then + if field == "thick_arms" then + skin.slim_arms = false + elseif field == "slim_arms" then + skin.slim_arms = true + end + mcl_skins.update_player_skin(player) + mcl_skins.show_formspec(player, active_tab, page_num) + return true + end + + -- See if field is a texture + if mcl_skins[active_tab] then + for i, texture in pairs(mcl_skins[active_tab]) do + if texture == field then + skin[active_tab] = texture + mcl_skins.update_player_skin(player) + mcl_skins.show_formspec(player, active_tab, page_num) + return true + end + end + end + + -- See if field is a color + if skin[active_tab .. "_color"] then + local color = math.floor(tonumber(field) or 0) + if color and color >= 0 and color <= 0xffffffff then + skin[active_tab .. "_color"] = color + mcl_skins.update_player_skin(player) + mcl_skins.show_formspec(player, active_tab, page_num) + return true end - - mcl_skins.set_player_skin(player, skin_id) - mcl_skins.show_formspec(name) end end + + return true end) -minetest.log("action", "[mcl_skins] Mod initialized with "..mcl_skins.skin_count.." custom skin(s)") +local function init() + local function file_exists(name) + local f = io.open(name) + if not f then + return false + end + f:close() + return true + end + mcl_skins.modpath = minetest.get_modpath("mcl_skins") + + local f = io.open(mcl_skins.modpath .. "/list.json") + assert(f, "Can't open the file list.json") + local data = f:read("*all") + assert(data, "Can't read data from list.json") + local json, error = minetest.parse_json(data) + assert(json, error) + f:close() + + for _, item in pairs(json) do + mcl_skins.register_item(item) + end + mcl_skins.steve.base_color = mcl_skins.base_color[1] + mcl_skins.steve.hair_color = mcl_skins.color[1] + mcl_skins.steve.top_color = mcl_skins.color[12] + mcl_skins.steve.bottom_color = mcl_skins.color[13] + mcl_skins.steve.slim_arms = false + + mcl_skins.alex.base_color = mcl_skins.base_color[1] + mcl_skins.alex.hair_color = mcl_skins.color[15] + mcl_skins.alex.top_color = mcl_skins.color[8] + mcl_skins.alex.bottom_color = mcl_skins.color[1] + mcl_skins.alex.slim_arms = true + + mcl_skins.previews["blank.png"] = "blank.png" +end + +init() diff --git a/mods/PLAYER/mcl_skins/list.json b/mods/PLAYER/mcl_skins/list.json new file mode 100644 index 000000000..9dbe0dda7 --- /dev/null +++ b/mods/PLAYER/mcl_skins/list.json @@ -0,0 +1,256 @@ +[ + { + "type": "footwear", + "texture": "mcl_skins_footwear_1.png", + "steve": true, + "alex": true + }, + { + "type": "footwear", + "texture": "mcl_skins_footwear_2.png" + }, + { + "type": "footwear", + "texture": "mcl_skins_footwear_3.png" + }, + { + "type": "footwear" + }, + { + "type": "eye", + "texture": "mcl_skins_eye_1.png" + }, + { + "type": "eye", + "texture": "mcl_skins_eye_2.png" + }, + { + "type": "eye", + "texture": "mcl_skins_eye_3.png" + }, + { + "type": "eye", + "texture": "mcl_skins_eye_4.png" + }, + { + "type": "eye", + "texture": "mcl_skins_eye_5.png", + "steve": true, + "alex": true + }, + { + "type": "eye", + "texture": "mcl_skins_eye_6.png" + }, + { + "type": "eye", + "texture": "mcl_skins_eye_7.png" + }, + { + "type": "mouth", + "texture": "mcl_skins_mouth_1.png", + "steve": true + }, + { + "type": "mouth", + "texture": "mcl_skins_mouth_2.png" + }, + { + "type": "mouth", + "texture": "mcl_skins_mouth_3.png" + }, + { + "type": "mouth", + "texture": "mcl_skins_mouth_4.png" + }, + { + "type": "mouth", + "texture": "mcl_skins_mouth_5.png" + }, + { + "type": "mouth", + "texture": "mcl_skins_mouth_6.png" + }, + { + "type": "mouth", + "texture": "mcl_skins_mouth_7.png", + "alex": true + }, + { + "type": "mouth" + }, + { + "type": "hair", + "texture": "mcl_skins_hair_1.png", + "mask": "mcl_skins_hair_1_mask.png" + }, + { + "type": "hair", + "texture": "mcl_skins_hair_2.png", + "mask": "mcl_skins_hair_2_mask.png" + }, + { + "type": "hair", + "texture": "mcl_skins_hair_3.png", + "mask": "mcl_skins_hair_3_mask.png" + }, + { + "type": "hair", + "texture": "mcl_skins_hair_4.png", + "mask": "mcl_skins_hair_4_mask.png" + }, + { + "type": "hair", + "texture": "mcl_skins_hair_5.png", + "mask": "mcl_skins_hair_5_mask.png" + }, + { + "type": "hair", + "texture": "mcl_skins_hair_6.png", + "mask": "mcl_skins_hair_6_mask.png" + }, + { + "type": "hair", + "texture": "mcl_skins_hair_7.png", + "mask": "mcl_skins_hair_7_mask.png" + }, + { + "type": "hair", + "texture": "mcl_skins_hair_8.png", + "mask": "mcl_skins_hair_8_mask.png" + }, + { + "type": "hair", + "texture": "mcl_skins_hair_9.png", + "mask": "mcl_skins_hair_9_mask.png" + }, + { + "type": "hair", + "texture": "mcl_skins_hair_10.png", + "mask": "mcl_skins_hair_10_mask.png", + "steve": true + }, + { + "type": "hair", + "texture": "mcl_skins_hair_11.png", + "mask": "mcl_skins_hair_11_mask.png", + "alex": true + }, + { + "type": "hair" + }, + { + "type": "headwear", + "texture": "mcl_skins_headwear_1.png" + }, + { + "type": "headwear", + "texture": "mcl_skins_headwear_2.png" + }, + { + "type": "headwear", + "texture": "mcl_skins_headwear_3.png" + }, + { + "type": "headwear", + "texture": "mcl_skins_headwear_4.png" + }, + { + "type": "headwear", + "texture": "mcl_skins_headwear_5.png" + }, + { + "type": "headwear", + "texture": "mcl_skins_headwear_6.png", + "preview": "mcl_skins_headwear_6.png^[sheet:8x4:7,1" + }, + { + "type": "headwear", + "texture": "mcl_skins_headwear_7.png" + }, + { + "type": "headwear", + "steve": true + }, + { + "type": "bottom", + "texture": "mcl_skins_bottom_1.png", + "mask": "mcl_skins_bottom_1_mask.png" + }, + { + "type": "bottom", + "texture": "mcl_skins_bottom_2.png", + "mask": "mcl_skins_bottom_2_mask.png" + }, + { + "type": "bottom", + "texture": "mcl_skins_bottom_3.png", + "mask": "mcl_skins_bottom_3_mask.png" + }, + { + "type": "bottom", + "texture": "mcl_skins_bottom_4.png", + "mask": "mcl_skins_bottom_4_mask.png", + "steve": true, + "alex": true + }, + { + "type": "top", + "texture": "mcl_skins_top_1.png", + "mask": "mcl_skins_top_1_mask.png" + }, + { + "type": "top", + "texture": "mcl_skins_top_2.png", + "mask": "mcl_skins_top_2_mask.png" + }, + { + "type": "top", + "texture": "mcl_skins_top_3.png", + "mask": "mcl_skins_top_3_mask.png" + }, + { + "type": "top", + "texture": "mcl_skins_top_4.png", + "mask": "mcl_skins_top_4_mask.png" + }, + { + "type": "top", + "texture": "mcl_skins_top_5.png", + "mask": "mcl_skins_top_5_mask.png" + }, + { + "type": "top", + "texture": "mcl_skins_top_6.png", + "mask": "mcl_skins_top_6_mask.png" + }, + { + "type": "top", + "texture": "mcl_skins_top_7.png", + "mask": "mcl_skins_top_7_mask.png" + }, + { + "type": "top", + "texture": "mcl_skins_top_8.png", + "mask": "mcl_skins_top_8_mask.png" + }, + { + "type": "top", + "texture": "mcl_skins_top_9.png", + "mask": "mcl_skins_top_9_mask.png", + "alex": true + }, + { + "type": "top", + "texture": "mcl_skins_top_10.png", + "mask": "mcl_skins_top_10_mask.png", + "steve": true + }, + { + "type": "base", + "texture": "mcl_skins_base_1.png", + "mask": "mcl_skins_base_1_mask.png", + "steve": true, + "alex": true + } +] diff --git a/mods/PLAYER/mcl_skins/locale/mcl_skins.de.tr b/mods/PLAYER/mcl_skins/locale/mcl_skins.de.tr deleted file mode 100644 index 8f9b488db..000000000 --- a/mods/PLAYER/mcl_skins/locale/mcl_skins.de.tr +++ /dev/null @@ -1,13 +0,0 @@ -# textdomain: mcl_skins -[] []=[] [] -Select player skin of yourself or another player=Spieleraussehen von Ihnen oder einem anderen Spieler auswählen -Insufficient or wrong parameters=Unzureichende oder falsche Parameter -Player @1 not online!=Spieler @1 ist nicht online! -You need the “server” privilege to change the skin of other players!=Sie brauchen das „server“-Privileg, um das Aussehen anderer Spieler zu ändern! -Invalid skin number! Valid numbers: 0 to @1=Ungültige Aussehens-Nummer! Gültige Nummern: 0 bis @1 -Your skin has been set to: @1=Ihr Aussehen wurde geändert auf: @1 -Your skin has been set to: @1 (@2)=Ihr Aussehen wurde geändert auf: @1 (@2) -Skin of @1 set to: @2 (@3)=Aussehen von @1 gesetzt auf: @2 (@3) -Select player skin:=Spieleraussehen wählen: -@1 (@2)=@1 (@2) -Name: @1=Name: @1 diff --git a/mods/PLAYER/mcl_skins/locale/mcl_skins.es.tr b/mods/PLAYER/mcl_skins/locale/mcl_skins.es.tr deleted file mode 100644 index dcd5c8438..000000000 --- a/mods/PLAYER/mcl_skins/locale/mcl_skins.es.tr +++ /dev/null @@ -1,13 +0,0 @@ -# textdomain: mcl_skins -[] []=[] [] -Select player skin of yourself or another player=Selecciona el skin tuyo o de otro jugador -Insufficient or wrong parameters=Parámetros insuficientes o incorrectos -Player @1 not online!=¡El jugador @1 no está en línea! -You need the “server” privilege to change the skin of other players!=¡Necesitas el privilegio de "servidor" para cambiar el aspecto de otros jugadores! -Invalid skin number! Valid numbers: 0 to @1=¡Número de piel no válido! Números válidos: 0 a @1 -Your skin has been set to: @1=Su skin se ha configurado a: @1 -Your skin has been set to: @1 (@2)=Su skin se ha configurado a: @1 (@2) -Skin of @1 set to: @2 (@3)=El skin de @1 se ha configurado a: @2 (@3) -Select player skin:=Selecciona el skin del jugador: -@1 (@2)=@1 (@2) -Name: @1=Nombre: @1 diff --git a/mods/PLAYER/mcl_skins/locale/mcl_skins.fr.tr b/mods/PLAYER/mcl_skins/locale/mcl_skins.fr.tr index d38f907ff..db937b040 100644 --- a/mods/PLAYER/mcl_skins/locale/mcl_skins.fr.tr +++ b/mods/PLAYER/mcl_skins/locale/mcl_skins.fr.tr @@ -1,14 +1,13 @@ # textdomain: mcl_skins -[] []=[] [] -Select player skin of yourself or another player=Sélectionner une apparence pour vous même ou un autre joueur -Insufficient or wrong parameters=Paramètres insuffisants ou incorrects -Player @1 not online!=Le joueur @1 n'est pas en ligne ! -You need the “server” privilege to change the skin of other players!=Vous avez besoin du privilège “server” pour changer l'apparence des autres joueurs ! -Invalid skin number! Valid numbers: 0 to @1=Numéro d'apparence incorrect! Numéros valides : 0 à @1 -Your skin has been set to: @1=Votre apparence a été définie en : @1 -Your skin has been set to: @1 (@2)=Votre apparence a été définie en : @1 (@2) -Skin of @1 set to: @2 (@3)=Apparence de @1 definie en : @2 (@3) -Select player skin:=Sélectionner l'apparence du joueur : -@1 (@2)=@1 (@2) -Name: @1=Nom : @1 - +Templates=Modèles +Arm size=Taille des bras +Bases=Teint +Footwears=Chaussures +Eyes=Yeux +Mouths=Bouches +Bottoms=Bas +Tops=Haut +Hairs=Cheveux +Headwears=Coiffe +Open skin configuration screen.=Ouvrir l'écran de configuration du costume. +Select=Sélectionner \ No newline at end of file diff --git a/mods/PLAYER/mcl_skins/locale/mcl_skins.ms.tr b/mods/PLAYER/mcl_skins/locale/mcl_skins.ms.tr deleted file mode 100644 index 58946f605..000000000 --- a/mods/PLAYER/mcl_skins/locale/mcl_skins.ms.tr +++ /dev/null @@ -1,16 +0,0 @@ -# textdomain: mcl_skins -# UNFINISHED translation! -# TODO: Remove the # sign from the translations below and add the missing translations. - -[] []= -Select player skin of yourself or another player= -Insufficient or wrong parameters= -Player @1 not online!= -You need the “server” privilege to change the skin of other players!= -Invalid skin number! Valid numbers: 0 to @1= -Your skin has been set to: @1= -Your skin has been set to: @1 (@2)= -Skin of @1 set to: @2 (@3)= -Select player skin:=Pilih Kulit Pemain: -@1 (@2)= -Name: @1=Nama: @1 diff --git a/mods/PLAYER/mcl_skins/locale/mcl_skins.pl.tr b/mods/PLAYER/mcl_skins/locale/mcl_skins.pl.tr deleted file mode 100644 index 9b07cea2c..000000000 --- a/mods/PLAYER/mcl_skins/locale/mcl_skins.pl.tr +++ /dev/null @@ -1,13 +0,0 @@ -# textdomain: mcl_skins -[] []=[] [] -Select player skin of yourself or another player=Wybierz skin gracza dla siebie lub innego gracza -Insufficient or wrong parameters=Niewystarczające lub złe parametry -Player @1 not online!=Gracz @1 nie jest online! -You need the “server” privilege to change the skin of other players!=Potrzebujesz uprawnienia "serwer", aby zmieniać skiny innych graczy! -Invalid skin number! Valid numbers: 0 to @1=Niepoprawny numer skina! Poprawne numery: od 0 do @1 -Your skin has been set to: @1=Twój skin został ustawiony na: @1 -Your skin has been set to: @1 (@2)=Twój skin został ustawiony na: @1 (@2) -Skin of @1 set to: @2 (@3)=Skin gracza @1 ustawiony na @2 (@3) -Select player skin:=Wybierz skin gracza: -@1 (@2)=@1 (@2) -Name: @1=Nazwa: @1 diff --git a/mods/PLAYER/mcl_skins/locale/mcl_skins.ru.tr b/mods/PLAYER/mcl_skins/locale/mcl_skins.ru.tr deleted file mode 100644 index 3b8fac442..000000000 --- a/mods/PLAYER/mcl_skins/locale/mcl_skins.ru.tr +++ /dev/null @@ -1,13 +0,0 @@ -# textdomain: mcl_skins -[] []=[<игрок>] [<номер скина>] -Select player skin of yourself or another player=Выберите скин для себя или для другого игрока -Insufficient or wrong parameters=Недопустимые или неправильные параметры -Player @1 not online!=Игрок @1 не в сети! -You need the “server” privilege to change the skin of other players!=Для смены скинов другим игрокам у Вас должна быть привилегия “server”! -Invalid skin number! Valid numbers: 0 to @1=Недопустимый номер скина! Допустимые номера: от 0 до @1 -Your skin has been set to: @1=Ваш скин установлен: @1 -Your skin has been set to: @1 (@2)=Ваш скин установлен: @1 (@2) -Skin of @1 set to: @2 (@3)=Скин игрока @1 установлен: @2 (@3) -Select player skin:=Выбор скина игрока: -@1 (@2)=@1 (@2) -Name: @1=Имя: @1 diff --git a/mods/PLAYER/mcl_skins/locale/mcl_skins.zh_CN.tr b/mods/PLAYER/mcl_skins/locale/mcl_skins.zh_CN.tr deleted file mode 100644 index 4b903b619..000000000 --- a/mods/PLAYER/mcl_skins/locale/mcl_skins.zh_CN.tr +++ /dev/null @@ -1,13 +0,0 @@ -# textdomain: mcl_skins -[] []=[<玩家>] [<皮肤编号>] -Select player skin of yourself or another player=选择你自己的玩家皮肤或者其他玩家皮肤 -Insufficient or wrong parameters=参数不足或错误 -Player @1 not online!=玩家 @1 不在线 -You need the “server” privilege to change the skin of other players!=你需要“服务器”特权来改变其他玩家的皮肤! -Invalid skin number! Valid numbers: 0 to @1=无效的皮肤编号!有效数字: 0到 @1 -Your skin has been set to: @1=您的皮肤已设置为: @1 -Your skin has been set to: @1 (@2)=您的皮肤已设置为: @1 (@2) -Skin of @1 set to: @2 (@3)=@1 的皮肤 已经设置为: @2 (@3) -Select player skin:=选择你的玩家皮肤 -@1 (@2)=@1 (@2) -Name: @1=名字: @1 diff --git a/mods/PLAYER/mcl_skins/locale/template.txt b/mods/PLAYER/mcl_skins/locale/template.txt index c683fa4e4..1facf03d5 100644 --- a/mods/PLAYER/mcl_skins/locale/template.txt +++ b/mods/PLAYER/mcl_skins/locale/template.txt @@ -1,13 +1,13 @@ # textdomain: mcl_skins -[] []= -Select player skin of yourself or another player= -Insufficient or wrong parameters= -Player @1 not online!= -You need the “server” privilege to change the skin of other players!= -Invalid skin number! Valid numbers: 0 to @1= -Your skin has been set to: @1= -Your skin has been set to: @1 (@2)= -Skin of @1 set to: @2 (@3)= -Select player skin:= -@1 (@2)= -Name: @1= +Templates= +Arm size= +Bases= +Footwears= +Eyes= +Mouths= +Bottoms= +Tops= +Hairs= +Headwears= +Open skin configuration screen.= +Select= diff --git a/mods/PLAYER/mcl_skins/meta/mcl_skins_character.txt b/mods/PLAYER/mcl_skins/meta/mcl_skins_character.txt deleted file mode 100644 index c31bd7168..000000000 --- a/mods/PLAYER/mcl_skins/meta/mcl_skins_character.txt +++ /dev/null @@ -1,3 +0,0 @@ -name = "Steve", -author = "%TEXTURE_PACK_AUTHOR%", -gender = "male", diff --git a/mods/PLAYER/mcl_skins/meta/mcl_skins_character_1.txt b/mods/PLAYER/mcl_skins/meta/mcl_skins_character_1.txt deleted file mode 100644 index e6c90dc0f..000000000 --- a/mods/PLAYER/mcl_skins/meta/mcl_skins_character_1.txt +++ /dev/null @@ -1,3 +0,0 @@ -name = "Alex", -author = "%TEXTURE_PACK_AUTHOR%", -gender = "female", diff --git a/mods/PLAYER/mcl_skins/mod.conf b/mods/PLAYER/mcl_skins/mod.conf index 657d3cc0e..f631b76dc 100644 --- a/mods/PLAYER/mcl_skins/mod.conf +++ b/mods/PLAYER/mcl_skins/mod.conf @@ -1,5 +1,4 @@ name = mcl_skins -author = TenPlus1 -description = Mod that allows players to set their individual skins. -depends = mcl_player -optional_depends = mcl_inventory, intllib +author = MrRar +description = Advanced player skin customization. +depends = mcl_player,mcl_inventory diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_arrow.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_arrow.png new file mode 100644 index 000000000..4ca964a8d Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_arrow.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_base_1.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_base_1.png new file mode 100644 index 000000000..505331181 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_base_1.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_base_1_mask.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_base_1_mask.png new file mode 100644 index 000000000..06c857c4d Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_base_1_mask.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_bottom_1.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_bottom_1.png new file mode 100644 index 000000000..eccc15ebf Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_bottom_1.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_bottom_1_mask.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_bottom_1_mask.png new file mode 100644 index 000000000..41f38d04f Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_bottom_1_mask.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_bottom_2.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_bottom_2.png new file mode 100644 index 000000000..3053b422b Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_bottom_2.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_bottom_2_mask.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_bottom_2_mask.png new file mode 100644 index 000000000..2758cf8b8 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_bottom_2_mask.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_bottom_3.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_bottom_3.png new file mode 100644 index 000000000..aacfeb334 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_bottom_3.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_bottom_3_mask.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_bottom_3_mask.png new file mode 100644 index 000000000..0a97de395 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_bottom_3_mask.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_bottom_4.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_bottom_4.png new file mode 100644 index 000000000..304a2ccb5 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_bottom_4.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_bottom_4_mask.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_bottom_4_mask.png new file mode 100644 index 000000000..3312073c9 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_bottom_4_mask.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_bottom_preview_mask.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_bottom_preview_mask.png new file mode 100644 index 000000000..35c8f4c8a Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_bottom_preview_mask.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_button.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_button.png index 49acf8550..16801e918 100644 Binary files a/mods/PLAYER/mcl_skins/textures/mcl_skins_button.png and b/mods/PLAYER/mcl_skins/textures/mcl_skins_button.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_character_1.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_character_1.png deleted file mode 100644 index 71f02471d..000000000 Binary files a/mods/PLAYER/mcl_skins/textures/mcl_skins_character_1.png and /dev/null differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_eye_1.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_eye_1.png new file mode 100644 index 000000000..ff19a09b3 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_eye_1.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_eye_2.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_eye_2.png new file mode 100644 index 000000000..4fd1b207f Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_eye_2.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_eye_3.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_eye_3.png new file mode 100644 index 000000000..6a6ebc74d Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_eye_3.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_eye_4.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_eye_4.png new file mode 100644 index 000000000..1cd82bd48 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_eye_4.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_eye_5.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_eye_5.png new file mode 100644 index 000000000..dacc5cb23 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_eye_5.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_eye_6.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_eye_6.png new file mode 100644 index 000000000..8be76c317 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_eye_6.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_eye_7.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_eye_7.png new file mode 100644 index 000000000..f800a90b7 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_eye_7.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_footwear_1.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_footwear_1.png new file mode 100644 index 000000000..1ff60f24b Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_footwear_1.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_footwear_2.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_footwear_2.png new file mode 100644 index 000000000..dc0ef6472 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_footwear_2.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_footwear_3.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_footwear_3.png new file mode 100644 index 000000000..69bb4d934 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_footwear_3.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_1.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_1.png new file mode 100644 index 000000000..df2397d32 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_1.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_10.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_10.png new file mode 100644 index 000000000..72a50f722 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_10.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_10_mask.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_10_mask.png new file mode 100644 index 000000000..7c8822cf6 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_10_mask.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_11.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_11.png new file mode 100644 index 000000000..3eff9bca4 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_11.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_11_mask.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_11_mask.png new file mode 100644 index 000000000..05836b288 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_11_mask.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_1_mask.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_1_mask.png new file mode 100644 index 000000000..cc58ddd23 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_1_mask.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_2.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_2.png new file mode 100644 index 000000000..d0f4a24e4 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_2.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_2_mask.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_2_mask.png new file mode 100644 index 000000000..925821788 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_2_mask.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_3.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_3.png new file mode 100644 index 000000000..d88945b41 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_3.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_3_mask.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_3_mask.png new file mode 100644 index 000000000..6ac774343 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_3_mask.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_4.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_4.png new file mode 100644 index 000000000..61fa3db8c Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_4.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_4_mask.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_4_mask.png new file mode 100644 index 000000000..542717316 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_4_mask.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_5.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_5.png new file mode 100644 index 000000000..55214fac5 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_5.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_5_mask.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_5_mask.png new file mode 100644 index 000000000..ecee2e2bb Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_5_mask.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_6.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_6.png new file mode 100644 index 000000000..40e6eb759 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_6.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_6_mask.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_6_mask.png new file mode 100644 index 000000000..c1de86fd5 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_6_mask.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_7.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_7.png new file mode 100644 index 000000000..2449a06ce Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_7.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_7_mask.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_7_mask.png new file mode 100644 index 000000000..6b1aa0b34 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_7_mask.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_8.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_8.png new file mode 100644 index 000000000..f332eebc0 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_8.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_8_mask.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_8_mask.png new file mode 100644 index 000000000..751fb9bc0 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_8_mask.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_9.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_9.png new file mode 100644 index 000000000..dfbe0b574 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_9.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_9_mask.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_9_mask.png new file mode 100644 index 000000000..a5ba8f989 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_hair_9_mask.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_headwear_1.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_headwear_1.png new file mode 100644 index 000000000..3a0fcf1a9 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_headwear_1.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_headwear_2.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_headwear_2.png new file mode 100644 index 000000000..5e288734d Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_headwear_2.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_headwear_3.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_headwear_3.png new file mode 100644 index 000000000..682eb4df4 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_headwear_3.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_headwear_4.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_headwear_4.png new file mode 100644 index 000000000..1b278d5b0 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_headwear_4.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_headwear_5.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_headwear_5.png new file mode 100644 index 000000000..0246dccda Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_headwear_5.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_headwear_6.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_headwear_6.png new file mode 100644 index 000000000..9c9ab1a02 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_headwear_6.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_headwear_7.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_headwear_7.png new file mode 100644 index 000000000..755b82a84 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_headwear_7.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_mouth_1.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_mouth_1.png new file mode 100644 index 000000000..7b48bc770 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_mouth_1.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_mouth_2.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_mouth_2.png new file mode 100644 index 000000000..2ac147e31 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_mouth_2.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_mouth_3.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_mouth_3.png new file mode 100644 index 000000000..9bb46f618 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_mouth_3.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_mouth_4.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_mouth_4.png new file mode 100644 index 000000000..a01f7ed05 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_mouth_4.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_mouth_5.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_mouth_5.png new file mode 100644 index 000000000..74a25a93e Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_mouth_5.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_mouth_6.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_mouth_6.png new file mode 100644 index 000000000..3b93aaead Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_mouth_6.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_mouth_7.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_mouth_7.png new file mode 100644 index 000000000..0b1afb994 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_mouth_7.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_player_1.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_player_1.png deleted file mode 100644 index 3d7af2a98..000000000 Binary files a/mods/PLAYER/mcl_skins/textures/mcl_skins_player_1.png and /dev/null differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_player_dummy.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_player_dummy.png deleted file mode 100644 index d1f7dc20a..000000000 Binary files a/mods/PLAYER/mcl_skins/textures/mcl_skins_player_dummy.png and /dev/null differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_select_overlay.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_select_overlay.png new file mode 100644 index 000000000..dabc824bf Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_select_overlay.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_slim_arms.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_slim_arms.png new file mode 100644 index 000000000..5e220587e Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_slim_arms.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_thick_arms.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_thick_arms.png new file mode 100644 index 000000000..95b189924 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_thick_arms.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_top_1.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_top_1.png new file mode 100644 index 000000000..aeddf5212 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_top_1.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_top_10.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_top_10.png new file mode 100644 index 000000000..d7e0191cd Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_top_10.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_top_10_mask.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_top_10_mask.png new file mode 100644 index 000000000..f5d8d40b8 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_top_10_mask.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_top_1_mask.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_top_1_mask.png new file mode 100644 index 000000000..64df0b039 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_top_1_mask.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_top_2.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_top_2.png new file mode 100644 index 000000000..5deb9f8bb Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_top_2.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_top_2_mask.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_top_2_mask.png new file mode 100644 index 000000000..564f938a6 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_top_2_mask.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_top_3.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_top_3.png new file mode 100644 index 000000000..14b65d09a Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_top_3.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_top_3_mask.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_top_3_mask.png new file mode 100644 index 000000000..0e87301de Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_top_3_mask.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_top_4.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_top_4.png new file mode 100644 index 000000000..693ef3216 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_top_4.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_top_4_mask.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_top_4_mask.png new file mode 100644 index 000000000..a7e5ce8af Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_top_4_mask.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_top_5.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_top_5.png new file mode 100644 index 000000000..fc1e798b7 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_top_5.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_top_5_mask.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_top_5_mask.png new file mode 100644 index 000000000..b846c71e1 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_top_5_mask.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_top_6.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_top_6.png new file mode 100644 index 000000000..6f9f7dcc0 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_top_6.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_top_6_mask.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_top_6_mask.png new file mode 100644 index 000000000..c89bc3624 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_top_6_mask.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_top_7.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_top_7.png new file mode 100644 index 000000000..844c09ac8 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_top_7.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_top_7_mask.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_top_7_mask.png new file mode 100644 index 000000000..0a6e65227 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_top_7_mask.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_top_8.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_top_8.png new file mode 100644 index 000000000..da32f24c6 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_top_8.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_top_8_mask.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_top_8_mask.png new file mode 100644 index 000000000..e4f61a4cc Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_top_8_mask.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_top_9.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_top_9.png new file mode 100644 index 000000000..2b65eca98 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_top_9.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_top_9_mask.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_top_9_mask.png new file mode 100644 index 000000000..55c1dd993 Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_top_9_mask.png differ diff --git a/mods/PLAYER/mcl_skins/textures/mcl_skins_top_preview_mask.png b/mods/PLAYER/mcl_skins/textures/mcl_skins_top_preview_mask.png new file mode 100644 index 000000000..0cb4f315d Binary files /dev/null and b/mods/PLAYER/mcl_skins/textures/mcl_skins_top_preview_mask.png differ diff --git a/mods/PLAYER/mcl_wieldview/README.txt b/mods/PLAYER/mcl_wieldview/README.txt index 183e8c6d5..660974f9b 100644 --- a/mods/PLAYER/mcl_wieldview/README.txt +++ b/mods/PLAYER/mcl_wieldview/README.txt @@ -3,19 +3,10 @@ Makes hand wielded items visible to other players. -default settings: [minetest.conf] - -# Set number of seconds between visible wielded item updates. -wieldview_update_time = 2 - -# Show nodes as tiles, disabled by default -wieldview_node_tiles = false - Info for modders ################ -Wield image transformation: To apply a simple transformation to the item in -hand, add the group “wieldview_transform” to the item definition. The group -rating equals one of the numbers used for the [transform texture modifier -of the Lua API. +Add an item to the "no_wieldview" group with a rating of 1 and it will not be shown by the wieldview. +If an item has the "no_wieldview" group rating of 1, the item definition can specify the property "_wieldview_item". +"_wieldview_item" should be set to an item name that will be shown by the wieldview instead of the item. diff --git a/mods/PLAYER/mcl_wieldview/init.lua b/mods/PLAYER/mcl_wieldview/init.lua index 92175a17e..947c2fdce 100644 --- a/mods/PLAYER/mcl_wieldview/init.lua +++ b/mods/PLAYER/mcl_wieldview/init.lua @@ -1,131 +1,49 @@ -local get_connected_players = minetest.get_connected_players local get_item_group = minetest.get_item_group -mcl_wieldview = { - players = {} -} - -function mcl_wieldview.get_item_texture(itemname) - if itemname == "" or minetest.get_item_group(itemname, "no_wieldview") ~= 0 then - return - end - - local def = minetest.registered_items[itemname] - if not def then - return - end - - local inv_image = def.inventory_image - if inv_image == "" then - return - end - - local texture = inv_image - - local transform = get_item_group(itemname, "wieldview_transform") - if transform then - -- This actually works with groups ratings because transform1, transform2, etc. - -- have meaning and transform0 is used for identidy, so it can be ignored - texture = texture .. "^[transform" .. transform - end - - return texture -end - -function mcl_wieldview.update_wielded_item(player) - if not player then - return - end - local itemstack = player:get_wielded_item() - local itemname = itemstack:get_name() - - local def = mcl_wieldview.players[player] - - if def and (def.item == itemname) then - return - end - - local texture = mcl_wieldview.get_item_texture(itemname) or "blank.png" - - local new_def = { - item = itemname, - texture = texture, - } - mcl_wieldview.players[player] = new_def - - mcl_player.player_set_wielditem(player, texture) -end - minetest.register_on_joinplayer(function(player) - mcl_wieldview.players[player] = {item = "", texture = "blank.png"} - - minetest.after(0, function() - if not player:is_player() then - return - end - - mcl_wieldview.update_wielded_item(player) - - local itementity = minetest.add_entity(player:get_pos(), "mcl_wieldview:wieldnode") - itementity:set_attach(player, "Hand_Right", vector.new(0, 1, 0), vector.new(90, 0, 45)) - itementity:get_luaentity().wielder = player - end) -end) - -minetest.register_on_leaveplayer(function(player) - mcl_wieldview.players[player] = nil -end) - -minetest.register_globalstep(function() - local players = get_connected_players() - for i = 1, #players do - mcl_wieldview.update_wielded_item(players[i]) + if not player or not player:is_player() then + return end + local itementity = minetest.add_entity(player:get_pos(), "mcl_wieldview:wieldnode") + if not itementity then return end + itementity:set_attach(player, "Wield_Item", vector.new(0, 0, 0), vector.new(0, 0, 0)) + --itementity:set_attach(player, "Hand_Right", vector.new(0, 1, 0), vector.new(90, 45, 90)) + itementity:get_luaentity()._wielder = player end) minetest.register_entity("mcl_wieldview:wieldnode", { - initial_properties = { - hp_max = 1, - visual = "wielditem", - physical = false, - textures = {""}, - automatic_rotate = 1.5, - is_visible = true, - pointable = false, - collide_with_objects = false, - static_save = false, - collisionbox = {-0.21, -0.21, -0.21, 0.21, 0.21, 0.21}, - selectionbox = {-0.21, -0.21, -0.21, 0.21, 0.21, 0.21}, - visual_size = {x = 0.21, y = 0.21}, - }, - - itemstring = "", - + visual = "wielditem", + physical = false, + pointable = false, + collide_with_objects = false, + static_save = false, + visual_size = {x = 0.21, y = 0.21}, on_step = function(self) - if self.wielder:is_player() then - local def = mcl_wieldview.players[self.wielder] - local itemstring = def.item - - if self.itemstring ~= itemstring then - local itemdef = minetest.registered_items[itemstring] - self.object:set_properties({glow = itemdef and itemdef.light_source or 0}) - - -- wield item as cubic - if def.texture == "blank.png" then - self.object:set_properties({textures = {itemstring}}) - -- wield item as flat - else - self.object:set_properties({textures = {""}}) - end - - if minetest.get_item_group(itemstring, "no_wieldview") ~= 0 then - self.object:set_properties({textures = {""}}) - end - - self.itemstring = itemstring - end - else + if not self._wielder or not self._wielder:is_player() then self.object:remove() end + local player = self._wielder + + local item = player:get_wielded_item():get_name() + + if item == self._item then return end + + self._item = item + + if get_item_group(item, "no_wieldview") ~= 0 then + local def = player:get_wielded_item():get_definition() + if def and def._wieldview_item then + item = def._wieldview_item + else + item = "" + end + end + + local item_def = minetest.registered_items[item] + self.object:set_properties({ + glow = item_def and item_def.light_source or 0, + wield_item = item, + is_visible = item ~= "" + }) end, }) diff --git a/mods/PLAYER/mcl_wieldview/mod.conf b/mods/PLAYER/mcl_wieldview/mod.conf index 4b3097876..7ed41eeb4 100644 --- a/mods/PLAYER/mcl_wieldview/mod.conf +++ b/mods/PLAYER/mcl_wieldview/mod.conf @@ -1,4 +1,4 @@ name = mcl_wieldview author = stujones11 description = Makes hand wielded items visible to other players. -depends = mcl_player +depends = mcl_armor, mcl_playerplus diff --git a/settingtypes.txt b/settingtypes.txt index dca03b7e1..077f76c85 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -51,6 +51,10 @@ mcl_showDeathMessages (Show death messages) bool true # If disabled, all recipes will be shown. mcl_craftguide_progressive_mode (Learn crafting recipes progressively) bool true +# Limit the number of sparks produced by lava per 5 seconds to this number. +# 0 will disable lava sparks altogeter with no ABM being registered. +mcl_core_lava_spark_limit (Number of sparks lava can produce per 5 seconds) int 10 + [Mobs] # If enabled, mobs will spawn naturally. This does not affect # affect mob spawners. @@ -97,9 +101,6 @@ fire_animation_frames (Fire Animation Frames) int 8 # Whether to animate chests when open / close animated_chests (Animated chests) bool true -# Whether to preview the player in inventory in 3D (requires Minetest 5.4) -3d_player_preview (3D Player preview) bool true - # The maximum number of boss bars to simultaniously display on the screen max_bossbars (Maximum Boss bars) int 5 @@ -165,6 +166,20 @@ kick_cheaters (Kick Cheaters) bool false # Cheat kicking threshold kick_threshold (Cheat Kicking Threshold) int 10 +[Antispam] +# Maximum player messages in a sequence +limit_messages (Maximum player messages in a sequence) int 10 +# Maximum message length +limit_message_length (Maximum message length) int 200 +# Block special characters +block_special_chars (Block special characters) bool true +# Ban spammers +ban_spammers (Ban spammers) bool true +# Kick spammers +kick_spammers (Kick spammers) bool true +# Revoke shout priv for spammers +revoke_shout_for_spammers (Revoke shout priv for spammers) bool true + [Debugging] # If enabled, this will show the itemstring of an item in the description. mcl_item_id_debug (Item ID Debug) bool false diff --git a/tools/create_texture__mcl_end_crystal_beam.py b/tools/create_texture__mcl_end_crystal_beam.py new file mode 100644 index 000000000..ab2166714 --- /dev/null +++ b/tools/create_texture__mcl_end_crystal_beam.py @@ -0,0 +1,28 @@ +import png +from random import randrange + +w, h = 16, 256; + +s = [[int(0) for c in range(w)] for c in range(h)] + +def drawpixel(x, y, t): + if (x >= 0) and (x < w) and (y >= 0) and (y < h): + s[y][x] = t + +# R, G, B, Alpha (0xFF = opaque): +palette=[ + (0x00,0x00,0x00,0x00), + (0xFF,0xFF,0x70,0xCC), + (0xFF,0x80,0xDF,0xCC), + (0x80,0xFF,0xDF,0xCC) +] + +for x in range(w): + for y in range(h): + n = randrange(4) + if n == 1: + drawpixel(x, y, randrange(3) + 1) + +w = png.Writer(len(s[0]), len(s), palette=palette, bitdepth=2) +f = open('mcl_end_crystal_beam.png', 'wb') +w.write(f, s) diff --git a/tools/texture_editor.py b/tools/texture_editor.py new file mode 100644 index 000000000..1407df5ea --- /dev/null +++ b/tools/texture_editor.py @@ -0,0 +1,154 @@ +from http.server import BaseHTTPRequestHandler, HTTPServer +from pathlib import Path +import pprint +import time +import glob +import os + +hostName = "localhost" +serverPort = 8080 + +paths = {} + +def dump(obj): + s = '' + for attr in dir(obj): + s = s + "obj.%s = %r" % (attr, getattr(obj, attr)) + "\n" + return s + +def get_png(path): + if path in paths: + return Path(pahts[path]).read_bytes() + for file in glob.glob("../**/" + path, recursive = True): + paths[path] = file + return Path(file).read_bytes() + return + +def scan(): + for file in glob.glob("../**/*.png", recursive = True): + basename = os.path.basename(file) + if basename in paths: + print("Duplicate texture name, please fix:\n * %s:\n - %s\n - %s\n" % (basename, paths[basename], file)) + else: + paths[basename] = file + +def color_picker(): + return """ + +
+ + + """ + + +def get_html(path): + content = "

Request: %s

" % path + content += "" + content += color_picker() + content += "
    Texture List:" + for key, value in paths.items(): + content += "
  • %s
  • " % (key, key) + content += "
" + content += "" + return content + +class MyServer(BaseHTTPRequestHandler): + def do_GET(self): + path = self.path + if path.endswith(".png"): + content = get_png(path) + self.send_response(200) + self.send_header("Content-type", "image/png") + self.end_headers() + self.wfile.write(content) + else: + content = get_html(path) + self.send_response(200) + self.send_header("Content-type", "text/html") + self.end_headers() + self.wfile.write(bytes(content, "utf-8")) + +if __name__ == "__main__": + scan() + webServer = HTTPServer((hostName, serverPort), MyServer) + print("Server started http://%s:%s" % (hostName, serverPort)) + + try: + webServer.serve_forever() + except KeyboardInterrupt: + pass + + webServer.server_close() + print("Server stopped.") diff --git a/tools/update_credits.sh b/tools/update_credits.sh new file mode 100755 index 000000000..4c746bf2c --- /dev/null +++ b/tools/update_credits.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# + +TMP_FILE=$(mktemp /tmp/mcl5.XXXXXXXX) + +git --version 2>/dev/null 1>/dev/null +IS_GIT_AVAILABLE=$? +if [ $IS_GIT_AVAILABLE -ne 0 ]; then + echo "Please install git!\n\n" +fi + +`git log --pretty="%an" 1>$TMP_FILE 2>/dev/null` +IS_GIT_REPO=$? +if [ $IS_GIT_REPO -ne 0 ]; then + echo "You have to be inside a git repo to update CONTRUBUTOR_LIST.txt\n\n" +fi + +# Edit names here: +sed -i 's/nikolaus-albinger/Niklp/g' $TMP_FILE + +cat $TMP_FILE | sort | uniq >../mods/HUD/mcl_credits/CONTRUBUTOR_LIST.txt