7 Commits

Author SHA1 Message Date
88f42539bb Fix error caused by locked chest recipes (#548) 2020-05-03 19:53:43 +02:00
b2a124dd83 Deal with lava cans wasting lava (#532)
Rather than replacing lava source with lava source, the lava can will now attempt to place lava to the node "above".
This change applies the same for all registered cans.
2020-05-01 21:24:12 +02:00
34f2894321 Update dependencies in manual.md (#547)
Add basic_materials to the list of dependencies in manual.md.
2020-05-01 21:11:53 +02:00
fb4fef783b Shapeless locked chests crafts (chest + lockpad) (#530)
This was only done for `default:chest`.
2020-04-26 11:33:12 +02:00
4a9ad94bf9 Fix chest formspec protection (#540)
This closes #539.
2020-04-26 11:32:42 +02:00
f3828c1943 Fix pipeworks link in manual (#533) 2020-03-15 17:29:18 +01:00
0e10e8360d Fix crash when placing cable plates (#534)
All coordinates can be equal if pointed_thing.above is identical
to pointed_thing.under.
2020-03-15 17:27:36 +01:00
9 changed files with 37 additions and 17 deletions

View File

@ -13,14 +13,16 @@ The technic modpack depends on some other modpacks:
signalling elements
* pipeworks, which supports the automation of item transport
* moreores, which provides some additional ore types
* basic_materials, which provides some basic craft items
This manual doesn't explain how to use these other modpacks, which have
their own manuals:
* [Minetest Game Documentation](https://wiki.minetest.net/Main_Page)
* [Mesecons Documentation](http://mesecons.net/items.html)
* [Pipeworks Documentation](https://github.com/minetest-mods/pipeworks/wiki)
* [Pipeworks Documentation](https://gitlab.com/VanessaE/pipeworks/-/wikis/home)
* [Moreores Forum Post](https://forum.minetest.net/viewtopic.php?t=549)
* [Basic materials Repository](https://gitlab.com/VanessaE/basic_materials)
Recipes for constructable items in technic are generally not guessable,
and are also not specifically documented here. You should use a

View File

@ -215,7 +215,7 @@ function technic.register_cable(tier, size)
if i == 1 then
def.on_place = function(itemstack, placer, pointed_thing)
local pointed_thing_diff = vector.subtract(pointed_thing.above, pointed_thing.under)
local num
local num = 1
local changed
for k, v in pairs(pointed_thing_diff) do
if v ~= 0 then
@ -225,7 +225,7 @@ function technic.register_cable(tier, size)
end
end
local crtl = placer:get_player_control()
if (crtl.aux1 or crtl.sneak) and not (crtl.aux1 and crtl.sneak) then
if (crtl.aux1 or crtl.sneak) and not (crtl.aux1 and crtl.sneak) and changed then
local fine_pointed = minetest.pointed_thing_to_face_pos(placer, pointed_thing)
fine_pointed = vector.subtract(fine_pointed, pointed_thing.above)
fine_pointed[changed] = nil

View File

@ -48,14 +48,17 @@ function technic.register_can(d)
on_place = function(itemstack, user, pointed_thing)
if pointed_thing.type ~= "node" then return end
local pos = pointed_thing.under
local def = minetest.registered_nodes[minetest.get_node(pos).name] or {}
local node_name = minetest.get_node(pos).name
local def = minetest.registered_nodes[node_name] or {}
if def.on_rightclick and user and not user:get_player_control().sneak then
return def.on_rightclick(pos, minetest.get_node(pos), user, itemstack, pointed_thing)
end
if not def.buildable_to then
if not def.buildable_to or node_name == data.liquid_source_name then
pos = pointed_thing.above
def = minetest.registered_nodes[minetest.get_node(pos).name] or {}
if not def.buildable_to then return end
node_name = minetest.get_node(pos).name
def = minetest.registered_nodes[node_name] or {}
-- Try to place node above the pointed source, or abort.
if not def.buildable_to or node_name == data.liquid_source_name then return end
end
local charge = get_can_level(itemstack)
if charge == 0 then return end

View File

@ -18,9 +18,10 @@ minetest.register_craft({
minetest.register_craft({
output = 'technic:copper_locked_chest 1',
type = "shapeless",
recipe = {
{'basic_materials:padlock'},
{'technic:copper_chest'},
'basic_materials:padlock',
'technic:copper_chest',
}
})

View File

@ -29,9 +29,10 @@ end
minetest.register_craft({
output = 'technic:gold_locked_chest',
type = "shapeless",
recipe = {
{'basic_materials:padlock'},
{'technic:gold_chest'},
'basic_materials:padlock',
'technic:gold_chest',
}
})

View File

@ -25,9 +25,10 @@ minetest.register_craft({
minetest.register_craft({
output = 'technic:iron_locked_chest 1',
type = "shapeless",
recipe = {
{'basic_materials:padlock'},
{'technic:iron_chest'},
'basic_materials:padlock',
'technic:iron_chest',
}
})

View File

@ -20,9 +20,10 @@ end
minetest.register_craft({
output = 'technic:mithril_locked_chest 1',
type = "shapeless",
recipe = {
{'basic_materials:padlock'},
{'technic:mithril_chest'},
'basic_materials:padlock',
'technic:mithril_chest',
}
})

View File

@ -159,6 +159,16 @@ local function get_receive_fields(name, data)
return function(pos, formname, fields, sender)
local meta = minetest.get_meta(pos)
local page = "main"
local owner = meta:get_string("owner")
if owner ~= "" then
-- prevent modification of locked chests
if owner ~= sender:get_player_name() then return end
elseif not fields.quit then
-- prevent modification of protected chests
if minetest.is_protected(pos, sender:get_player_name()) then return end
end
if fields.sort or (data.autosort and fields.quit and meta:get_int("autosort") == 1) then
sort_inventory(meta:get_inventory())
end

View File

@ -20,9 +20,10 @@ end
minetest.register_craft({
output = 'technic:silver_locked_chest',
type = "shapeless",
recipe = {
{'basic_materials:padlock'},
{'technic:silver_chest'},
'basic_materials:padlock',
'technic:silver_chest',
}
})