diff --git a/README.md b/README.md index 24d058e..e7dde3b 100644 --- a/README.md +++ b/README.md @@ -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 + diff --git a/chair_lift_entity.lua b/chair_lift_entity.lua index d88e956..7a6bd89 100644 --- a/chair_lift_entity.lua +++ b/chair_lift_entity.lua @@ -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 diff --git a/crafting.lua b/crafting.lua new file mode 100644 index 0000000..b2ffa67 --- /dev/null +++ b/crafting.lua @@ -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"}, + }, + }) + diff --git a/craftitems.lua b/craftitems.lua new file mode 100644 index 0000000..edb2eaf --- /dev/null +++ b/craftitems.lua @@ -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", + }) diff --git a/init.lua b/init.lua index fe9f82e..1786c28 100644 --- a/init.lua +++ b/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") + diff --git a/mod.conf b/mod.conf index c24992a..3bb08f5 100644 --- a/mod.conf +++ b/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 diff --git a/textures/chair_lift_rope_wheel.png b/textures/chair_lift_rope_wheel.png new file mode 100644 index 0000000..006f204 Binary files /dev/null and b/textures/chair_lift_rope_wheel.png differ diff --git a/textures/chair_lift_wheel_part.png b/textures/chair_lift_wheel_part.png new file mode 100644 index 0000000..bbdf62c Binary files /dev/null and b/textures/chair_lift_wheel_part.png differ