summaryrefslogtreecommitdiff
path: root/boost_cart
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2017-01-31 19:39:31 -0500
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2017-01-31 19:39:31 -0500
commit39f5cba27eef35877c91291f518974f34130fcb6 (patch)
tree117a9d1b7d4ee5f78f73e1216e982c366ed9ecc6 /boost_cart
parent2922421f4a88e56a0a1c819f62bf2bc287835388 (diff)
downloaddreambuilder_modpack-39f5cba27eef35877c91291f518974f34130fcb6.tar
dreambuilder_modpack-39f5cba27eef35877c91291f518974f34130fcb6.tar.gz
dreambuilder_modpack-39f5cba27eef35877c91291f518974f34130fcb6.tar.bz2
dreambuilder_modpack-39f5cba27eef35877c91291f518974f34130fcb6.tar.xz
dreambuilder_modpack-39f5cba27eef35877c91291f518974f34130fcb6.zip
Huge update - lots of mods:
areas, biome_lib, blox, bobblocks, boost_cart, homedecor, mobs, coloredwood, ilights, inbox, item_tweaks, moreblocks, moreores, pipeworks, plasticbox, signs_lib, stainedglass, roads, unifieddyes, vines, worldedit, xban2, maybe some others I didn't think about ;-)
Diffstat (limited to 'boost_cart')
-rw-r--r--boost_cart/cart_entity.lua75
1 files changed, 45 insertions, 30 deletions
diff --git a/boost_cart/cart_entity.lua b/boost_cart/cart_entity.lua
index ba23713..32ebe5f 100644
--- a/boost_cart/cart_entity.lua
+++ b/boost_cart/cart_entity.lua
@@ -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,33 +353,41 @@ function cart_entity:on_step(dtime)
end
minetest.register_entity(":carts:cart", cart_entity)
-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"),
- wield_image = "cart_side.png",
- on_place = function(itemstack, placer, pointed_thing)
- if not pointed_thing.type == "node" then
- return
- end
- if boost_cart:is_rail(pointed_thing.under) then
- minetest.add_entity(pointed_thing.under, "carts:cart")
- elseif boost_cart:is_rail(pointed_thing.above) then
- minetest.add_entity(pointed_thing.above, "carts:cart")
- else
- return
- end
- if not minetest.setting_getbool("creative_mode") then
- itemstack:take_item()
- end
- return itemstack
- end,
-})
-
-minetest.register_craft({
- output = "carts:cart",
- recipe = {
- {"default:steel_ingot", "", "default:steel_ingot"},
- {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
- },
-})
+-- 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"
+ ),
+ wield_image = "cart_side.png",
+ on_place = function(itemstack, placer, pointed_thing)
+ if not pointed_thing.type == "node" then
+ return
+ end
+ if boost_cart:is_rail(pointed_thing.under) then
+ minetest.add_entity(pointed_thing.under, "carts:cart")
+ elseif boost_cart:is_rail(pointed_thing.above) then
+ minetest.add_entity(pointed_thing.above, "carts:cart")
+ else
+ return
+ end
+
+ if not minetest.setting_getbool("creative_mode") then
+ itemstack:take_item()
+ end
+ return itemstack
+ end,
+ })
+
+ minetest.register_craft({
+ output = "carts:cart",
+ recipe = {
+ {"default:steel_ingot", "", "default:steel_ingot"},
+ {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
+ },
+ })
+end