Skip to content

Commit

Permalink
prevent towers of papyrus/bamboo being auto-dug
Browse files Browse the repository at this point in the history
  • Loading branch information
OgelGames committed Feb 4, 2021
1 parent f6325a9 commit 226e87b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ unused_args = false
globals = {
"minetest",
"pandorabox",
"default",
"travelnet",
"sethome",
"jumpdrive",
Expand Down Expand Up @@ -33,7 +34,7 @@ read_globals = {
"dump", "screwdriver",

-- Deps
"default", "advtrains",
"advtrains",
"letters", "player_monoids",
"pipeworks", "planetoidgen",
"xban"
Expand Down
14 changes: 14 additions & 0 deletions hacks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,17 @@ if minetest.get_modpath("digistuff") and minetest.registered_nodes["digistuff:ni
}
})
end

-- prevent big towers of papyrus and bamboo from being auto-dug
-- https://github.com/pandorabox-io/pandorabox.io/issues/611
function default.dig_up(pos, node, digger)
if digger == nil then return end
local np = {x = pos.x, y = pos.y + 1, z = pos.z}
local nn = minetest.get_node(np)
if nn.name == node.name then
local dp = digger:get_pos()
if (np.y - dp.y) <= 10 then
minetest.node_dig(np, nn, digger)
end
end
end

0 comments on commit 226e87b

Please sign in to comment.