1
0
mirror of https://github.com/HybridDog/nether-pack.git synced 2024-12-26 18:50:24 +01:00

smaller pearl

This commit is contained in:
HybridDog 2016-01-01 14:25:07 +01:00
parent 524312a8d3
commit 6b57e60e1b

View File

@ -24,15 +24,15 @@ end
local function get_node(pos)
local name = minetest.get_node(pos).name
if name == "ignore" then
if name ~= "ignore" then
return name
end
minetest.get_voxel_manip():read_from_map(pos, pos)
name = minetest.get_node_or_nil(pos)
if not name then
return
end
name = name.name
end
return name
return name.name
end
local softs = {}
@ -63,7 +63,6 @@ local function teleport_player(pos, player)
and nd3 then
pos.y = pos.y-1.4
player:moveto(pos)
pos.y = pos.y-0.6
return true
end
return false
@ -91,8 +90,8 @@ minetest.register_on_shutdown(function()
end)--]]
minetest.register_entity("nether:pearl_entity", {
timer = 0,
collisionbox = {0,0,0,0,0,0}, --not pointable
visual_size = {x=0.1, y=0.1},
physical = false, -- Collides with things
textures = {"nether_pearl.png"},
on_activate = function(self, staticdata)
@ -113,6 +112,7 @@ minetest.register_entity("nether:pearl_entity", {
player = self.player,
})
end,
timer = 0,
on_step = function(self, dtime)
self.timer = self.timer+dtime
@ -174,7 +174,7 @@ minetest.register_entity("nether:pearl_entity", {
minetest.sound_play("nether_pearl", {pos=p, max_hear_distance=10})
end, p)
p.y = p.y+1
if teleport_player(p, player) then
if teleport_player(vector.new(p), player) then
return
end
p.y = p.y-2