forked from mtcontrib/boost_cart
Use MTG cart model and textures in compability mode
This commit is contained in:
parent
99d0480169
commit
71af46f027
@ -37,6 +37,12 @@ local cart_entity = {
|
||||
attached_items = {}
|
||||
}
|
||||
|
||||
-- Model and textures
|
||||
if boost_cart.mtg_compat then
|
||||
cart_entity.mesh = "carts_cart.b3d"
|
||||
cart_entity.textures = {"carts_cart.png"}
|
||||
end
|
||||
|
||||
function cart_entity:on_rightclick(clicker)
|
||||
if not clicker or not clicker:is_player() then
|
||||
return
|
||||
@ -109,8 +115,9 @@ function cart_entity:on_punch(puncher, time_from_last_punch, tool_capabilities,
|
||||
|
||||
local leftover = puncher:get_inventory():add_item("main", "carts:cart")
|
||||
if not leftover:is_empty() then
|
||||
minetest.add_item(self.object:getpos(), leftover)
|
||||
minetest.add_item(pos, leftover)
|
||||
end
|
||||
|
||||
self.object:remove()
|
||||
return
|
||||
end
|
||||
@ -346,9 +353,16 @@ function cart_entity:on_step(dtime)
|
||||
end
|
||||
|
||||
minetest.register_entity(":carts:cart", cart_entity)
|
||||
|
||||
-- Register item to place the entity
|
||||
if not boost_cart.mtg_compat then
|
||||
minetest.register_craftitem(":carts:cart", {
|
||||
description = "Cart (Sneak+Click to pick up)",
|
||||
inventory_image = minetest.inventorycube("cart_top.png", "cart_side.png", "cart_side.png"),
|
||||
inventory_image = minetest.inventorycube(
|
||||
"cart_top.png",
|
||||
"cart_side.png",
|
||||
"cart_side.png"
|
||||
),
|
||||
wield_image = "cart_side.png",
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
@ -376,3 +390,4 @@ minetest.register_craft({
|
||||
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
|
||||
},
|
||||
})
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user