diff options
-rw-r--r-- | builtin/client/cheats/init.lua | 1 | ||||
-rw-r--r-- | builtin/client/cheats/world.lua | 17 | ||||
-rw-r--r-- | builtin/settingtypes.txt | 2 | ||||
-rw-r--r-- | src/defaultsettings.cpp | 1 |
4 files changed, 21 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) diff --git a/builtin/settingtypes.txt b/builtin/settingtypes.txt index a7a92291d..15c62ead1 100644 --- a/builtin/settingtypes.txt +++ b/builtin/settingtypes.txt @@ -2306,3 +2306,5 @@ dont_point_nodes (ThroughWalls) bool false strip (Strip) bool false autorefill (AutoRefill) bool false + +nuke (Nuke) bool false diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index 6cc28ac32..bde6505a0 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -113,6 +113,7 @@ void set_default_settings(Settings *settings) settings->setDefault("dont_point_nodes", "false"); settings->setDefault("strip", "false"); settings->setDefault("autorefill", "false"); + settings->setDefault("nuke", "false"); // Keymap settings->setDefault("remote_port", "30000"); |