diff --git a/overrides.lua b/overrides.lua index c19da30..8a6ed72 100644 --- a/overrides.lua +++ b/overrides.lua @@ -179,109 +179,3 @@ minetest.register_craft({ recipe = "default:stick", burntime = 2, }) - --------------------------------------------------- ---ADD WOOD SLABWOOD, TREES AND STICKS TO WOOD PILE --------------------------------------------------- -minetest.override_item("default:wood", { - groups = {wood_pile=1, wood = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, -}) - -minetest.override_item("default:aspen_wood", { - groups = {wood_pile=1, wood = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, -}) - -minetest.override_item("default:junglewood", { - groups = {wood_pile=1, wood = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, -}) - -minetest.override_item("default:acacia_wood", { - groups = {wood_pile=1, wood = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, -}) - -minetest.override_item("default:pine_wood", { - groups = {wood_pile=1, wood = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, -}) -minetest.override_item("stairs:slab_wood", { - groups = {wood_pile=1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, -}) - -minetest.override_item("stairs:slab_aspen_wood", { - groups = {wood_pile=1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, -}) - -minetest.override_item("stairs:slab_junglewood", { - groups = {wood_pile=1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, -}) - -minetest.override_item("stairs:slab_acacia_wood", { - groups = {wood_pile=1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, -}) - -minetest.override_item("stairs:slab_pine_wood", { - groups = {wood_pile=1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, -}) - -minetest.override_item("default:tree", { - groups = {wood_pile=1, tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, -}) - -minetest.override_item("default:aspen_tree", { - groups = {wood_pile=1, tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, -}) - -minetest.override_item("default:jungletree", { - groups = {wood_pile=1, tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, -}) - -minetest.override_item("default:acacia_tree", { - groups = {wood_pile=1, tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, -}) - -minetest.override_item("default:pine_tree", { - groups = {wood_pile=1, tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, -}) - -minetest.override_item("default:stick", { - groups = {wood_pile=1, stick = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, -}) - -minetest.override_item("stairs:slab_wood", { - groups = {wood_pile=1, stick = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, -}) - -minetest.override_item("stairs:slab_aspen_wood", { - groups = {wood_pile=1, stick = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, -}) - -minetest.override_item("stairs:slab_junglewood", { - groups = {wood_pile=1, stick = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, -}) - -minetest.override_item("stairs:slab_acacia_wood", { - groups = {wood_pile=1, stick = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, -}) - -minetest.override_item("stairs:slab_pine_wood", { - groups = {wood_pile=1, stick = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, -}) - -minetest.override_item("stairs:stair_wood", { - groups = {wood_pile=1, stick = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, -}) - -minetest.override_item("stairs:stair_aspen_wood", { - groups = {wood_pile=1, stick = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, -}) - -minetest.override_item("stairs:stair_junglewood", { - groups = {wood_pile=1, stick = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, -}) - -minetest.override_item("stairs:stair_acacia_wood", { - groups = {wood_pile=1, stick = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, -}) - -minetest.override_item("stairs:stair_pine_wood", { - groups = {wood_pile=1, stick = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, -}) diff --git a/woodpile.lua b/woodpile.lua index 1024ed1..f9e1e52 100644 --- a/woodpile.lua +++ b/woodpile.lua @@ -52,12 +52,7 @@ minetest.register_node("bbq:woodpile", { local inv = minetest.get_meta(pos):get_inventory() return inv:is_empty("bbq") end, - allow_metadata_inventory_put = function(pos, listname, index, stack, player) - if minetest.get_item_group(stack:get_name(), "wood_pile") ~= 0 then - return stack:get_count() - end - return 0 - end, + on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) minetest.log("action", player:get_player_name() .. " moves stuff in bbq woodpile at ".. minetest.pos_to_string(pos)) @@ -105,12 +100,7 @@ minetest.register_node("bbq:woodpile_acacia", { local inv = minetest.get_meta(pos):get_inventory() return inv:is_empty("bbq") end, - allow_metadata_inventory_put = function(pos, listname, index, stack, player) - if minetest.get_item_group(stack:get_name(), "wood_pile") ~= 0 then - return stack:get_count() - end - return 0 - end, + on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) minetest.log("action", player:get_player_name() .. " moves stuff in bbq woodpile at ".. minetest.pos_to_string(pos)) @@ -158,12 +148,7 @@ minetest.register_node("bbq:woodpile_pine", { local inv = minetest.get_meta(pos):get_inventory() return inv:is_empty("bbq") end, - allow_metadata_inventory_put = function(pos, listname, index, stack, player) - if minetest.get_item_group(stack:get_name(), "wood_pile") ~= 0 then - return stack:get_count() - end - return 0 - end, + on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) minetest.log("action", player:get_player_name() .. " moves stuff in bbq woodpile at ".. minetest.pos_to_string(pos)) @@ -211,12 +196,7 @@ minetest.register_node("bbq:woodpile_junglewood", { local inv = minetest.get_meta(pos):get_inventory() return inv:is_empty("bbq") end, - allow_metadata_inventory_put = function(pos, listname, index, stack, player) - if minetest.get_item_group(stack:get_name(), "wood_pile") ~= 0 then - return stack:get_count() - end - return 0 - end, + on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) minetest.log("action", player:get_player_name() .. " moves stuff in bbq woodpile at ".. minetest.pos_to_string(pos)) @@ -264,12 +244,7 @@ minetest.register_node("bbq:woodpile_aspen", { local inv = minetest.get_meta(pos):get_inventory() return inv:is_empty("bbq") end, - allow_metadata_inventory_put = function(pos, listname, index, stack, player) - if minetest.get_item_group(stack:get_name(), "wood_pile") ~= 0 then - return stack:get_count() - end - return 0 - end, + on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) minetest.log("action", player:get_player_name() .. " moves stuff in bbq woodpile at ".. minetest.pos_to_string(pos))