smaller pearl

This commit is contained in:
HybridDog 2016-01-01 14:25:07 +01:00
parent 524312a8d3
commit 6b57e60e1b
1 changed files with 11 additions and 11 deletions

View File

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