forked from minetest-mods/technic
Compare commits
17 Commits
d5df30c3ff
...
master
Author | SHA1 | Date | |
---|---|---|---|
88f42539bb | |||
b2a124dd83 | |||
34f2894321 | |||
fb4fef783b | |||
4a9ad94bf9 | |||
f3828c1943 | |||
0e10e8360d | |||
fbc4cc8511 | |||
904800abde | |||
1a45ad19d4 | |||
e90b28895c | |||
7696546d47 | |||
da95be53ec | |||
76a39e71b9 | |||
08b660ba99 | |||
cb84439266 | |||
c41f6509cf |
@ -142,7 +142,7 @@ local iclipfence_def = {
|
||||
|
||||
local sclip_tex = {
|
||||
"technic_insulator_clip.png",
|
||||
{ name = "strut.png^steel_strut_overlay.png", color = "white" },
|
||||
{ name = "strut.png^technic_steel_strut_overlay.png", color = "white" },
|
||||
{ name = "strut.png", color = "white" }
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -21,6 +21,9 @@ celeron55 (Perttu Ahola) modified by Zefram (CC BY-SA 3.0):
|
||||
sdzen (Elise Staudter) (CC BY-SA 3.0):
|
||||
* most of the older 16x16 textures
|
||||
|
||||
leftshift (CC BY-SA 3.0):
|
||||
* technic_river_water_can.png
|
||||
|
||||
RealBadAngel: (WTFPL)
|
||||
* Everything else.
|
||||
|
||||
@ -32,4 +35,4 @@ veikk0 (Veikko Mäkelä) (CC BY-SA 4.0):
|
||||
* technic_hv_nuclear_reactor_siren_danger_loop.ogg
|
||||
* Derived from "Nuclear alarm.wav" by Freesound.org user rene___ from <https://freesound.org/people/rene___/sounds/56778/>. Originally licensed under CC0 1.0 <https://creativecommons.org/publicdomain/zero/1.0/>
|
||||
|
||||
CC BY-SA 4.0: <https://creativecommons.org/licenses/by-sa/4.0/>
|
||||
CC BY-SA 4.0: <https://creativecommons.org/licenses/by-sa/4.0/>
|
||||
|
@ -64,6 +64,10 @@ Registration functions
|
||||
### Specific machines
|
||||
* `technic.register_solar_array(data)`
|
||||
* data is a table
|
||||
* `technic.can_insert_unique_stack(pos, node, stack, direction)`
|
||||
* `technic.insert_object_unique_stack(pos, node, stack, direction)`
|
||||
* Functions for the parameters `can_insert` and `insert_object` to avoid
|
||||
filling multiple inventory slots with same type of item.
|
||||
|
||||
Used itemdef fields
|
||||
-------------------
|
||||
|
@ -8,30 +8,30 @@
|
||||
Silicon Wafer = Tranche de silicium
|
||||
Doped Silicon Wafer = Tranche de silicium doppée
|
||||
Enriched Uranium = Uranium enrichi
|
||||
Uranium Fuel = Carburant d'uranium
|
||||
Diamond Drill Head = Tête de forage au diamant
|
||||
Uranium Fuel = Uranium 235
|
||||
Diamond Drill Head = Tête de forage en diamant
|
||||
Blue Energy Crystal = Cristal d'énergie bleu
|
||||
Green Energy Crystal = Cristal d'énergie vert
|
||||
Red Energy Crystal = Cristal d'énergie rouge
|
||||
Fine Copper Wire = Fil fin en cuivre
|
||||
Fine Gold Wire = Fil fin en or
|
||||
Fine Silver Wire = Fil fin en argent
|
||||
Fine Copper Wire = Fil en cuivre fin
|
||||
Fine Gold Wire = Fil en or fin
|
||||
Fine Silver Wire = Fil en argent fin
|
||||
Copper Coil = Bobine de cuivre
|
||||
Electric Motor = Moteur électrique
|
||||
Low Voltage Transformer = Transformateur basse tension
|
||||
Medium Voltage Transformer = Transformateur moyenne tension
|
||||
High Voltage Transformer = Transformateur haute tension
|
||||
Control Logic Unit = Unité de contrôle logique
|
||||
Mixed Metal Ingot = Lingot de métal mélangé
|
||||
Mixed Metal Ingot = Lingot de métal allié
|
||||
Composite Plate = Plaque composite
|
||||
Copper Plate = Plaque de cuivre
|
||||
Carbon Plate = Plaque de carbone
|
||||
Graphite = Graphite
|
||||
Carbon Cloth = Fibre de carbone
|
||||
Raw Latex = Latex brut
|
||||
Rubber Fiber = Fibre de latex
|
||||
Rubber Fiber = Fibre de caoutchouc
|
||||
%.1f%%-Fissile Uranium Ingot = Lingot d'uranium fissile (%.1f%%)
|
||||
%.1f%%-Fissile Uranium Block = Block d'uranium fissile (%.1f%%)
|
||||
%.1f%%-Fissile Uranium Block = Bloc d'uranium fissile (%.1f%%)
|
||||
|
||||
## Machine misc
|
||||
Machine cannot be removed because it is not empty = La machine ne peut pas être retirée car elle n'est pas vide
|
||||
@ -49,21 +49,21 @@ Inventory move disallowed due to protection = Le mouvement d'inventa
|
||||
%s Out Of Fuel = %s plus de carburant
|
||||
%s Has Bad Cabling = %s est mal cablé
|
||||
%s (Slave) = %s (esclave)
|
||||
%s Has No Network = %s n'est pas en réseau
|
||||
%s Finished = %s finit
|
||||
%s Has No Network = %s n'a pas de réseau
|
||||
%s Finished = %s a fini
|
||||
Enable/Disable = Activer/Désactiver
|
||||
Range = Plage
|
||||
Upgrade Slots = Emplacement d'amélioration
|
||||
In: = Entrée :
|
||||
Out: = Sortie :
|
||||
Slot %d = Emplacement %d
|
||||
Itemwise =
|
||||
Stackwise =
|
||||
Itemwise = Item par Item
|
||||
Stackwise = Stack par Stack
|
||||
Ignoring Mesecon Signal = Ignorer le signal Mesecon
|
||||
Controlled by Mesecon Signal = Contrôlé par signal Mesecon
|
||||
Owner: = Propriétaire :
|
||||
Unlocked = Dévérouillé
|
||||
Locked = Vérouillé
|
||||
Unlocked = Déverrouillé
|
||||
Locked = Verrouillé
|
||||
Radius: = Rayon :
|
||||
Enabled = Activé
|
||||
Disabled = Désactivé
|
||||
@ -80,13 +80,13 @@ Disabled = Désactivé
|
||||
%s Forcefield Emitter = Emetteur de champ de force %s
|
||||
%s Furnace = Four %s
|
||||
%s Grinder = Broyeur %s
|
||||
%s Music Player = Poste de musique %s
|
||||
%s Quarry = Mineur %s
|
||||
%s Music Player = Grammophone %s
|
||||
%s Quarry = Carrière %s
|
||||
%s Tool Workshop = Atelier d'outillage %s
|
||||
Arrayed Solar %s Generator = Générateur solaire %s
|
||||
Fuel-Fired %s Generator = Générateur à carburant
|
||||
Fuel-Fired %s Generator = Générateur thermique %s
|
||||
Geothermal %s Generator = Géénarteur géothermique %s
|
||||
Hydro %s Generator = Générateur hydro %s
|
||||
Hydro %s Generator = Générateur hydroélectrique %s
|
||||
Nuclear %s Generator Core = Générateur nucléaire %
|
||||
Small Solar %s Generator = Petit générateur solaire %s
|
||||
Wind %s Generator = Générateur éolien %s
|
||||
@ -99,7 +99,7 @@ Template (replacing) =
|
||||
Template Motor =
|
||||
Template Tool =
|
||||
Battery Box = Compartiment à batterie
|
||||
Supply Converter = Convertisseur d'alimentation
|
||||
Supply Converter = Convertisseur de tension
|
||||
Switching Station = Station de commutation
|
||||
Fuel-Fired Alloy Furnace = Four à alliage à carburant
|
||||
Fuel-Fired Furnace = Four à carburant
|
||||
@ -168,7 +168,7 @@ Wooden = Bois
|
||||
|
||||
## Grinder Recipes
|
||||
# $1: Name
|
||||
%s Dust = Poudre - %s
|
||||
%s Dust = Poudre de %s
|
||||
Akalin =
|
||||
Alatro =
|
||||
Arol =
|
||||
@ -185,7 +185,7 @@ Silver = Argent
|
||||
Stainless Steel = Acier inoxydable
|
||||
Talinite = Talanite
|
||||
Tin = Etain
|
||||
Wrought Iron = Fer forgé
|
||||
Wrought Iron = Fer
|
||||
Zinc = Zinc
|
||||
%.1f%%-Fissile Uranium = Uranium fissile (%.1f%%)
|
||||
|
||||
@ -193,8 +193,8 @@ Zinc = Zinc
|
||||
RE Battery = Batterie RE
|
||||
Water Can = Jerrycan d'eau
|
||||
Lava Can = Jerrycan de lave
|
||||
Chainsaw = Trançonneuse
|
||||
Flashlight = Lampe torche
|
||||
Chainsaw = Tronçonneuse
|
||||
Flashlight = Lampe-torche
|
||||
3 nodes deep. =
|
||||
3 nodes tall. =
|
||||
3 nodes wide. =
|
||||
@ -204,12 +204,12 @@ Mining Drill Mk%d Mode %d = Foreuse Mk%d Mode %d
|
||||
Mining Drill Mk%d = Foreuse Mk%d
|
||||
Mining Laser Mk%d = Foreuse laser Mk%d
|
||||
Single node. = Mode simple.
|
||||
Sonic Screwdriver = Tournevis sonique
|
||||
Tree Tap = Taraud à latex
|
||||
Sonic Screwdriver = Tournevis supersonique
|
||||
Tree Tap = Robinet à sève
|
||||
|
||||
## Craft descriptions
|
||||
Alloy cooking = Fonderie d'alliage
|
||||
Grinding = Broyage
|
||||
Compressing = Compression
|
||||
Extracting = Extraction
|
||||
Separating = Séparat
|
||||
Separating = Séparation
|
||||
|
@ -95,7 +95,7 @@ minetest.register_node("technic:injector", {
|
||||
if meta:get_int("splitstacks") == 1 then
|
||||
stack = stack:peek_item(1)
|
||||
end
|
||||
return meta:get_inventory():room_for_item("main", stack)
|
||||
return inv:room_for_item("main", stack)
|
||||
end,
|
||||
insert_object = function(pos, node, stack, direction)
|
||||
return minetest.get_meta(pos):get_inventory():add_item("main", stack)
|
||||
|
@ -1,10 +1,50 @@
|
||||
|
||||
local S = technic.getter
|
||||
|
||||
function technic.insert_object_unique_stack(pos, node, incoming_stack, direction)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local inv = meta:get_inventory()
|
||||
local incoming_name = incoming_stack:get_name()
|
||||
local stack_index = nil
|
||||
for inv_index, inv_stack in pairs(inv:get_list("src")) do
|
||||
if inv_stack:get_name() == incoming_name then
|
||||
stack_index = inv_index
|
||||
break
|
||||
end
|
||||
end
|
||||
if stack_index == nil then
|
||||
return inv:add_item("src", incoming_stack)
|
||||
end
|
||||
local present_stack = inv:get_stack("src", stack_index)
|
||||
local leftover = present_stack:add_item(incoming_stack)
|
||||
inv:set_stack("src", stack_index, present_stack)
|
||||
return leftover
|
||||
end
|
||||
|
||||
function technic.can_insert_unique_stack(pos, node, incoming_stack, direction)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local inv = meta:get_inventory()
|
||||
local incoming_name = incoming_stack:get_name()
|
||||
if meta:get_int("splitstacks") == 0 then
|
||||
-- avoid looping second time with inv:contains_item("src", incoming_stack)
|
||||
for _, inv_stack in pairs(inv:get_list("src")) do
|
||||
if inv_stack:get_name() == incoming_name then
|
||||
return inv_stack:item_fits(incoming_stack)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return technic.default_can_insert(pos, node, incoming_stack, direction)
|
||||
end
|
||||
|
||||
function technic.register_alloy_furnace(data)
|
||||
data.typename = "alloy"
|
||||
data.machine_name = "alloy_furnace"
|
||||
data.machine_desc = S("%s Alloy Furnace")
|
||||
|
||||
data.insert_object = technic.insert_object_unique_stack
|
||||
data.can_insert = technic.can_insert_unique_stack
|
||||
|
||||
technic.register_base_machine(data)
|
||||
end
|
||||
|
||||
|
@ -452,7 +452,7 @@ function technic.discharge_tools(meta, batt_charge, charge_step, max_charge)
|
||||
if inv:is_empty("dst") then
|
||||
return batt_charge, false
|
||||
end
|
||||
srcstack = inv:get_stack("dst", 1)
|
||||
local srcstack = inv:get_stack("dst", 1)
|
||||
local toolname = srcstack:get_name()
|
||||
if technic.power_tools[toolname] == nil then
|
||||
return batt_charge, false
|
||||
|
@ -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
|
||||
|
@ -15,6 +15,7 @@ if minetest.get_modpath("dye") then
|
||||
-- register recipes with the same crafting ratios as `dye` provides
|
||||
local dye_recipes = {
|
||||
{"technic:coal_dust", "dye:black 2"},
|
||||
{"default:blueberries", "dye:violet 2"},
|
||||
{"default:grass_1", "dye:green 1"},
|
||||
{"default:dry_shrub", "dye:brown 1"},
|
||||
{"default:junglegrass", "dye:green 2"},
|
||||
|
@ -4,22 +4,26 @@ local S = technic.getter
|
||||
local fs_helpers = pipeworks.fs_helpers
|
||||
local tube_entry = "^pipeworks_tube_connection_metallic.png"
|
||||
|
||||
local tube = {
|
||||
insert_object = function(pos, node, stack, direction)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local inv = meta:get_inventory()
|
||||
return inv:add_item("src", stack)
|
||||
end,
|
||||
can_insert = function(pos, node, stack, direction)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local inv = meta:get_inventory()
|
||||
if meta:get_int("splitstacks") == 1 then
|
||||
stack = stack:peek_item(1)
|
||||
end
|
||||
return inv:room_for_item("src", stack)
|
||||
end,
|
||||
connect_sides = {left = 1, right = 1, back = 1, top = 1, bottom = 1},
|
||||
}
|
||||
function technic.default_can_insert(pos, node, stack, direction)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local inv = meta:get_inventory()
|
||||
if meta:get_int("splitstacks") == 1 then
|
||||
stack = stack:peek_item(1)
|
||||
end
|
||||
return inv:room_for_item("src", stack)
|
||||
end
|
||||
|
||||
function technic.new_default_tube()
|
||||
return {
|
||||
insert_object = function(pos, node, stack, direction)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local inv = meta:get_inventory()
|
||||
return inv:add_item("src", stack)
|
||||
end,
|
||||
can_insert = technic.default_can_insert,
|
||||
connect_sides = {left = 1, right = 1, back = 1, top = 1, bottom = 1},
|
||||
}
|
||||
end
|
||||
|
||||
local connect_default = {"bottom", "back", "left", "right"}
|
||||
|
||||
@ -64,6 +68,14 @@ function technic.register_base_machine(data)
|
||||
"listring[current_player;main]"
|
||||
end
|
||||
|
||||
local tube = technic.new_default_tube()
|
||||
if data.can_insert then
|
||||
tube.can_insert = data.can_insert
|
||||
end
|
||||
if data.insert_object then
|
||||
tube.insert_object = data.insert_object
|
||||
end
|
||||
|
||||
local run = function(pos, node)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local inv = meta:get_inventory()
|
||||
@ -144,6 +156,7 @@ function technic.register_base_machine(data)
|
||||
if ltier == "lv" then
|
||||
tentry = ""
|
||||
end
|
||||
|
||||
minetest.register_node("technic:"..ltier.."_"..machine_name, {
|
||||
description = machine_desc:format(tier),
|
||||
tiles = {
|
||||
|
@ -294,6 +294,8 @@ local function calculate_damage_multiplier(object)
|
||||
end
|
||||
if ag.radiation then
|
||||
return 0.01 * ag.radiation
|
||||
elseif armor_enabled then
|
||||
return 0
|
||||
end
|
||||
if ag.fleshy then
|
||||
return math.sqrt(0.01 * ag.fleshy)
|
||||
|
BIN
technic/textures/technic_river_water_can.png
Normal file
BIN
technic/textures/technic_river_water_can.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 346 B |
@ -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
|
||||
@ -112,3 +115,21 @@ minetest.register_craft({
|
||||
{'technic:zinc_ingot', 'technic:stainless_steel_ingot', 'technic:zinc_ingot'},
|
||||
}
|
||||
})
|
||||
|
||||
technic.register_can({
|
||||
can_name = 'technic:river_water_can',
|
||||
can_description = S("River Water Can"),
|
||||
can_inventory_image = "technic_river_water_can.png",
|
||||
can_capacity = 16,
|
||||
liquid_source_name = "default:river_water_source",
|
||||
liquid_flowing_name = "default:river_water_flowing",
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:river_water_can 1',
|
||||
recipe = {
|
||||
{'technic:zinc_ingot', 'technic:rubber', 'technic:zinc_ingot'},
|
||||
{'default:steel_ingot', '', 'default:steel_ingot'},
|
||||
{'technic:zinc_ingot', 'default:steel_ingot', 'technic:zinc_ingot'},
|
||||
}
|
||||
})
|
||||
|
@ -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',
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -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',
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -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',
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -1,18 +1,18 @@
|
||||
# technic_chests translation template
|
||||
|
||||
%s Chest = Coffre en %s
|
||||
%s Locked Chest = Coffre vérouillé en %s
|
||||
%s Locked Chest (owned by %s) = Coffre vérouillé en %s (appartenant à %s)
|
||||
%s Locked Chest = Coffre verrouillé en %s
|
||||
%s Locked Chest (owned by %s) = Coffre verrouillé en %s (appartient à %s)
|
||||
Color Filter: %s = Filtre couleur : %s
|
||||
Edit chest description: = Editer la descrition du coffre
|
||||
Edit chest description: = Editer la description du coffre
|
||||
|
||||
# Colors
|
||||
Black = Noir
|
||||
Blue = Bleu
|
||||
Brown = Marron
|
||||
Cyan = Cyan
|
||||
Dark Green = Vert sombre
|
||||
Dark Grey = Gris sombre
|
||||
Dark Green = Vert foncé
|
||||
Dark Grey = Gris foncé
|
||||
Green = Vert
|
||||
Grey = Gris
|
||||
Magenta = Magenta
|
||||
@ -25,15 +25,15 @@ Yellow = Jaune
|
||||
None = Rien
|
||||
|
||||
# Materials
|
||||
Copper = Cuivre
|
||||
Gold = Or
|
||||
Iron = Fer
|
||||
Mithril = Mithril
|
||||
Silver = Argent
|
||||
Wooden = Bois
|
||||
Copper = cuivre
|
||||
Gold = or
|
||||
Iron = fer
|
||||
Mithril = mithril
|
||||
Silver = argent
|
||||
Wooden = bois
|
||||
|
||||
# Sorting
|
||||
Sort = Tri
|
||||
Auto-sort is %s = Tri automatique %s
|
||||
Off = inactivé
|
||||
Off = désactivé
|
||||
On = activé
|
||||
|
@ -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',
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -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
|
||||
|
@ -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',
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -59,7 +59,7 @@ else
|
||||
if minetest.is_protected(pos, player:get_player_name()) then
|
||||
return 0
|
||||
end
|
||||
return stack:get_count()
|
||||
return count
|
||||
end
|
||||
|
||||
can_dig = function(pos, player)
|
||||
|
Reference in New Issue
Block a user