goddessmode: add shulker bullet

This commit is contained in:
cora 2021-01-06 17:22:08 +01:00
parent 5ae269db4a
commit af21479bc1

View File

@ -39,8 +39,11 @@ end
local function checkprojectile() local function checkprojectile()
for k, v in ipairs(minetest.localplayer.get_nearby_objects(karange)) do for k, v in ipairs(minetest.localplayer.get_nearby_objects(karange)) do
if ( v:get_item_textures():sub(-9) == "arrow_box") or ( v:get_item_textures():sub(-7) == "_splash") then if ( v:get_item_textures():sub(-9) == "arrow_box") or ( v:get_item_textures():sub(-7) == "_splash") or v:get_item_textures():sub(-17) == "shulkerbullet.png" then
local lp=minetest.localplayer:get_pos()
local vel=v:get_velocity() local vel=v:get_velocity()
local dst=vector.distance(lp,v:get_pos())
if dst > 2 then return false end
if (vel.x == 0 and vel.y == 0 and vel.z ==0 ) then return false end if (vel.x == 0 and vel.y == 0 and vel.z ==0 ) then return false end
return true return true
end end