diff options
Diffstat (limited to 'builtin/client/cheats')
-rw-r--r-- | builtin/client/cheats/init.lua | 1 | ||||
-rw-r--r-- | builtin/client/cheats/world.lua | 17 |
2 files changed, 18 insertions, 0 deletions
diff --git a/builtin/client/cheats/init.lua b/builtin/client/cheats/init.lua index c579f2b89..8d634a766 100644 --- a/builtin/client/cheats/init.lua +++ b/builtin/client/cheats/init.lua @@ -38,6 +38,7 @@ core.cheats = { ["BlockWater"] = "block_water", ["PlaceOnTop"] = "autotnt", ["Replace"] = "replace" + ["Nuke"] = "nuke" }, ["Exploit"] = { ["EntitySpeed"] = "entity_speed", diff --git a/builtin/client/cheats/world.lua b/builtin/client/cheats/world.lua index 5b97b206b..6cbdd67fc 100644 --- a/builtin/client/cheats/world.lua +++ b/builtin/client/cheats/world.lua @@ -48,6 +48,23 @@ core.register_globalstep(function(dtime) end end end + if core.settings:get_bool("nuke") then + local i = 0 + for x = pos.x - 5, pos.x + 5 do + for y = pos.y - 5, pos.y + 5 do + for z = pos.z - 5, pos.z + 5 do + local p = vector.new(x, y, z) + local node = core.get_node_or_nil(p) + local def = node and core.get_node_def(node.name) + if def and def.diggable then + if i > nodes_per_tick then return end + core.dig_node(p) + i = i + 1 + end + end + end + end + end end) |