Skip to content

Commit

Permalink
Merge branch 'master' into ehlphabetSupport
Browse files Browse the repository at this point in the history
  • Loading branch information
SwissalpS authored Dec 31, 2024
2 parents 2f6613a + accb035 commit c71b264
Show file tree
Hide file tree
Showing 6 changed files with 134 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
unused_args = false
--std = "luanti+max"

globals = {
"wrench",
Expand All @@ -10,13 +11,16 @@ read_globals = {
"table.indexof",
"minetest",
"ItemStack",
"barter",
"beacon",
"christmas",
"digilines",
"drawers",
"jumpdrive",
"mesecon",
"pipeworks",
"signs_lib",
"smartshop",
"spacecannon",
"xdecor",
"bones",
Expand Down
3 changes: 3 additions & 0 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ local mods = {
"bones",
"christmas",
"connected_chests",
"currency",
"default",
"digibuilder",
"digilines",
Expand All @@ -38,6 +39,7 @@ local mods = {
"digtron",
"drawers",
"ehlphabet",
"jumpdrive",
"easyvend",
"mesecons_commandblock",
"mesecons_detector",
Expand All @@ -51,6 +53,7 @@ local mods = {
"powerbanks",
"protector",
"signs_lib",
"smartshop",
"spacecannon",
"soundblock",
"technic",
Expand Down
3 changes: 3 additions & 0 deletions mod.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ optional_depends = """
biofuel,
bones,
connected_chests,
currency,
christmas,
default,
digtron,
Expand All @@ -17,6 +18,7 @@ optional_depends = """
digistuff,
drawers,
ehlphabet,
jumpdrive,
easyvend,
mesecons_commandblock,
mesecons_detector,
Expand All @@ -30,6 +32,7 @@ optional_depends = """
powerbanks,
protector,
signs_lib,
smartshop,
spacecannon,
soundblock,
technic,
Expand Down
42 changes: 42 additions & 0 deletions nodes/currency.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@

-- Register wrench support for the currency mod

wrench.register_node("currency:barter", {
lists = { "pl1", "pl2" },
metas = {
clean = wrench.META_TYPE_INT,
formspec = wrench.META_TYPE_IGNORE,
infotext = wrench.META_TYPE_IGNORE,
pl1 = wrench.META_TYPE_STRING,
pl2 = wrench.META_TYPE_STRING,
pl1step = wrench.META_TYPE_INT,
pl2step = wrench.META_TYPE_INT,
timer = wrench.META_TYPE_INT,
},
timer = true,
after_place = function(pos, player, stack, pointed)
barter.chest.update_formspec(core.get_meta(pos))
end,
})

wrench.register_node("currency:safe", {
lists = { "main" },
metas = {
infotext = wrench.META_TYPE_STRING,
owner = wrench.META_TYPE_STRING,
},
owned = true,
})

-- Unkown what happens if a shop is wrenched while a user is using it.
for _, name in ipairs({ "currency:shop", "currency:shop_empty" }) do
wrench.register_node(name, {
lists = { "customers_gave", "owner_gives", "owner_wants", "stock" },
metas = {
infotext = wrench.META_TYPE_STRING,
owner = wrench.META_TYPE_STRING,
},
owned = true,
})
end

40 changes: 40 additions & 0 deletions nodes/jumpdrive.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

-- Register wrench support for the jumpdrive mod

wrench.register_node("jumpdrive:engine", {
lists = {"main", "upgrade"},
metas = {
x = wrench.META_TYPE_INT,
y = wrench.META_TYPE_INT,
z = wrench.META_TYPE_INT,
radius = wrench.META_TYPE_INT,
powerstorage = wrench.META_TYPE_INT,
max_powerstorage = wrench.META_TYPE_INT,
power_requirement = wrench.META_TYPE_IGNORE,
owner = wrench.META_TYPE_STRING,
channel = wrench.META_TYPE_STRING,
infotext = wrench.META_TYPE_STRING,
formspec = wrench.META_TYPE_IGNORE, -- legacy field
HV_EU_input = wrench.META_TYPE_IGNORE,
HV_EU_demand = wrench.META_TYPE_IGNORE
},
after_place = function(pos)
jumpdrive.update_formspec(core.get_meta(pos), pos)
end,
})

wrench.register_node("jumpdrive:fleet_controller", {
lists = {"main"},
metas = {
x = wrench.META_TYPE_INT,
y = wrench.META_TYPE_INT,
z = wrench.META_TYPE_INT,
owner = wrench.META_TYPE_STRING,
channel = wrench.META_TYPE_STRING,
infotext = wrench.META_TYPE_STRING,
formspec = wrench.META_TYPE_STRING,
active = wrench.META_TYPE_INT,
jump_index = wrench.META_TYPE_INT,
jump_list = wrench.META_TYPE_STRING
}
})
42 changes: 42 additions & 0 deletions nodes/smartshop.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@

-- Register wrench support for the smartshop mod

wrench.register_node("smartshop:shop", {
lists = {
"give1", "give2", "give3", "give4",
"main",
"pay1", "pay2", "pay3", "pay4",
},
metas = {
alerted = wrench.META_TYPE_INT,
creative = wrench.META_TYPE_INT,
ghost = wrench.META_TYPE_INT,
infotext = wrench.META_TYPE_IGNORE,
owner = wrench.META_TYPE_STRING,
state = wrench.META_TYPE_IGNORE,
type = wrench.META_TYPE_INT,
},
after_pickup = function(pos)
-- Remove entities
if smartshop.update_entities then
smartshop.update_entities(pos, "clear")
else
-- Older version
smartshop.update(pos, "clear")
end
-- Give smartshop a chance to keep track of statistics
smartshop.update_info(pos)
end,
after_place = function(pos)
-- Update infotext
smartshop.update_info(pos)
-- Create entities
if smartshop.update_entities then
smartshop.update_entities(pos, "update")
else
-- Older version
smartshop.update(pos, "update")
end
end,
})

0 comments on commit c71b264

Please sign in to comment.