Add snowball and egg to dispenser support

This commit is contained in:
Wuzzy 2017-02-14 23:54:06 +01:00
parent a9f2c705da
commit e672abd2ed
2 changed files with 10 additions and 1 deletions

View file

@ -24,7 +24,7 @@ mcl_throwing.throw = function(throw_item, pos, dir, velocity)
velocity = 22
end
local itemstring = throw_item:get_name()
local itemstring = ItemStack(throw_item):get_name()
local obj = minetest.add_entity(pos, entity_mapping[itemstring])
obj:setvelocity({x=dir.x*velocity, y=dir.y*velocity, z=dir.z*velocity})
obj:setacceleration({x=dir.x*-3, y=-GRAVITY, z=dir.z*-3})