Minor fixes

master
Maksim 2019-05-20 14:28:58 +02:00
parent 13a51e96f6
commit 746663dcb9
4 changed files with 25 additions and 21 deletions

View File

@ -656,3 +656,8 @@ function core.pointed_thing_to_face_pos(placer, pointed_thing)
end
return fine_pos
end
-- Allow mods to define a platform.
function core.get_platform()
return PLATFORM
end

View File

@ -501,27 +501,26 @@ end
function core.item_eat(hp_change, replace_with_item)
return function(itemstack, user, pointed_thing) -- closure
if user then
local pos = user:getpos()
pos.y = pos.y + 1.5
local itemname = itemstack:get_name()
local texture = minetest.registered_items[itemname].inventory_image
minetest.add_item(pos, drop)
minetest.add_particlespawner({
amount = 10,
time = 0.1,
minpos = {x = pos.x, y = pos.y, z = pos.z},
maxpos = {x = pos.x, y = pos.y, z = pos.z},
minvel = {x = -1, y = 1, z = -1},
maxvel = {x = 1, y = 2, z = 1},
minacc = {x = 0, y = -5, z = 0},
maxacc = {x = 0, y = -9, z = 0},
minexptime = 1,
maxexptime = 1,
minsize = 1,
maxsize = 2,
collisiondetection = true,
vertical = false,
texture = texture,
local pos = user:getpos()
pos.y = pos.y + 1.5
local itemname = itemstack:get_name()
local texture = minetest.registered_items[itemname].inventory_image
minetest.add_particlespawner({
amount = 20,
time = 0.1,
minpos = {x = pos.x, y = pos.y, z = pos.z},
maxpos = {x = pos.x, y = pos.y, z = pos.z},
minvel = {x = -1, y = 1, z = -1},
maxvel = {x = 1, y = 2, z = 1},
minacc = {x = 0, y = -5, z = 0},
maxacc = {x = 0, y = -9, z = 0},
minexptime = 1,
maxexptime = 1,
minsize = 1,
maxsize = 1,
collisiondetection = true,
vertical = false,
texture = texture,
})
return core.do_item_eat(hp_change, replace_with_item, itemstack, user, pointed_thing)
end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 204 B

After

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 484 B

After

Width:  |  Height:  |  Size: 466 B