From 1d651b3811d63e32bdd9123cb9cfd1e82fc4d2c9 Mon Sep 17 00:00:00 2001 From: upsilon Date: Mon, 24 Apr 2017 21:12:46 +0200 Subject: [PATCH] Rename "Temporary gate" into "Time gate" --- README.md | 2 +- .../depends.txt | 0 .../init.lua | 57 +++++++++--------- .../textures/moremesecons_timegate_bottom.png | Bin .../moremesecons_timegate_ends_off.png | Bin .../moremesecons_timegate_ends_on.png | Bin .../textures/moremesecons_timegate_off.png | Bin .../textures/moremesecons_timegate_on.png | Bin .../moremesecons_timegate_sides_off.png | Bin .../moremesecons_timegate_sides_on.png | Bin 10 files changed, 31 insertions(+), 28 deletions(-) rename {moremesecons_temporarygate => moremesecons_timegate}/depends.txt (100%) rename {moremesecons_temporarygate => moremesecons_timegate}/init.lua (64%) rename moremesecons_temporarygate/textures/moremesecons_temporarygate_bottom.png => moremesecons_timegate/textures/moremesecons_timegate_bottom.png (100%) rename moremesecons_temporarygate/textures/moremesecons_temporarygate_ends_off.png => moremesecons_timegate/textures/moremesecons_timegate_ends_off.png (100%) rename moremesecons_temporarygate/textures/moremesecons_temporarygate_ends_on.png => moremesecons_timegate/textures/moremesecons_timegate_ends_on.png (100%) rename moremesecons_temporarygate/textures/moremesecons_temporarygate_off.png => moremesecons_timegate/textures/moremesecons_timegate_off.png (100%) rename moremesecons_temporarygate/textures/moremesecons_temporarygate_on.png => moremesecons_timegate/textures/moremesecons_timegate_on.png (100%) rename moremesecons_temporarygate/textures/moremesecons_temporarygate_sides_off.png => moremesecons_timegate/textures/moremesecons_timegate_sides_off.png (100%) rename moremesecons_temporarygate/textures/moremesecons_temporarygate_sides_on.png => moremesecons_timegate/textures/moremesecons_timegate_sides_on.png (100%) diff --git a/README.md b/README.md index 1da2be0..fcb429a 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ MoreMesecons is a mod for minetest which adds some mesecons items. * `Signal Changer` : If it receives a signal on its pin "F", it turns on. If it receives a signal on its pin "O", it turns off. Note : an inverted signal is sended at the other end of the arrow. * `Switch Torch` : It connects just like Mesecons Torch. If it receives a signal, it turns on, and if it receives a second signal, it turns off. * `Teleporter` : If you place one teleporter, it teleports the nearest player on itself when it receives a mesecons signal. If you place two teleporters on the same axis, when one receives a mesecons signal, it teleports the nearest player on the second (with a maximal distance of 50 nodes by default). The player teleporter must be inside a radius of 25 nodes. -* `Temporary Gate` : If it receives a mesecons signal, whatever its duration, a mesecons signal is send with a fixed duration. You can change it in the formspec by right-clicking on the gate. +* `Time Gate` : If it receives a mesecons signal, whatever its duration, a mesecons signal is send with a fixed duration. You can change it in the formspec by right-clicking on the gate. * `Wireless` : Place 2 (or more) wireless somewhere. Change their channel by right-click. If you send a signal to a wireless, every wireless wich have the same channel will send the signal. Compatible with digiline mod. * `Wireless Jammer` : If it receives a mesecons signal, it deactivates all wireless (receptors) in a radius of 15 nodes. diff --git a/moremesecons_temporarygate/depends.txt b/moremesecons_timegate/depends.txt similarity index 100% rename from moremesecons_temporarygate/depends.txt rename to moremesecons_timegate/depends.txt diff --git a/moremesecons_temporarygate/init.lua b/moremesecons_timegate/init.lua similarity index 64% rename from moremesecons_temporarygate/init.lua rename to moremesecons_timegate/init.lua index 96678bf..87bda43 100644 --- a/moremesecons_temporarygate/init.lua +++ b/moremesecons_timegate/init.lua @@ -1,4 +1,4 @@ -local temporarygate_get_output_rules = function(node) +local timegate_get_output_rules = function(node) local rules = {{x = 0, y = 0, z = 1}} for i = 0, node.param2 do rules = mesecon.rotate_rules_left(rules) @@ -6,7 +6,7 @@ local temporarygate_get_output_rules = function(node) return rules end -local temporarygate_get_input_rules = function(node) +local timegate_get_input_rules = function(node) local rules = {{x = 0, y = 0, z = -1}} for i = 0, node.param2 do rules = mesecon.rotate_rules_left(rules) @@ -16,18 +16,18 @@ end -- Functions that are called after the delay time -local function temporarygate_activate(pos, node) +local function timegate_activate(pos, node) -- using a meta string allows writing the time in hexadecimals local time = tonumber(minetest.get_meta(pos):get_string("time")) if not time then return end - node.name = "moremesecons_temporarygate:temporarygate_on" + node.name = "moremesecons_timegate:timegate_on" minetest.swap_node(pos, node) mesecon.receptor_on(pos) minetest.after(time, function(pos, node) mesecon.receptor_off(pos) - node.name = "moremesecons_temporarygate:temporarygate_off" + node.name = "moremesecons_timegate:timegate_off" minetest.swap_node(pos, node) end, pos, node) end @@ -44,11 +44,11 @@ boxes = {{ -6/16, -8/16, -6/16, 6/16, -7/16, 6/16 }, -- the main slab { -8/16, -8/16, -1/16, -6/16, -7/16, 1/16 }, -- the two wire stubs { 6/16, -8/16, -1/16, 8/16, -7/16, 1/16 }} -mesecon.register_node("moremesecons_temporarygate:temporarygate", { - description = "Temporary Gate", +mesecon.register_node("moremesecons_timegate:timegate", { + description = "Time Gate", drawtype = "nodebox", - inventory_image = "moremesecons_temporarygate_off.png", - wield_image = "moremesecons_temporarygate_off.png", + inventory_image = "moremesecons_timegate_off.png", + wield_image = "moremesecons_timegate_off.png", walkable = true, selection_box = { type = "fixed", @@ -74,51 +74,54 @@ mesecon.register_node("moremesecons_temporarygate:temporarygate", { end },{ tiles = { - "moremesecons_temporarygate_off.png", - "moremesecons_temporarygate_bottom.png", - "moremesecons_temporarygate_ends_off.png", - "moremesecons_temporarygate_ends_off.png", - "moremesecons_temporarygate_sides_off.png", - "moremesecons_temporarygate_sides_off.png" + "moremesecons_timegate_off.png", + "moremesecons_timegate_bottom.png", + "moremesecons_timegate_ends_off.png", + "moremesecons_timegate_ends_off.png", + "moremesecons_timegate_sides_off.png", + "moremesecons_timegate_sides_off.png" }, groups = {bendy=2,snappy=1,dig_immediate=2}, mesecons = { receptor = { state = mesecon.state.off, - rules = temporarygate_get_output_rules + rules = timegate_get_output_rules }, effector = { - rules = temporarygate_get_input_rules, - action_on = temporarygate_activate + rules = timegate_get_input_rules, + action_on = timegate_activate } }, },{ tiles = { - "moremesecons_temporarygate_on.png", - "moremesecons_temporarygate_bottom.png", - "moremesecons_temporarygate_ends_on.png", - "moremesecons_temporarygate_ends_on.png", - "moremesecons_temporarygate_sides_on.png", - "moremesecons_temporarygate_sides_on.png" + "moremesecons_timegate_on.png", + "moremesecons_timegate_bottom.png", + "moremesecons_timegate_ends_on.png", + "moremesecons_timegate_ends_on.png", + "moremesecons_timegate_sides_on.png", + "moremesecons_timegate_sides_on.png" }, groups = {bendy=2,snappy=1,dig_immediate=2, not_in_creative_inventory=1}, mesecons = { receptor = { state = mesecon.state.on, - rules = temporarygate_get_output_rules + rules = timegate_get_output_rules }, effector = { - rules = temporarygate_get_input_rules, + rules = timegate_get_input_rules, } }, }) minetest.register_craft({ - output = "moremesecons_temporarygate:temporarygate_off 2", + output = "moremesecons_timegate:timegate_off 2", recipe = { {"group:mesecon_conductor_craftable", "mesecons_delayer:delayer_off_1", "group:mesecon_conductor_craftable"}, {"default:wood","default:wood", "default:wood"}, } }) + +minetest.register_alias("moremesecons_temporarygate:temporarygate_off", "moremesecons_timegate:timegate_off") +minetest.register_alias("moremesecons_temporarygate:temporarygate_on", "moremesecons_timegate:timegate_on") diff --git a/moremesecons_temporarygate/textures/moremesecons_temporarygate_bottom.png b/moremesecons_timegate/textures/moremesecons_timegate_bottom.png similarity index 100% rename from moremesecons_temporarygate/textures/moremesecons_temporarygate_bottom.png rename to moremesecons_timegate/textures/moremesecons_timegate_bottom.png diff --git a/moremesecons_temporarygate/textures/moremesecons_temporarygate_ends_off.png b/moremesecons_timegate/textures/moremesecons_timegate_ends_off.png similarity index 100% rename from moremesecons_temporarygate/textures/moremesecons_temporarygate_ends_off.png rename to moremesecons_timegate/textures/moremesecons_timegate_ends_off.png diff --git a/moremesecons_temporarygate/textures/moremesecons_temporarygate_ends_on.png b/moremesecons_timegate/textures/moremesecons_timegate_ends_on.png similarity index 100% rename from moremesecons_temporarygate/textures/moremesecons_temporarygate_ends_on.png rename to moremesecons_timegate/textures/moremesecons_timegate_ends_on.png diff --git a/moremesecons_temporarygate/textures/moremesecons_temporarygate_off.png b/moremesecons_timegate/textures/moremesecons_timegate_off.png similarity index 100% rename from moremesecons_temporarygate/textures/moremesecons_temporarygate_off.png rename to moremesecons_timegate/textures/moremesecons_timegate_off.png diff --git a/moremesecons_temporarygate/textures/moremesecons_temporarygate_on.png b/moremesecons_timegate/textures/moremesecons_timegate_on.png similarity index 100% rename from moremesecons_temporarygate/textures/moremesecons_temporarygate_on.png rename to moremesecons_timegate/textures/moremesecons_timegate_on.png diff --git a/moremesecons_temporarygate/textures/moremesecons_temporarygate_sides_off.png b/moremesecons_timegate/textures/moremesecons_timegate_sides_off.png similarity index 100% rename from moremesecons_temporarygate/textures/moremesecons_temporarygate_sides_off.png rename to moremesecons_timegate/textures/moremesecons_timegate_sides_off.png diff --git a/moremesecons_temporarygate/textures/moremesecons_temporarygate_sides_on.png b/moremesecons_timegate/textures/moremesecons_timegate_sides_on.png similarity index 100% rename from moremesecons_temporarygate/textures/moremesecons_temporarygate_sides_on.png rename to moremesecons_timegate/textures/moremesecons_timegate_sides_on.png