add: crystalClear - suicide-clear endcrystals at spawn

wsc-master-rebase
cora 2020-11-28 01:39:24 +01:00 committed by Schmappie Eldress
parent 8155cf4ebc
commit 1603f86387
2 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,30 @@
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")

View File

@ -38,3 +38,4 @@ load_mod_autocraft = true
load_mod_quint = true
load_mod_automt = true
load_mod_nlist = true
load_mod_crystalclear = true