From e527f5c1c5e0c129614a74bd1b26ed8753d163d5 Mon Sep 17 00:00:00 2001 From: SFENCE Date: Sat, 30 Apr 2022 19:38:46 +0200 Subject: [PATCH] Fix issing textures and recipes. Small optimalizations. --- combustion_engine/combustion_engine_6.lua | 7 +- combustion_engine/craftitems.lua | 8 ++ combustion_engine/fuel_tank.lua | 3 + combustion_engine/gearbox.lua | 8 +- combustion_engine/init.lua | 2 + combustion_engine/starter_manual.lua | 2 +- crafting.lua | 86 +++++++++++++++++- generators/craftitems.lua | 4 + ...tors_combustion_engine_eight_cylinders.png | Bin 0 -> 162 bytes ...ators_combustion_engine_four_cylinders.png | Bin 0 -> 169 bytes ...rators_combustion_engine_six_cylinders.png | Bin 0 -> 165 bytes textures/power_generators_fuel_hosepipe.png | Bin 0 -> 192 bytes 12 files changed, 110 insertions(+), 10 deletions(-) create mode 100644 combustion_engine/craftitems.lua create mode 100644 textures/power_generators_combustion_engine_eight_cylinders.png create mode 100644 textures/power_generators_combustion_engine_four_cylinders.png create mode 100644 textures/power_generators_combustion_engine_six_cylinders.png create mode 100644 textures/power_generators_fuel_hosepipe.png diff --git a/combustion_engine/combustion_engine_6.lua b/combustion_engine/combustion_engine_6.lua index fca9000..eef062a 100644 --- a/combustion_engine/combustion_engine_6.lua +++ b/combustion_engine/combustion_engine_6.lua @@ -44,7 +44,7 @@ power_generators.combustion_engine_6c = appliances.appliance:new( node_name_active = "power_generators:combustion_engine_6c_active", node_description = S("Combustion engine"), - node_help = S("Fill it with liquid fuel.").."\n"..S("Use this for generate 150 unit of energy.").."\n"..S("Startup and Shutdown by punch."), + node_help = S("Can be greased.").."\n"..S("Use this for generate shaft power up to @1.", "283k").."\n"..S("Fuel supply open and close by punch.").."\n"..S("Place fuel tank on top."), input_stack_size = 0, have_input = false, @@ -57,7 +57,7 @@ power_generators.combustion_engine_6c = appliances.appliance:new( have_control = true, _shaft_sides = _shaft_sides, - _friction = 10, + _friction = 30, _I = 150, -- maxP per step is (maxT/I)*I _coef0 = -1768.3608*2.5, @@ -117,7 +117,8 @@ function combustion_engine_6c:get_formspec(meta, production_percent, consumption "background[-1.25,-1.25;8,10;appliances_appliance_formspec.png]" .. "scrollbaroptions[min=200;max=1200;smallstep=1;largestep=20]" .. bar .. - "label[1.5,8;"..minetest.formspec_escape(S("Throttle @1", throttle)).."]"; + "style_type[label;textcolor=black]" .. + "label[2,8;"..minetest.formspec_escape(S("Throttle @1%", math.round(throttle*100))).."]"; return formspec; end diff --git a/combustion_engine/craftitems.lua b/combustion_engine/craftitems.lua new file mode 100644 index 0000000..3ddf48c --- /dev/null +++ b/combustion_engine/craftitems.lua @@ -0,0 +1,8 @@ + +local S = power_generators.translator + +minetest.register_craftitem("power_generators:fuel_hosepipe", { + description = S("Fuel housepipe"), + inventory_image = "power_generators_fuel_hosepipe.png", + }) + diff --git a/combustion_engine/fuel_tank.lua b/combustion_engine/fuel_tank.lua index 5f76335..7038ac4 100644 --- a/combustion_engine/fuel_tank.lua +++ b/combustion_engine/fuel_tank.lua @@ -131,3 +131,6 @@ minetest.register_node("power_generators:fuel_tank", { update_info(pos, {name="power_generators:fuel_tank"}, meta) end, }) + +appliances.add_item_help("power_generators:fuel_tank", S("Fill it with liquid fuel by puncing.")) + diff --git a/combustion_engine/gearbox.lua b/combustion_engine/gearbox.lua index 6ee99b0..ff174ab 100644 --- a/combustion_engine/gearbox.lua +++ b/combustion_engine/gearbox.lua @@ -11,11 +11,11 @@ local _shaft_sides = {"front", "back", "top"} power_generators.ce_gearbox = appliances.appliance:new( { - node_name_inactive = "power_generators:ce_gearbox", - node_name_active = "power_generators:ce_gearbox_active", + node_name_inactive = "power_generators:gearbox", + node_name_active = "power_generators:gearbox_active", - node_description = S("Combustion engine gear box"), - node_help = S("Fill it with liquid fuel.").."\n"..S("Use this for generate 150 unit of energy.").."\n"..S("Startup and Shutdown by punch."), + node_description = S("Gearbox for Combustion Engine with External Starter"), + node_help = S("Can be greased.").."\n"..S("Change gear by punch (neutral/shaft/starter).").."\n"..S("Place starter on top."), input_stack_size = 0, have_input = false, diff --git a/combustion_engine/init.lua b/combustion_engine/init.lua index 30cc473..0cd8f4e 100644 --- a/combustion_engine/init.lua +++ b/combustion_engine/init.lua @@ -14,3 +14,5 @@ dofile(modpath.."/starter_manual.lua") dofile(modpath.."/adaptation.lua") +dofile(modpath.."/craftitems.lua") + diff --git a/combustion_engine/starter_manual.lua b/combustion_engine/starter_manual.lua index c67a951..8681938 100644 --- a/combustion_engine/starter_manual.lua +++ b/combustion_engine/starter_manual.lua @@ -31,7 +31,7 @@ power_generators.starter_manual = appliances.appliance:new( node_name_active = "power_generators:starter_manual_active", node_description = S("Combustion Engine Manual Starter"), - node_help = S("Fill it with liquid fuel.").."\n"..S("Use this for generate 150 unit of energy.").."\n"..S("Startup and Shutdown by punch."), + node_help = S("Can be greased.").."\n"..S("Crank up starter by punching."), input_stack_size = 0, have_input = false, diff --git a/crafting.lua b/crafting.lua index c559368..76a037f 100644 --- a/crafting.lua +++ b/crafting.lua @@ -23,6 +23,9 @@ local items = { glow_crystal = "default:mese_crystal_fragment", dye_yellow = "dye:yellow", + + valve = "pipeworks:valve_off_empty", + rubber = "technic:rubber", } if minetest.get_modpath("hades_core") then @@ -56,6 +59,8 @@ if minetest.get_modpath("technic") then items.controller = "technic:control_logic_unit" items.transformer = "technic:lv_transformer" + + items.rubber = "technic:rubber" end if minetest.get_modpath("hades_technic") then @@ -65,6 +70,8 @@ if minetest.get_modpath("hades_technic") then items.controller = "hades_technic:control_logic_unit" items.transformer = "hades_technic:lv_transformer" + + items.rubber = "hades_technic:rubber" end minetest.register_craft({ @@ -141,11 +148,10 @@ minetest.register_craft({ } }) ---[[ minetest.register_craft({ output = "power_generators:combustion_engine_body_4", recipe = { - {items.metal_ingot, items.metal_ingot, items.metal_ingot}, + {items.metal_ingot, items.metal_ingot}, {"power_generators:combustion_engine_body_2","power_generators:combustion_engine_body_2"}, {"power_generators:combustion_engine_crankshaft","power_generators:combustion_engine_crankshaft"}, } @@ -159,6 +165,17 @@ minetest.register_craft({ {"power_generators:combustion_engine_crankshaft","power_generators:combustion_engine_crankshaft","power_generators:combustion_engine_crankshaft"}, } }) + + +--[[ +minetest.register_craft({ + output = "power_generators:combustion_engine_body_8", + recipe = { + {items.metal_ingot, items.metal_ingot}, + {"power_generators:combustion_engine_body_4","power_generators:combustion_engine_body_4"}, + {"power_generators:combustion_engine_crankshaft","power_generators:combustion_engine_crankshaft"}, + } + }) --]] minetest.register_craft({ @@ -179,6 +196,15 @@ minetest.register_craft({ } }) +minetest.register_craft({ + output = "power_generators:combustion_engine_six_cylinders", + recipe = { + {items.metal_ingot, "", items.metal_ingot}, + {items.copper_wire, "power_generators:combustion_engine_body_6", items.copper_wire}, + {items.metal_ingot, "power_generators:shaft", items.metal_ingot}, + } + }) + minetest.register_craft({ output = "power_generators:combustion_engine_gearbox", recipe = { @@ -233,6 +259,62 @@ minetest.register_craft({ } }) +minetest.register_craft({ + output = "power_generators:fuel_hosepipe", + recipe = { + {"",items.rubber,""}, + {items.rubber,"",items.rubber}, + {"",items.rubber,""}, + } + }) + +minetest.register_craft({ + output = "power_generators:fuel_tank", + recipe = { + {"","power_generators:combustion_engine_fuel_tank",items.rubber}, + {"power_generators:combustion_engine_fuel_tank","power_generators:framework","power_generators:combustion_engine_fuel_tank"}, + {"","power_generators:combustion_engine_fuel_tank","power_generators:fuel_hosepipe"}, + } + }) + +minetest.register_craft({ + output = "power_generators:gearbox", + recipe = { + {items.steel_strip,items.steel_strip,"power_generators:combustion_engine_gearbox"}, + {items.steel_strip,"power_generators:framework","power_generators:shaft"}, + {"power_generators:combustion_engine_gearbox","power_generators:shaft","power_generators:combustion_engine_gearbox"}, + } + }) + +minetest.register_craft({ + output = "power_generators:starter_manual", + recipe = { + {"power_generators:carbon_steel_bar",items.steel_strip,"power_generators:carbon_steel_bar"}, + {items.steel_strip,"power_generators:framework","power_generators:shaft"}, + {"power_generators:combustion_engine_gearbox","power_generators:shaft","power_generators:combustion_engine_gearbox"}, + } + }) + +minetest.register_craft({ + output = "power_generators:combustion_engine_6c", + recipe = { + {"power_generators:framework","power_generators:fuel_hosepipe"}, + {items.steel_strip,items.valve}, + {"power_generators:shaft","power_generators:combustion_engine_six_cylinders"}, + } + }) + +--[[ +minetest.register_craft({ + output = "power_generators:combustion_engine_8c", + recipe = { + {"power_generators:framework","power_generators:fuel_hosepipe"}, + {items.steel_strip,items.steel_strip}, + {"power_generators:shaft","power_generators:combustion_engine_eight_cylinders"}, + } + }) +--]] + minetest.register_craft({ output = "power_generators:shaft 3", recipe = { diff --git a/generators/craftitems.lua b/generators/craftitems.lua index f2f019e..169421d 100644 --- a/generators/craftitems.lua +++ b/generators/craftitems.lua @@ -48,6 +48,10 @@ minetest.register_craftitem("power_generators:combustion_engine_two_cylinders_co description = S("Combustion Engine Two Cylinders"), inventory_image = "power_generators_combustion_engine_two_cylinders.png", }) +minetest.register_craftitem("power_generators:combustion_engine_six_cylinders", { + description = S("Combustion Engine Six Cylinders Without Controller"), + inventory_image = "power_generators_combustion_engine_six_cylinders.png", + }) minetest.register_craftitem("power_generators:combustion_engine_gearbox", { description = S("Combustion Engine Gearbox"), diff --git a/textures/power_generators_combustion_engine_eight_cylinders.png b/textures/power_generators_combustion_engine_eight_cylinders.png new file mode 100644 index 0000000000000000000000000000000000000000..c9580532a3e9a870122758ff56e88fcca49cea57 GIT binary patch literal 162 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`EX7WqAsj$Z!;#Vff4Xfx|HF4L-&wwPWu7oaknw;- zvn0F0=4-04QsEP(%;h$3VqW8jlA57g{y^BR9-B+Aopu-&5tLIAAT!@%C557^k!^sKlDkPP1W{acIuc9 P&@Ki~S3j3^P6!rKs;>T%H`AD_x*H~do!W@wa$%?))kC~@n&n|fB(J&w1>gd L)z4*}Q$iB}l4Cki literal 0 HcmV?d00001 diff --git a/textures/power_generators_fuel_hosepipe.png b/textures/power_generators_fuel_hosepipe.png new file mode 100644 index 0000000000000000000000000000000000000000..3fdcda8a96366133a4f483061a2e67314a607624 GIT binary patch literal 192 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`EX7WqAsj$Z!;#Vfe?toZ literal 0 HcmV?d00001