forked from MineClone5/MineClone5
Merge MineClone2/master
This commit is contained in:
parent
9e114b03cf
commit
bc58e4a225
|
@ -202,21 +202,27 @@ minetest.register_abm({
|
||||||
interval = 1,
|
interval = 1,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||||
for _,object in pairs(minetest.get_objects_inside_radius(pos, 1)) do
|
for _, object in pairs(minetest.get_objects_inside_radius(pos, 0.9)) do
|
||||||
if not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "__builtin:item" then
|
if not object:is_player() then
|
||||||
object:remove()
|
local entity = object:get_luaentity()
|
||||||
elseif not object:is_player() and object:get_luaentity().name == "mcl_minecarts:minecart" then
|
if entity then
|
||||||
local pos = object:get_pos()
|
local entity_name = entity.name
|
||||||
local driver = object:get_luaentity()._driver
|
if entity_name == "__builtin:item" then
|
||||||
if driver ~= nil then
|
object:remove()
|
||||||
mcl_player.player_attached[driver] = nil
|
elseif entity_name == "mcl_minecarts:minecart" then
|
||||||
local player = minetest.get_player_by_name(driver)
|
local pos = object:get_pos()
|
||||||
player:set_detach()
|
local driver = entity._driver
|
||||||
player:set_eye_offset({x=0, y=0, z=0},{x=0, y=0, z=0})
|
if driver then
|
||||||
mcl_player.player_set_animation(player, "stand" , 30)
|
mcl_player.player_attached[driver] = nil
|
||||||
|
local player = minetest.get_player_by_name(driver)
|
||||||
|
player:set_detach()
|
||||||
|
player:set_eye_offset({x=0, y=0, z=0},{x=0, y=0, z=0})
|
||||||
|
mcl_player.player_set_animation(player, "stand" , 30)
|
||||||
|
end
|
||||||
|
minetest.add_item(pos, "mcl_minecarts:minecart")
|
||||||
|
object:remove()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
minetest.add_item(pos, "mcl_minecarts:minecart")
|
|
||||||
object:remove()
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
Loading…
Reference in New Issue