From 054283cc4d706c06561110d73293c8ce1ad2e52e Mon Sep 17 00:00:00 2001 From: Joachim Stolberg Date: Wed, 16 Jun 2021 22:51:30 +0200 Subject: [PATCH] Add ta2 gravity energy storage system --- basic_machines/source.lua | 2 +- init.lua | 7 +- items/basalt.lua | 4 +- items/registered_nodes.lua | 1 + power/ta2_winch.lua | 188 ------------------ .../ta2_rope.lua | 27 +-- ta2_energy_storage/ta2_weight_chest.lua | 138 +++++++++++++ ta2_energy_storage/ta2_winch.lua | 181 +++++++++++++++++ textures/shrink.py | 16 -- textures/techage_appl_winch.png | Bin 0 -> 161 bytes textures/techage_appl_winch_hole.png | Bin 0 -> 105 bytes textures/techage_weight_bottom.png | Bin 3632 -> 270 bytes textures/techage_weight_side.png | Bin 2749 -> 254 bytes 13 files changed, 342 insertions(+), 222 deletions(-) delete mode 100644 power/ta2_winch.lua rename basis/rope_lib.lua => ta2_energy_storage/ta2_rope.lua (71%) create mode 100644 ta2_energy_storage/ta2_weight_chest.lua create mode 100644 ta2_energy_storage/ta2_winch.lua delete mode 100644 textures/shrink.py create mode 100644 textures/techage_appl_winch.png create mode 100644 textures/techage_appl_winch_hole.png diff --git a/basic_machines/source.lua b/basic_machines/source.lua index 2a67c49..efc6ca2 100644 --- a/basic_machines/source.lua +++ b/basic_machines/source.lua @@ -25,7 +25,7 @@ local control = networks.control local STANDBY_TICKS = 4 local CYCLE_TIME = 2 -local PWR_PERF = 100 +local PWR_PERF = 25 local function formspec(self, pos, nvm) return techage.generator_formspec(self, pos, nvm, S("Power Source"), nvm.provided, PWR_PERF) diff --git a/init.lua b/init.lua index 1a37fc2..dd7b658 100644 --- a/init.lua +++ b/init.lua @@ -89,7 +89,6 @@ dofile(MP.."/basis/recipe_lib.lua") dofile(MP.."/basis/formspec_update.lua") dofile(MP.."/basis/windturbine_lib.lua") dofile(MP.."/basis/laser_lib.lua") -dofile(MP.."/basis/rope_lib.lua") -- Main doc dofile(MP.."/doc/manual_DE.lua") @@ -115,7 +114,6 @@ dofile(MP.."/power/powerswitchbox.lua") dofile(MP.."/power/powerswitch.lua") dofile(MP.."/power/protection.lua") dofile(MP.."/power/power_line.lua") -dofile(MP.."/power/ta2_winch.lua") dofile(MP.."/power/ta4_cable.lua") dofile(MP.."/power/ta4_cable_wall_entry.lua") dofile(MP.."/power/laser.lua") @@ -143,6 +141,11 @@ dofile(MP.."/steam_engine/boiler.lua") dofile(MP.."/steam_engine/cylinder.lua") dofile(MP.."/steam_engine/flywheel.lua") +-- TA2 gravity-based energy storage +dofile(MP.."/ta2_energy_storage/ta2_rope.lua") +dofile(MP.."/ta2_energy_storage/ta2_winch.lua") +dofile(MP.."/ta2_energy_storage/ta2_weight_chest.lua") + -- Liquids I dofile(MP.."/liquids/liquid_pipe.lua") dofile(MP.."/liquids/valve.lua") diff --git a/items/basalt.lua b/items/basalt.lua index 39722ca..8a771d5 100644 --- a/items/basalt.lua +++ b/items/basalt.lua @@ -61,14 +61,14 @@ minetest.register_node("techage:basalt_stone_block", { minetest.register_node("techage:basalt_gravel", { description = S("Basalt Gravel"), tiles = {"default_gravel.png^[brighten"}, - groups = {crumbly = 2, falling_node = 1}, + groups = {crumbly = 2, falling_node = 1, gravel = 1}, sounds = default.node_sound_gravel_defaults(), }) minetest.register_node("techage:sieved_basalt_gravel", { description = S("Sieved Basalt Gravel"), tiles = {"default_gravel.png^[brighten"}, - groups = {crumbly = 2, falling_node = 1, not_in_creative_inventory=1}, + groups = {crumbly = 2, falling_node = 1, gravel = 1, not_in_creative_inventory=1}, sounds = default.node_sound_gravel_defaults(), }) diff --git a/items/registered_nodes.lua b/items/registered_nodes.lua index 9645591..deccdeb 100644 --- a/items/registered_nodes.lua +++ b/items/registered_nodes.lua @@ -37,3 +37,4 @@ minetest.register_on_mods_loaded(function() end end) +minetest.override_item("default:gravel", {groups = {crumbly = 2, gravel = 1, falling_node = 1}}) \ No newline at end of file diff --git a/power/ta2_winch.lua b/power/ta2_winch.lua deleted file mode 100644 index 5f76fee..0000000 --- a/power/ta2_winch.lua +++ /dev/null @@ -1,188 +0,0 @@ ---[[ - - TechAge - ======= - - Copyright (C) 2019-2021 Joachim Stolberg - - GPL v3 - See LICENSE.txt for more information - - TA4 Laser beam emitter and receiver - -]]-- - --- for lazy programmers -local P2S = function(pos) if pos then return minetest.pos_to_string(pos) end end -local S2P = minetest.string_to_pos -local M = minetest.get_meta -local S = techage.S - -local STORAGE_CAPA = 1000 - -local Axle = techage.Axle -local power = networks.power - -minetest.register_node("techage:ta2_winch", { - description = S("TA2 Winch"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta4_top.png", - "techage_filling_ta4.png^techage_frame_ta4.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_laser.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_laser.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_laser_hole.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_hole_electric.png", - }, - - after_place_node = function(pos, placer) - local nvm = techage.get_nvm(pos) - local outdir = networks.side_to_outdir(pos, "R") - M(pos):set_int("outdir", outdir) - Axle:after_place_node(pos, {outdir}) - local pos1, pos2 = techage.renew_rope(pos, 10) - local pos3 = {x = pos1.x, y = (pos1.y + pos2.y) / 2, z = pos1.z} -- mid-pos - minetest.add_entity(pos3, "techage:ta2_weight_chest_entity") - minetest.get_node_timer(pos):start(2) - power.start_storage_calc(pos, Axle, outdir) - end, - - on_timer = function(pos, elapsed) - local nvm = techage.get_nvm(pos) - local mem = techage.get_mem(pos) - local outdir = M(pos):get_int("outdir") - - --power.start_storage_calc(pos, Axle, outdir) - - nvm.load = power.get_storage_load(pos, Axle, outdir, STORAGE_CAPA) - if nvm.load then - print("on_timer" , nvm.load) - local len = 11 - (nvm.load / STORAGE_CAPA * 10) - local y = pos.y - len - techage.renew_rope(pos, len) - if mem.obj then - mem.obj:remove() - end - mem.obj = minetest.add_entity({x = pos.x, y = y, z = pos.z}, "techage:ta2_weight_chest_entity") - end - --print("on_timer", nvm.load) - return true - end, - - after_dig_node = function(pos, oldnode, oldmetadata) - local outdir = tonumber(oldmetadata.fields.outdir or 0) - power.start_storage_calc(pos, Axle, outdir) - Axle:after_dig_node(pos, {outdir}) - techage.del_mem(pos) - end, - - get_storage_data = function(pos, tlib2) - local nvm = techage.get_nvm(pos) - return {level = (nvm.load or 0) / STORAGE_CAPA, capa = STORAGE_CAPA} - end, - - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_entity("techage:ta2_weight_chest_entity", { - initial_properties = { - physical = true, - collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, - visual = "wielditem", - textures = {"techage:ta2_weight_chest"}, - visual_size = {x=0.66, y=0.66, z=0.66}, - static_save = false, - }, - driver_allowed = true, -}) - -power.register_nodes({"techage:ta2_winch"}, Axle, "sto", {"R"}) - -local function allow_metadata_inventory_put(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - return stack:get_count() -end - -local function allow_metadata_inventory_take(pos, listname, index, stack, player) - if minetest.is_protected(pos, player:get_player_name()) then - return 0 - end - return stack:get_count() -end - -local function can_dig(pos, player) - if minetest.is_protected(pos, player:get_player_name()) then - return false - end - local inv = minetest.get_meta(pos):get_inventory() - return inv:is_empty("main") -end - -local function after_dig_node(pos, oldnode, oldmetadata, digger) - techage.remove_node(pos, oldnode, oldmetadata) -end - -local function formspec() - return "size[8,6.7]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "list[context;main;1,0;6,2;]".. - "list[current_player;main;0,3;8,4;]".. - "listring[context;main]".. - "listring[current_player;main]" -end - -minetest.register_node("techage:ta2_weight_chest", { - description = S("TA2 Weight Chest"), - tiles = { - -- up, down, right, left, back, front - "techage_filling_ta2.png^techage_frame_ta2.png^techage_weight_bottom.png", - "techage_filling_ta2.png^techage_frame_ta2.png^techage_weight_bottom.png", - "techage_filling_ta2.png^techage_frame_ta2.png^techage_appl_chest_back_ta3.png^techage_weight_side.png", - "techage_filling_ta2.png^techage_frame_ta2.png^techage_appl_chest_back_ta3.png^techage_weight_side.png", - "techage_filling_ta2.png^techage_frame_ta2.png^techage_appl_chest_back_ta3.png^techage_weight_side.png", - "techage_filling_ta2.png^techage_frame_ta2.png^techage_appl_chest_front_ta3.png^techage_weight_side.png", - }, - - on_construct = function(pos) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - inv:set_size('main', 12) - end, - - after_place_node = function(pos, placer) - local meta = minetest.get_meta(pos) - meta:set_string("owner", placer:get_player_name()) - meta:set_string("formspec", formspec()) - end, - - techage_set_numbers = function(pos, numbers, player_name) - return techage.logic.set_numbers(pos, numbers, player_name, S("TA2 Weight Chest")) - end, - - can_dig = can_dig, - after_dig_node = after_dig_node, - allow_metadata_inventory_put = allow_metadata_inventory_put, - allow_metadata_inventory_take = allow_metadata_inventory_take, - - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_wood_defaults(), -}) - ---minetest.register_craft({ --- output = "techage:ta4_laser_emitter", --- recipe = { --- {"techage:ta4_carbon_fiber", "dye:blue", "techage:ta4_carbon_fiber"}, --- {"techage:electric_cableS", "basic_materials:energy_crystal_simple", "techage:ta4_leds"}, --- {"default:steel_ingot", "techage:ta4_wlanchip", "default:steel_ingot"}, --- }, ---}) - diff --git a/basis/rope_lib.lua b/ta2_energy_storage/ta2_rope.lua similarity index 71% rename from basis/rope_lib.lua rename to ta2_energy_storage/ta2_rope.lua index 7024103..18ecf9e 100644 --- a/basis/rope_lib.lua +++ b/ta2_energy_storage/ta2_rope.lua @@ -8,16 +8,19 @@ GPL v3 See LICENSE.txt for more information - Rope basis functions + Rope for TA2 gravity-based energy storage ]]-- local Entities = {} -- Return first pos after start pos and the destination pos -local function get_positions(pos, length) +local function get_positions(pos, length, force) local pos1 = {x = pos.x, y = pos.y - 1, z = pos.z} -- start pos - local pos2 = {x = pos.x, y = pos.y - length, z = pos.z} -- end pos + local pos2 = {x = pos.x, y = pos.y - 1 - length, z = pos.z} -- end pos + if force then + return pos1, pos2 -- force given length + end local _, pos3 = minetest.line_of_sight(pos1, pos2) return pos1, pos3 or pos2 -- new values end @@ -36,15 +39,14 @@ local function add_rope(pos, pos1, pos2) local key = del_rope(pos) pos1.y = pos1.y + 0.5 -- from - pos2.y = pos2.y + 0.5 -- to + pos2.y = pos2.y - 0.5 -- to local pos3 = {x = pos1.x, y = (pos1.y + pos2.y) / 2, z = pos1.z} -- mid-pos local length = math.abs(pos1.y - pos2.y) local rope = minetest.add_entity(pos3, "techage:ta2_rope") if rope then - rope:set_properties({visual_size = {x = 0.05, y = length}, collisionbox = {x = 0.05, y = length}}) + rope:set_properties({visual_size = {x = 0.06, y = length}, collisionbox = {x = 0.06, y = length}}) end - --print(pos1.y, pos2.y, pos3.y) Entities[key] = rope end @@ -60,11 +62,11 @@ minetest.register_entity("techage:ta2_rope", { "techage_rope.png", }, use_texture_alpha = false, - physical = false, - collide_with_objects = false, - pointable = false, + physical = true, + collide_with_objects = true, + pointable = true, static_save = false, - visual_size = {x = 0.05, y = 10, z = 0.05}, + visual_size = {x = 0.06, y = 10, z = 0.06}, shaded = true, }, }) @@ -72,13 +74,12 @@ minetest.register_entity("techage:ta2_rope", { ------------------------------------------------------------------------------- -- API functions ------------------------------------------------------------------------------- -function techage.renew_rope(pos, length) - local pos1, pos2 = get_positions(pos, length) +function techage.renew_rope(pos, length, force) + local pos1, pos2 = get_positions(pos, length, force) if pos1 then add_rope(pos, pos1, pos2) return pos1, pos2 end end --- techage.del_laser(pos) techage.del_rope = del_rope diff --git a/ta2_energy_storage/ta2_weight_chest.lua b/ta2_energy_storage/ta2_weight_chest.lua new file mode 100644 index 0000000..f2f915f --- /dev/null +++ b/ta2_energy_storage/ta2_weight_chest.lua @@ -0,0 +1,138 @@ +--[[ + + TechAge + ======= + + Copyright (C) 2019-2021 Joachim Stolberg + + GPL v3 + See LICENSE.txt for more information + + Chest for TA2 gravity-based energy storage + +]]-- + +-- for lazy programmers +local P2S = function(pos) if pos then return minetest.pos_to_string(pos) end end +local S2P = minetest.string_to_pos +local M = minetest.get_meta +local S = techage.S + +local function valid_weight_items(stack) + local name = stack:get_name() + local ndef = minetest.registered_nodes[name] + if ndef then + if minetest.get_item_group(name, "stone") > 0 then + return true + end + if minetest.get_item_group(name, "cobble") > 0 then + return true + end + if minetest.get_item_group(name, "gravel") > 0 then + return true + end + if minetest.get_item_group(name, "sand") > 0 then + return true + end + end +end + +minetest.register_entity("techage:ta2_weight_chest_entity", { + initial_properties = { + physical = true, + pointable = false, + collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, + visual = "wielditem", + textures = {"techage:ta2_weight_chest"}, + visual_size = {x=0.66, y=0.66, z=0.66}, + static_save = false, + }, +}) + +local function allow_metadata_inventory_put(pos, listname, index, stack, player) + if minetest.is_protected(pos, player:get_player_name()) then + return 0 + end + if not valid_weight_items(stack) then + return 0 + end + return stack:get_count() +end + +local function allow_metadata_inventory_take(pos, listname, index, stack, player) + if minetest.is_protected(pos, player:get_player_name()) then + return 0 + end + return stack:get_count() +end + +local function can_dig(pos, player) + if minetest.is_protected(pos, player:get_player_name()) then + return false + end + local inv = minetest.get_meta(pos):get_inventory() + return inv:is_empty("main") +end + +local function after_dig_node(pos, oldnode, oldmetadata, digger) + techage.remove_node(pos, oldnode, oldmetadata) +end + +local function formspec() + return "size[8,6.7]".. + default.gui_bg.. + default.gui_bg_img.. + default.gui_slots.. + "list[context;main;1.5,0.2;5,2;]".. + "list[current_player;main;0,3;8,4;]".. + "listring[context;main]".. + "listring[current_player;main]" +end + +minetest.register_node("techage:ta2_weight_chest", { + description = S("TA2 Weight Chest"), + tiles = { + -- up, down, right, left, back, front + "techage_filling_ta2.png^techage_frame_ta2.png^techage_weight_bottom.png", + "techage_filling_ta2.png^techage_frame_ta2.png^techage_weight_bottom.png", + "techage_filling_ta2.png^techage_frame_ta2.png^techage_appl_chest_back_ta3.png^techage_weight_side.png", + "techage_filling_ta2.png^techage_frame_ta2.png^techage_appl_chest_back_ta3.png^techage_weight_side.png", + "techage_filling_ta2.png^techage_frame_ta2.png^techage_appl_chest_back_ta3.png^techage_weight_side.png", + "techage_filling_ta2.png^techage_frame_ta2.png^techage_appl_chest_back_ta3.png^techage_weight_side.png", + }, + + on_construct = function(pos) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + inv:set_size('main', 10) + end, + + after_place_node = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("formspec", formspec()) + end, + + techage_set_numbers = function(pos, numbers, player_name) + return techage.logic.set_numbers(pos, numbers, player_name, S("TA2 Weight Chest")) + end, + + can_dig = can_dig, + after_dig_node = after_dig_node, + allow_metadata_inventory_put = allow_metadata_inventory_put, + allow_metadata_inventory_take = allow_metadata_inventory_take, + + paramtype2 = "facedir", + groups = {choppy=2, cracky=2, crumbly=2}, + is_ground_content = false, + sounds = default.node_sound_wood_defaults(), +}) + +minetest.register_craft({ + output = "techage:ta2_weight_chest", + recipe = { + {"", "", ""}, + {"basic_materials:steel_strip", "techage:chest_ta2", "basic_materials:steel_strip"}, + {"", "", ""}, + }, +}) + diff --git a/ta2_energy_storage/ta2_winch.lua b/ta2_energy_storage/ta2_winch.lua new file mode 100644 index 0000000..ba784ac --- /dev/null +++ b/ta2_energy_storage/ta2_winch.lua @@ -0,0 +1,181 @@ +--[[ + + TechAge + ======= + + Copyright (C) 2019-2021 Joachim Stolberg + + GPL v3 + See LICENSE.txt for more information + + Winch for TA2 gravity-based energy storage + +]]-- + +-- for lazy programmers +local P2S = function(pos) if pos then return minetest.pos_to_string(pos) end end +local S2P = minetest.string_to_pos +local M = minetest.get_meta +local S = techage.S + +local MIN_LOAD = 99 +local MAX_ROPE_LEN = 10 + +local Axle = techage.Axle +local power = networks.power + + +local function chest_pos(pos) + local pos1 = {x = pos.x, y = pos.y - 1, z = pos.z} -- start pos + local pos2 = {x = pos.x, y = pos.y - 1 - MAX_ROPE_LEN, z = pos.z} -- end pos + local _, pos3 = minetest.line_of_sight(pos1, pos2) + return pos3 or pos2 +end + +local function chest_load(nvm, pos) + local amount = 0 + local inv = minetest.get_inventory({type = "node", pos = pos}) + nvm.stored_items = {} + for i = 1, inv:get_size("main") do + local stack = inv:get_stack("main", i) + nvm.stored_items[i] = {name = stack:get_name(), count = stack:get_count()} + amount = amount + stack:get_count() + end + return amount +end + +local function chest_full(pos) + local nvm = techage.get_nvm(pos) + local pos1 = chest_pos(pos) + local node = minetest.get_node(pos1) + if node.name == "techage:ta2_weight_chest" then + return chest_load(nvm, pos1) >= MIN_LOAD + end +end + +-- Add chest node, remove chest entity instead +local function add_chest(pos) + local mem = techage.get_mem(pos) + local nvm = techage.get_nvm(pos) + if mem.obj then + mem.obj:remove() + mem.obj = nil + end + if nvm.capa and nvm.capa >= MIN_LOAD then + local pos1 = {x = pos.x, y = pos.y - (nvm.length or 1) - 1, z = pos.z} + minetest.add_node(pos1, {name = "techage:ta2_weight_chest", param2 = 0}) + local ndef = minetest.registered_nodes["techage:ta2_weight_chest"] + ndef.on_construct(pos1) + ndef.after_place_node(pos1) + local inv = minetest.get_inventory({type = "node", pos = pos1}) + for i, item in ipairs(nvm.stored_items or {}) do + inv:set_stack("main", i, item) + end + end + nvm.capa = 0 +end + +-- Remove chest node, add rope and chest entity instead +local function remove_chest(pos) + local mem = techage.get_mem(pos) + local nvm = techage.get_nvm(pos) + local pos1 = chest_pos(pos) + local mass = chest_load(nvm, pos1) + if mass > 0 then + nvm.length = pos.y - pos1.y - 1 + nvm.capa = mass * nvm.length / MAX_ROPE_LEN + minetest.remove_node(pos1) + mem.obj = minetest.add_entity(pos1, "techage:ta2_weight_chest_entity") + techage.renew_rope(pos, nvm.length) + return true + end +end + +minetest.register_node("techage:ta2_winch", { + description = S("TA2 Winch"), + tiles = { + -- up, down, right, left, back, front + "techage_filling_ta2.png^techage_appl_arrow2.png^techage_frame_ta2.png^[transformR270", + "techage_filling_ta2.png^techage_appl_arrow2.png^techage_frame_ta2.png^techage_appl_winch_hole.png^[transformR270", + "techage_filling_ta2.png^techage_axle_gearbox.png^techage_frame_ta2.png", + "techage_filling_ta2.png^techage_appl_winch.png^techage_frame_ta2.png", + "techage_filling_ta2.png^techage_appl_winch.png^techage_frame_ta2.png", + "techage_filling_ta2.png^techage_appl_winch.png^techage_frame_ta2.png", + }, + + after_place_node = function(pos, placer) + local nvm = techage.get_nvm(pos) + local outdir = networks.side_to_outdir(pos, "R") + M(pos):set_int("outdir", outdir) + Axle:after_place_node(pos, {outdir}) + minetest.get_node_timer(pos):start(2) + techage.renew_rope(pos, MAX_ROPE_LEN - 1) + end, + + on_timer = function(pos, elapsed) + local nvm = techage.get_nvm(pos) + local mem = techage.get_mem(pos) + local outdir = M(pos):get_int("outdir") + nvm.capa = nvm.capa or 1 + nvm.load = nvm.load or 0 + nvm.length = nvm.length or 1 + + if not nvm.running and power.power_available(pos, Axle, outdir) and chest_full(pos) then + remove_chest(pos) + power.start_storage_calc(pos, Axle, outdir) + nvm.running = true + elseif nvm.running and nvm.load == 0 and not power.power_available(pos, Axle, outdir) then + add_chest(pos) + power.start_storage_calc(pos, Axle, outdir) + nvm.running = false + end + + if nvm.running then + nvm.load = power.get_storage_load(pos, Axle, outdir, nvm.capa) + if nvm.load then + local length = nvm.length * (1 - nvm.load/nvm.capa) + local y = pos.y - length - 1 + techage.renew_rope(pos, length, true) + if mem.obj then + mem.obj:remove() + end + mem.obj = minetest.add_entity({x = pos.x, y = y, z = pos.z}, "techage:ta2_weight_chest_entity") + end + end + return true + end, + + after_dig_node = function(pos, oldnode, oldmetadata) + add_chest(pos) + local outdir = tonumber(oldmetadata.fields.outdir or 0) + power.start_storage_calc(pos, Axle, outdir) + Axle:after_dig_node(pos, {outdir}) + techage.del_mem(pos) + end, + + get_storage_data = function(pos, tlib2) + local nvm = techage.get_nvm(pos) + nvm.load = nvm.load or 0 + nvm.capa = nvm.capa or 1 + if nvm.running then + return {level = nvm.load / nvm.capa, capa = nvm.capa} + end + end, + + paramtype2 = "facedir", + groups = {choppy=2, cracky=2, crumbly=2}, + is_ground_content = false, + sounds = default.node_sound_wood_defaults(), +}) + +power.register_nodes({"techage:ta2_winch"}, Axle, "sto", {"R"}) + +minetest.register_craft({ + output = "techage:ta2_winch", + recipe = { + {"farming:string", "farming:string", "farming:string"}, + {"farming:string", "techage:gearbox", "farming:string"}, + {"farming:string", "farming:string", "farming:string"}, + }, +}) + diff --git a/textures/shrink.py b/textures/shrink.py deleted file mode 100644 index 0cf29b8..0000000 --- a/textures/shrink.py +++ /dev/null @@ -1,16 +0,0 @@ -import os, fnmatch - - -print(">>> Convert") -for filename in os.listdir("./"): - if fnmatch.fnmatch(filename, "*.png"): - print(filename) - os.system("pngquant --skip-if-larger --quality=80 --strip --output ./%s.new ./%s" % (filename, filename)) - -print("\n>>> Copy") -for filename in os.listdir("./"): - if fnmatch.fnmatch(filename, "*.new"): - print(filename) - os.remove("./" + filename[:-4]) - os.rename("./" + filename, "./" + filename[:-4]) - diff --git a/textures/techage_appl_winch.png b/textures/techage_appl_winch.png new file mode 100644 index 0000000000000000000000000000000000000000..b45c1420889b8b8ab551d9b6e40fcc212c5418ef GIT binary patch literal 161 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnF3?v&v(vJfv=>VS)SN8%RJ3G77l$83qy6%pS zxwB>k2L}Ts*Q{DKxpmVkAd9gi$S;_|;n|HeAjibh#W6(Vd~(79aRHZf0mTVCtObo6 z8V%el92hS$J#AVRpb+7=jzRKT(noJ05spdn4qMn67RSpU)MV(H2Gq~s>FVdQ&MBb@ E0Eh@K)c^nh literal 0 HcmV?d00001 diff --git a/textures/techage_appl_winch_hole.png b/textures/techage_appl_winch_hole.png new file mode 100644 index 0000000000000000000000000000000000000000..d4c26740ee2fc9e79b800e090056eecf7986f84a GIT binary patch literal 105 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!D3?x-;bCrM;TYy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