Vehicles mod updated to latest Minetest revision
(still needs some cleanup)
This commit is contained in:
parent
97504016e2
commit
40ebbc0b1c
@ -123,6 +123,9 @@ function cart:on_step(dtime)
|
|||||||
z = self.moving.z - pos_f.z}
|
z = self.moving.z - pos_f.z}
|
||||||
needed = resize(needed, math.min(length(needed), speed))
|
needed = resize(needed, math.min(length(needed), speed))
|
||||||
self.object:setpos(move(pos_f, needed))
|
self.object:setpos(move(pos_f, needed))
|
||||||
|
-- move player that attached to this cart; FIXME
|
||||||
|
local player = minetest.env:get_player_by_name(self.attached_to)
|
||||||
|
player:setpos(self.object:getpos())
|
||||||
end
|
end
|
||||||
|
|
||||||
return
|
return
|
||||||
@ -194,11 +197,6 @@ function cart:on_step(dtime)
|
|||||||
|
|
||||||
-- if not moved - stop
|
-- if not moved - stop
|
||||||
self.attached_to = false
|
self.attached_to = false
|
||||||
|
|
||||||
-- move player that attached to this cart; FIXME
|
|
||||||
--local player = minetest.env:get_player_by_name(self.attached_to)
|
|
||||||
--print(self.attached_to)
|
|
||||||
--player:setpos(self.object:getpos())
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -233,7 +231,8 @@ function cart:on_punch(hitter)
|
|||||||
self.health = self.health - 1
|
self.health = self.health - 1
|
||||||
if self.health <= 0 then
|
if self.health <= 0 then
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
hitter:add_to_inventory("craft vehicles:cart 1")
|
hitter:get_inventory():add_item("main", "vehicles:cart 1")
|
||||||
|
return ""
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -244,17 +243,17 @@ end
|
|||||||
minetest.register_entity("vehicles:cart", cart)
|
minetest.register_entity("vehicles:cart", cart)
|
||||||
|
|
||||||
minetest.register_craftitem("vehicles:cart", {
|
minetest.register_craftitem("vehicles:cart", {
|
||||||
image = "vehicles_cart_inventory.png",
|
inventory_image = "vehicles_cart_inventory.png",
|
||||||
on_drop = function(item, dropper, pos)
|
on_drop = function(itemstack, dropper, pos)
|
||||||
minetest.env:add_entity({x = round(pos.x), y = round(pos.y), z = round(pos.z)}, "vehicles:cart")
|
minetest.env:add_entity({x = round(pos.x), y = round(pos.y), z = round(pos.z)}, "vehicles:cart")
|
||||||
return true
|
--return true
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'craft "vehicles:cart" 1',
|
output = '"vehicles:cart" 1',
|
||||||
recipe = {
|
recipe = {
|
||||||
{'craft "default:steel_ingot"', '', 'craft "default:steel_ingot"'},
|
{'default:steel_ingot', '', 'default:steel_ingot'},
|
||||||
{'craft "default:steel_ingot"', 'craft "default:steel_ingot"', 'craft "default:steel_ingot"'}
|
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user