From f5e528ef696b34793fffab539db55dc9be6d244e Mon Sep 17 00:00:00 2001 From: DonBatman Date: Tue, 17 May 2016 12:41:23 -0700 Subject: [PATCH 1/4] Fixed deprciated tile_images to tiles maxwear to uses = 60 Made fuction override local --- functions.lua | 6 +++--- nodes.lua | 6 +++--- shear.lua | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/functions.lua b/functions.lua index 3ac3ff7..e0a67d8 100644 --- a/functions.lua +++ b/functions.lua @@ -33,7 +33,7 @@ vines.register_vine = function( name, defs, biome ) paramtype = "light", paramtype2 = "wallmounted", buildable_to = true, - tile_images = { vine_image_end }, + tiles = { vine_image_end }, drawtype = drawtype, inventory_image = vine_image_end, groups = groups, @@ -71,7 +71,7 @@ vines.register_vine = function( name, defs, biome ) paramtype = "light", paramtype2 = "wallmounted", buildable_to = true, - tile_images = { vine_image_middle }, + tiles = { vine_image_middle }, wield_image = vine_image_middle, drawtype = drawtype, inventory_image = vine_image_middle, @@ -94,7 +94,7 @@ vines.register_vine = function( name, defs, biome ) biome_lib:spawn_on_surfaces( biome ) local override_nodes = function( nodes, defs ) - function override( index, registered ) + local function override( index, registered ) local node = nodes[ index ] if index > #nodes then return registered end if minetest.registered_nodes[node] then diff --git a/nodes.lua b/nodes.lua index ab14b28..9d7df00 100644 --- a/nodes.lua +++ b/nodes.lua @@ -2,7 +2,7 @@ minetest.register_node("vines:rope_block", { description = "Rope", sunlight_propagates = true, paramtype = "light", - tile_images = { + tiles = { "default_wood.png^vines_rope.png", "default_wood.png^vines_rope.png", "default_wood.png", @@ -36,7 +36,7 @@ minetest.register_node("vines:rope", { sunlight_propagates = true, paramtype = "light", drop = "", - tile_images = { "vines_rope.png" }, + tiles = { "vines_rope.png" }, drawtype = "plantlike", groups = {flammable=2, not_in_creative_inventory=1}, sounds = default.node_sound_leaves_defaults(), @@ -53,7 +53,7 @@ minetest.register_node("vines:rope_end", { sunlight_propagates = true, paramtype = "light", drop = "", - tile_images = { "vines_rope_end.png" }, + tiles = { "vines_rope_end.png" }, drawtype = "plantlike", groups = {flammable=2, not_in_creative_inventory=1}, sounds = default.node_sound_leaves_defaults(), diff --git a/shear.lua b/shear.lua index 996cfdc..2615335 100644 --- a/shear.lua +++ b/shear.lua @@ -8,8 +8,8 @@ minetest.register_tool("vines:shears", { full_punch_interval = 1.0, max_drop_level=0, groupcaps={ - snappy={times={[3]=0.2}, maxwear=0.05, maxlevel=3}, - wool={times={[3]=0.2}, maxwear=0.05, maxlevel=3} + snappy={times={[3]=0.2}, uses=60, maxlevel=3}, + wool={times={[3]=0.2}, uses=60, maxlevel=3} } }, }) From 66a7437c0970f7f5b318802449359c78b8c04f51 Mon Sep 17 00:00:00 2001 From: DonBatman Date: Tue, 17 May 2016 18:44:17 -0700 Subject: [PATCH 2/4] added groups to crafting fixed wield image --- recipes.lua | 6 +++--- shear.lua | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/recipes.lua b/recipes.lua index d2b928a..d64dcea 100644 --- a/recipes.lua +++ b/recipes.lua @@ -1,12 +1,12 @@ vines.recipes['rope_block'] = { - {'', 'default:wood', ''}, + {'', 'group:wood', ''}, {'', 'group:vines', ''}, {'', 'group:vines', ''} } vines.recipes['shears'] = { {'', 'default:steel_ingot', ''}, - {'default:stick', 'default:wood', 'default:steel_ingot'}, - {'', '', 'default:stick'} + {'group:stick', 'group:wood', 'default:steel_ingot'}, + {'', '', 'group:stick'} } diff --git a/shear.lua b/shear.lua index 2615335..b42a3e7 100644 --- a/shear.lua +++ b/shear.lua @@ -1,7 +1,7 @@ minetest.register_tool("vines:shears", { description = "Shears", inventory_image = "vines_shears.png", - wield_image = "shears.png", + wield_image = "vines_shears.png", stack_max = 1, max_drop_level=3, tool_capabilities = { From 400f6b856c701af59bacb8ca7bfe8186b156b826 Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Wed, 4 Jan 2017 19:11:41 +0000 Subject: [PATCH 3/4] Fix crash glitch with vine registry This simple change stops vines and roots from crashing client/servers by not making them buildable to. --- functions.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions.lua b/functions.lua index e0a67d8..69cc7c2 100644 --- a/functions.lua +++ b/functions.lua @@ -32,7 +32,7 @@ vines.register_vine = function( name, defs, biome ) sunlight_propagates = true, paramtype = "light", paramtype2 = "wallmounted", - buildable_to = true, + buildable_to = false, tiles = { vine_image_end }, drawtype = drawtype, inventory_image = vine_image_end, @@ -70,7 +70,7 @@ vines.register_vine = function( name, defs, biome ) sunlight_propagates = true, paramtype = "light", paramtype2 = "wallmounted", - buildable_to = true, + buildable_to = false, tiles = { vine_image_middle }, wield_image = vine_image_middle, drawtype = drawtype, From 7c68355f23c2700dd4eb467f9b6ad6f04e63b72c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Mart=C3=ADnez?= Date: Mon, 2 Jan 2017 22:00:08 -0300 Subject: [PATCH 4/4] Prevent two separate instances of stack overflow. The first one happens because `remove_node` is called directly, calling `remove_node` for the vine below, calling `remove_node` for the vine below, calling... The second one happens because `get_item_group` returns 0 for groups not set, and 0 is a truthy value in Lua, so the code always removes the bottom node regardless of its group rating. This interacted funnily with doors wanting to remove their top node, while vines wanted to remove their bottom nodes. --- functions.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/functions.lua b/functions.lua index e0a67d8..3bd4628 100644 --- a/functions.lua +++ b/functions.lua @@ -61,7 +61,6 @@ vines.register_vine = function( name, defs, biome ) end }) - minetest.register_node( vine_name_middle, { description = "Matured "..defs.description, walkable = false, @@ -83,7 +82,7 @@ vines.register_vine = function( name, defs, biome ) local bottom = {x=pos.x, y=pos.y-1, z=pos.z} local bottom_node = minetest.get_node( bottom ) if minetest.get_item_group( bottom_node.name, "vines") then - minetest.remove_node( bottom ) + minetest.after( 0, minetest.remove_node, bottom ) end end, after_dig_node = function( pos, node, oldmetadata, user )