[technic (mp)] Update to Git commit a84b5f3 & patch 28875c7:

Commit: https://github.com/minetest-mods/technic/tree/a84b5f3
Patch: https://github.com/AntumMT/mp-technic/tree/28875c7
This commit is contained in:
AntumDeluge 2017-07-08 13:47:45 -07:00
parent 02f5a2a935
commit 110d388d06
3 changed files with 41 additions and 7 deletions

View File

@ -156,7 +156,7 @@ The game includes the mods from the default [minetest_game](https://github.com/m
* [mobf_core][animals] (part of "animals" modpack) ([CC BY-SA][lic.ccbysa3.0]) -- version: [1199ca9 Git][ver.mobf_core] *2017-01-14* ([patched][patch.mobf_core])
* [minetest_game][] ([LGPL][lic.lgpl2.1] / [CC BY-SA][lic.ccbysa3.0]) -- version: [f855bee Git][ver.minetest_game] *2017-06-06* ([patched][patch.minetest_game])
* [moremesecons][] ([MPL][lic.mpl2.0]) -- version: [aa2ae82 Git][ver.moremesecons] *2017-06-04*
* [technic][] ([LGPL][lic.lgpl2.0]) -- version: [d4162be9 Git][ver.technic] *2017-06-17* ([patched][patch.technic])
* [technic][] ([LGPL][lic.lgpl2.0]) -- version: [a84b5f3 Git][ver.technic] *2017-07-03* ([patched][patch.technic])
---
@ -503,7 +503,7 @@ The game includes the mods from the default [minetest_game](https://github.com/m
[ver.spawneggs]: https://github.com/thefamilygrog66/spawneggs/tree/4650370
[ver.spectator_mode]: https://github.com/minetest-mods/spectator_mode/tree/7d68bec
[ver.stairsplus]: https://github.com/CasimirKaPazi/stairsplus/tree/311e1f0
[ver.technic]: https://github.com/minetest-mods/technic/tree/d4162be9
[ver.technic]: https://github.com/minetest-mods/technic/tree/a84b5f3
[ver.throwing]: https://github.com/PilzAdam/throwing/tree/90bcf43
[ver.tnt]: https://github.com/PilzAdam/TNT/tree/d6a0b7d
[ver.tools_obsidian]: https://github.com/Dragonop/tools_obsidian/tree/f77fd79
@ -580,7 +580,7 @@ The game includes the mods from the default [minetest_game](https://github.com/m
[patch.simple_protection]: https://github.com/AntumMT/mod-simple_protection/tree/1b924d0
[patch.snowdrift]: https://github.com/AntumMT/mtmod-snowdrift/tree/1b9da4f
[patch.spawneggs]: https://github.com/AntumMT/mtmod-spawneggs/tree/f2cc4cc
[patch.technic]: https://github.com/AntumMT/mp-technic/tree/70ebc1e
[patch.technic]: https://github.com/AntumMT/mp-technic/tree/28875c7
[patch.throwing]: https://github.com/AntumMT/mtmod-throwing/tree/b33ffde
[patch.tools_obsidian]: https://github.com/AntumMT/mtmod-tools_obsidian/tree/2d19297
[patch.trash_can]: https://github.com/AntumMT/mtmod-trash_can/tree/5a92bf4

View File

@ -2,6 +2,7 @@
technic.networks = {}
technic.cables = {}
technic.redundant_warn = {}
local mesecons_path = minetest.get_modpath("mesecons")
local digilines_path = minetest.get_modpath("digilines")
@ -44,11 +45,15 @@ minetest.register_node("technic:switching_station",{
meta:set_string("active", 1)
meta:set_string("channel", "switching_station"..minetest.pos_to_string(pos))
meta:set_string("formspec", "field[channel;Channel;${channel}]")
local poshash = minetest.hash_node_position(pos)
technic.redundant_warn.poshash = nil
end,
after_dig_node = function(pos)
minetest.forceload_free_block(pos)
pos.y = pos.y - 1
minetest.forceload_free_block(pos)
local poshash = minetest.hash_node_position(pos)
technic.redundant_warn.poshash = nil
end,
on_receive_fields = function(pos, formname, fields, sender)
if not fields.channel then
@ -189,12 +194,29 @@ end
-----------------------------------------------
-- The action code for the switching station --
-----------------------------------------------
technic.powerctrl_state = true
minetest.register_chatcommand("powerctrl", {
params = "state",
description = "Enables or disables technic's switching station ABM",
privs = { basic_privs = true },
func = function(name, state)
if state == "on" then
technic.powerctrl_state = true
else
technic.powerctrl_state = false
end
end
})
minetest.register_abm({
nodenames = {"technic:switching_station"},
label = "Switching Station", -- allows the mtt profiler to profile this abm individually
interval = 1,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
if not technic.powerctrl_state then return end
local meta = minetest.get_meta(pos)
local meta1 = nil
local pos1 = {}
@ -217,6 +239,13 @@ minetest.register_abm({
minetest.forceload_free_block(pos)
minetest.forceload_free_block(pos1)
meta:set_string("infotext",S("%s Already Present"):format(machine_name))
local poshash = minetest.hash_node_position(pos)
if not technic.redundant_warn.poshash then
technic.redundant_warn.poshash = true
print("[TECHNIC] Warning: redundant switching station found near "..minetest.pos_to_string(pos))
end
return
end

View File

@ -24,10 +24,7 @@ local S = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end
local function get_meta_type(name, metaname)
local def = wrench.registered_nodes[name]
if not def or not def.metas or not def.metas[metaname] then
return nil
end
return def.metas[metaname]
return def and def.metas and def.metas[metaname] or nil
end
local function get_pickup_name(name)
@ -42,6 +39,14 @@ local function restore(pos, placer, itemstack)
local data = itemstack:get_meta():get_string("data")
data = (data ~= "" and data) or itemstack:get_metadata()
data = minetest.deserialize(data)
if not data then
minetest.remove_node(pos)
minetest.log("error", placer:get_player_name().." wanted to place "..
name.." at "..minetest.pos_to_string(pos)..
", but it had no data.")
minetest.log("verbose", "itemstack: "..itemstack:to_string())
return true
end
minetest.set_node(pos, {name = data.name, param2 = node.param2})
for name, value in pairs(data.metas) do
local meta_type = get_meta_type(data.name, name)