Add recipes.
This commit is contained in:
parent
6670bd23bc
commit
eb4eb919d0
@ -14,3 +14,8 @@ CC BY-SA 4.0 - check LICENSE file
|
||||
Copyright (c) 2022 SFENCE (CC BY-SA 4.0):
|
||||
All textures not mentioned below.
|
||||
|
||||
Copyright (c) 2022 Sinki (CC BY-SA 4.0):
|
||||
|
||||
* chair_lift_seet.we
|
||||
* chair_lift_seet_inv.png
|
||||
|
||||
|
@ -28,7 +28,7 @@ local chair_entity = {
|
||||
visual = "mesh",
|
||||
mesh = "chair_lift_seat.obj",
|
||||
visual_size = {x=1,y=1,z=1},
|
||||
textures = {"chair_lift_chair.png"},
|
||||
textures = {"chair_lift_seet.png"},
|
||||
},
|
||||
driver = nil,
|
||||
prev_pos = nil,
|
||||
@ -80,7 +80,7 @@ end
|
||||
function chair_entity:on_punch(puncher)
|
||||
if self.driver==nil then
|
||||
local inv = puncher:get_inventory()
|
||||
inv:add_item("main", ItemStack("chair_lift:chair"))
|
||||
inv:add_item("main", ItemStack("chair_lift:seet"))
|
||||
self.object:remove()
|
||||
end
|
||||
end
|
||||
@ -237,11 +237,11 @@ function chair_entity:on_step(dtime)
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_entity("chair_lift:chair", chair_entity)
|
||||
minetest.register_entity("chair_lift:seet", chair_entity)
|
||||
|
||||
minetest.register_craftitem("chair_lift:chair", {
|
||||
description = S("Chair Lift Chair"),
|
||||
inventory_image = "chair_lift_chair_inv.png",
|
||||
minetest.register_craftitem("chair_lift:seet", {
|
||||
description = S("Chair Lift Seet"),
|
||||
inventory_image = "chair_lift_seet_inv.png",
|
||||
|
||||
on_place = function (itemstack, placer, pointed_thing)
|
||||
if pointed_thing.type~="node" then
|
||||
@ -256,8 +256,8 @@ minetest.register_craftitem("chair_lift:chair", {
|
||||
end
|
||||
|
||||
pos = vector.add(pos, chair_pos_offset)
|
||||
print("Chair to pos: "..minetest.pos_to_string(pos))
|
||||
minetest.add_entity(pos, "chair_lift:chair")
|
||||
--print("Chair to pos: "..minetest.pos_to_string(pos))
|
||||
minetest.add_entity(pos, "chair_lift:seet")
|
||||
|
||||
itemstack:take_item()
|
||||
return itemstack
|
||||
|
92
crafting.lua
Normal file
92
crafting.lua
Normal file
@ -0,0 +1,92 @@
|
||||
|
||||
local items = {
|
||||
steel_wire = "basic_materials:steel_wire",
|
||||
empty_spool = "basic_materials:empty_spool",
|
||||
steel_block = "default:steelblock",
|
||||
wheel_ingot = "default:steel_ingot",
|
||||
}
|
||||
|
||||
if minetest.get_modpath("technic") then
|
||||
items.steel_block = "technic:carbon_steel_block"
|
||||
items.wheel_ingot = "technic:stainless_steel_ingot"
|
||||
end
|
||||
|
||||
if minetest.get_modpath("hades_extramaterials") then
|
||||
items.steel_wire = "hades_extramaterials:steel_wire"
|
||||
end
|
||||
|
||||
if minetest.get_modpath("hades_technic") then
|
||||
items.steel_block = "hades_technic:carbon_steel_block"
|
||||
items.wheel_ingot = "hades_technic:stainless_steel_ingot"
|
||||
end
|
||||
|
||||
minetest.register_craft({
|
||||
output = "chair_lift:steel_rope 2",
|
||||
recipe = {
|
||||
{items.steel_wire,items.steel_wire},
|
||||
{items.steel_wire,items.steel_wire},
|
||||
{items.steel_wire,items.steel_wire},
|
||||
},
|
||||
replacements = {
|
||||
{items.steel_wire,items.empty_spool},
|
||||
{items.steel_wire,items.empty_spool},
|
||||
{items.steel_wire,items.empty_spool},
|
||||
{items.steel_wire,items.empty_spool},
|
||||
{items.steel_wire,items.empty_spool},
|
||||
{items.steel_wire,items.empty_spool},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "chair_lift:pole_body 9",
|
||||
recipe = {
|
||||
{items.steel_block, items.steel_block},
|
||||
{items.steel_block, items.steel_block},
|
||||
{items.steel_block, items.steel_block},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "chair_lift:pole_arm 9",
|
||||
recipe = {
|
||||
{items.steel_block},
|
||||
{items.steel_block},
|
||||
{items.steel_block},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "chair_lift:wheel_part",
|
||||
recipe = {
|
||||
{"",items.wheel_ingot,""},
|
||||
{items.wheel_ingot,"",items.wheel_ingot},
|
||||
{"",items.wheel_ingot,""},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "chair_lift:rope_wheel",
|
||||
recipe = {
|
||||
{"chair_lift:wheel_part"},
|
||||
{items.wheel_ingot},
|
||||
{"chair_lift:wheel_part"},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "chair_lift:pole_arm_end",
|
||||
recipe = {
|
||||
{"","chair_lift:pole_arm",""},
|
||||
{"chair_lift:rope_wheel","power_generators:shaft","chair_lift:rope_wheel"}
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "chair_lift:wheel_powered",
|
||||
recipe = {
|
||||
{"chair_lift:pole_arm"},
|
||||
{"power_generators:shaft"},
|
||||
{"chair_lift:rope_wheel"},
|
||||
},
|
||||
})
|
||||
|
12
craftitems.lua
Normal file
12
craftitems.lua
Normal file
@ -0,0 +1,12 @@
|
||||
|
||||
local S = chair_lift.translator
|
||||
|
||||
minetest.register_craftitem("chair_lift:wheel_part", {
|
||||
description = S("Part of Wheel for Steel Rope"),
|
||||
inventory_image = "chair_lift_wheel_part.png",
|
||||
})
|
||||
|
||||
minetest.register_craftitem("chair_lift:rope_wheel", {
|
||||
description = S("Wheel for Steel Rope"),
|
||||
inventory_image = "chair_lift_rope_wheel.png",
|
||||
})
|
3
init.lua
3
init.lua
@ -12,3 +12,6 @@ dofile(modpath.."/steel_rope.lua")
|
||||
dofile(modpath.."/powered_wheel.lua")
|
||||
dofile(modpath.."/chair_lift_entity.lua")
|
||||
|
||||
dofile(modpath.."/craftitems.lua")
|
||||
dofile(modpath.."/crafting.lua")
|
||||
|
||||
|
4
mod.conf
4
mod.conf
@ -1,5 +1,5 @@
|
||||
name = chair_lift
|
||||
title = Chair lift
|
||||
description = Add craftable and usable charit lift.
|
||||
depends = appliances
|
||||
optional_depends = default, player_api, hades_core, hades_sounds, hades_player, screwdriver, sounds, technic, hades_technic
|
||||
depends = appliances, power_generators
|
||||
optional_depends = default, player_api, hades_core, hades_sounds, hades_player, screwdriver, sounds, basic_materials, hades_extramaterials, technic, hades_technic
|
||||
|
BIN
textures/chair_lift_rope_wheel.png
Normal file
BIN
textures/chair_lift_rope_wheel.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 208 B |
BIN
textures/chair_lift_wheel_part.png
Normal file
BIN
textures/chair_lift_wheel_part.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 169 B |
Loading…
x
Reference in New Issue
Block a user