diff --git a/clientmods/crystalclear/init.lua b/clientmods/crystalclear/init.lua deleted file mode 100644 index d88f6c765..000000000 --- a/clientmods/crystalclear/init.lua +++ /dev/null @@ -1,30 +0,0 @@ -local fnd=false -local cpos={x=0,y=0,z=0} -local function find_crystal() - if fnd then return cpos end - for k, v in ipairs(minetest.localplayer.get_nearby_objects(100)) do - if ( v:get_item_textures():find("mcl_end_crystal")) then - cpos=v:get_pos() - fnd=true - return cpos - end - end -end - -minetest.register_globalstep(function() - if minetest.settings:get_bool("crystalclear") then - minetest.settings:set_bool('noclip',true) - minetest.settings:set_bool("pitch_move",true) - minetest.settings:set_bool("continuous_forward",true) - find_crystal() - autofly.aim(cpos) - core.set_keypress("special1", true) - end -end) - -minetest.register_on_death(function() - if not minetest.settings:get_bool("crystalclear") then return end - fnd=false -end) - -minetest.register_cheat("crystalClear", "Combat", "crystalclear") diff --git a/clientmods/crystalkamikaze/init.lua b/clientmods/crystalkamikaze/init.lua new file mode 100644 index 000000000..768f478a2 --- /dev/null +++ b/clientmods/crystalkamikaze/init.lua @@ -0,0 +1,31 @@ +local fnd=false +local cpos={x=0,y=0,z=0} +local function find_crystal() + if fnd then return cpos end + for k, v in ipairs(minetest.localplayer.get_nearby_objects(100)) do + if ( v:get_item_textures():find("mcl_end_crystal")) then + cpos=v:get_pos() + fnd=true + return true + end + end + return false +end + +minetest.register_globalstep(function() + if not minetest.settings:get_bool("crystalkamikaze") then return end + if not find_crystal() then return end + + minetest.settings:set_bool('noclip',true) + minetest.settings:set_bool("pitch_move",true) + minetest.settings:set_bool("continuous_forward",true) + autofly.aim(cpos) + core.set_keypress("special1", true) +end) + +minetest.register_on_death(function() + if not minetest.settings:get_bool("crystalkamikaze") then return end + fnd=false +end) + +minetest.register_cheat("CrystalKamikaze", "Combat", "crystalkamikaze") diff --git a/clientmods/mods.conf b/clientmods/mods.conf index 8854a1ffa..9245050b7 100644 --- a/clientmods/mods.conf +++ b/clientmods/mods.conf @@ -38,4 +38,4 @@ load_mod_autocraft = true load_mod_quint = true load_mod_automt = true load_mod_nlist = true -load_mod_crystalclear = true +load_mod_crystalkamikaze = true