remove dig prediction from (most) nodes as an extra anti-glitch measure

master
flux 2020-08-29 00:48:17 +00:00
parent fe884a4523
commit 01a0376f7d
2 changed files with 15 additions and 0 deletions

View File

@ -53,6 +53,7 @@ dofile(bls.modpath .. "/node_inventory_protection.lua")
dofile(bls.modpath .. "/old_mod_cleanup.lua")
dofile(bls.modpath .. "/text_entry_logging.lua")
dofile(bls.modpath .. "/tnt.lua")
dofile(bls.modpath .. "/no_prediction.lua")
dofile(bls.modpath .. "/oregen.lua")
dofile(bls.modpath .. "/orienteering.lua")
dofile(bls.modpath .. "/remove_smartrenting.lua")

14
no_prediction.lua Normal file
View File

@ -0,0 +1,14 @@
-- remove dig prediction from any node that isn't doing something custom
-- prevents some forms of glitching-through-walls
-- might be annoying w/ lag though; need to test.
local function add_no_prediction()
for itemstring, def in pairs(minetest.registered_nodes) do
if def.node_dig_prediction == "air" or not def.node_dig_prediction then
minetest.override_item(itemstring, {
node_dig_prediction = ""
})
end
end
end
minetest.register_on_mods_loaded(add_no_prediction)