Add boat item
This commit is contained in:
parent
bce4924cfe
commit
7be68e35f2
@ -144,7 +144,7 @@ minetest.register_entity("boat:boat", {
|
||||
local node_above = minetest.get_node(vector.new(pos.x,pos.y+1,pos.z)).name
|
||||
local goalx = 0
|
||||
local goalz = 0
|
||||
print(node_above)
|
||||
--print(node_above)
|
||||
if (node == "main:waterflow" or node == "main:water" ) and not self.moving == true and (node_above ~= "main:water" and node_above ~= "main:waterflow") then
|
||||
local currentvel = self.object:getvelocity()
|
||||
local level = minetest.get_node_level(pos)
|
||||
@ -193,3 +193,33 @@ minetest.register_entity("boat:boat", {
|
||||
self.slowdown(self)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_craftitem("boat:boat", {
|
||||
description = "Boat",
|
||||
inventory_image = "boatitem.png",
|
||||
wield_image = "boatitem.png",
|
||||
liquids_pointable = true,
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return
|
||||
end
|
||||
|
||||
if minetest.get_item_group(minetest.get_node(pointed_thing.under).name, "water")>0 then
|
||||
minetest.add_entity(pointed_thing.under, "boat:boat")
|
||||
else
|
||||
return
|
||||
end
|
||||
|
||||
itemstack:take_item()
|
||||
|
||||
return itemstack
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "boat:boat",
|
||||
recipe = {
|
||||
{"main:wood", "", "main:wood"},
|
||||
{"main:wood", "main:wood", "main:wood"},
|
||||
},
|
||||
})
|
||||
|
BIN
mods/boat/textures/boatitem.png
Normal file
BIN
mods/boat/textures/boatitem.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 265 B |
Loading…
x
Reference in New Issue
Block a user