[technic (mp)] Update to Git commit bf58c77 & patch 3577609:
Commit: https://github.com/minetest-mods/technic/tree/bf58c77 Patch: https://github.com/AntumDeluge/mtmod-technic/tree/3577609
@ -168,7 +168,7 @@ The game includes the mods from the default [minetest_game](https://github.com/m
|
||||
* [minetest_game][] ([LGPL][lic.lgpl2.1] / [CC BY-SA][lic.ccbysa3.0]) -- version: [e523c3a Git][ver.minetest_game] *2017-05-20* ([patched][patch.minetest_game])
|
||||
* [moremesecons][] ([MPL][lic.mpl2.0]) -- version: [aa2ae82 Git][ver.moremesecons] *2017-06-04*
|
||||
* [mydoors][] ([CC-BY / CC-BY-SA][lic.mydoors] / [WTFPL][lic.wtfpl] / [DWYWFPL][lic.dwywpl]) -- version: [63aef13 Git][ver.mydoors] *2017-03-31* ([patched][patch.mydoors])
|
||||
* [technic][] ([LGPL][lic.lgpl2.0]) -- version: [cbe9743 Git][ver.technic] *2017-02-25* ([patched][patch.technic])
|
||||
* [technic][] ([LGPL][lic.lgpl2.0]) -- version: [bf58c77 Git][ver.technic] *2017-06-05* ([patched][patch.technic])
|
||||
|
||||
|
||||
---
|
||||
@ -474,7 +474,7 @@ The game includes the mods from the default [minetest_game](https://github.com/m
|
||||
[ver.spectator_mode]: https://github.com/minetest-mods/spectator_mode/tree/7d68bec
|
||||
[ver.spidermob]: https://github.com/Darcidride/minetest-spidermob-v1/tree/8f9080a
|
||||
[ver.stairsplus]: https://github.com/CasimirKaPazi/stairsplus/tree/311e1f0
|
||||
[ver.technic]: https://github.com/minetest-mods/technic/tree/cbe9743
|
||||
[ver.technic]: https://github.com/minetest-mods/technic/tree/bf58c77
|
||||
[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
|
||||
@ -538,7 +538,7 @@ The game includes the mods from the default [minetest_game](https://github.com/m
|
||||
[patch.snowdrift]: https://github.com/AntumDeluge/mtmod-snowdrift/tree/1b9da4f
|
||||
[patch.spawneggs]: https://github.com/AntumDeluge/mtmod-spawneggs/tree/03edd95
|
||||
[patch.spidermob]: https://github.com/AntumDeluge/mtmod-spidermob/tree/89b9bc4
|
||||
[patch.technic]: https://github.com/AntumDeluge/mtmod-technic/tree/661c23d
|
||||
[patch.technic]: https://github.com/AntumDeluge/mtmod-technic/tree/3577609
|
||||
[patch.trash_can]: https://github.com/AntumDeluge/mtmod-trash_can/tree/5a92bf4
|
||||
[patch.walking_light]: https://github.com/AntumDeluge/mtmod-walking_light/tree/8084572
|
||||
[patch.windmill]: https://github.com/AntumDeluge/mtmod-windmill/tree/7756ab4
|
||||
|
@ -1,3 +1,3 @@
|
||||
default
|
||||
intllib?
|
||||
craft_guide?
|
||||
|
||||
|
@ -94,9 +94,9 @@ minetest.register_node(":technic:blast_resistant_concrete", {
|
||||
|
||||
local box_platform = {-0.5, 0.3, -0.5, 0.5, 0.5, 0.5}
|
||||
local box_post = {-0.15, -0.5, -0.15, 0.15, 0.5, 0.15}
|
||||
local box_front = {-0.1, -0.3, 0, 0.1, 0.3, -0.5}
|
||||
local box_front = {-0.1, -0.3, -0.5, 0.1, 0.3, 0}
|
||||
local box_back = {-0.1, -0.3, 0, 0.1, 0.3, 0.5}
|
||||
local box_left = {0, -0.3, -0.1, -0.5, 0.3, 0.1}
|
||||
local box_left = {-0.5, -0.3, -0.1, 0, 0.3, 0.1}
|
||||
local box_right = {0, -0.3, -0.1, 0.5, 0.3, 0.1}
|
||||
|
||||
minetest.register_node(":technic:concrete_post_platform", {
|
||||
|
8
mods/modpacks/technic/concrete/locale/es.txt
Normal file
@ -0,0 +1,8 @@
|
||||
# technic_concrete traducido por Carlos Barraza
|
||||
|
||||
Rebar = Barra de refuerzo
|
||||
Concrete Block = Bloque de concreto
|
||||
Blast-resistant Concrete Block = Bloque de concreto resistente a explosiones
|
||||
Concrete Post Platform = Plataforma de concreto
|
||||
Concrete Post = Postes de concreto
|
||||
|
@ -1,5 +1,6 @@
|
||||
default
|
||||
technic_worldgen
|
||||
concrete
|
||||
unifieddyes?
|
||||
intllib?
|
||||
moreblocks?
|
||||
|
@ -101,3 +101,87 @@ if minetest.get_modpath("moreblocks") then
|
||||
register_technic_stairs_alias("stairsplus", "marble_bricks", "technic", "marble_bricks")
|
||||
|
||||
end
|
||||
|
||||
local iclip_def = {
|
||||
description = "Insulator/cable clip",
|
||||
drawtype = "mesh",
|
||||
mesh = "technic_insulator_clip.obj",
|
||||
tiles = {"technic_insulator_clip.png"},
|
||||
is_ground_content = false,
|
||||
groups = {choppy=1, snappy=1, oddly_breakable_by_hand=1 },
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
}
|
||||
|
||||
local iclipfence_def = {
|
||||
description = "Insulator/cable clip",
|
||||
tiles = {"technic_insulator_clip.png"},
|
||||
is_ground_content = false,
|
||||
paramtype = "light",
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
type = "connected",
|
||||
fixed = {
|
||||
{ -0.25, 0.75, -0.25, 0.25, 1.25, 0.25 }, -- the clip on top
|
||||
{ -0.125, 0.6875, -0.125, 0.125, 0.75, 0.125 },
|
||||
{ -0.1875, 0.625, -0.1875, 0.1875, 0.6875, 0.1875 },
|
||||
{ -0.125, 0.5625, -0.125, 0.125, 0.625, 0.125 },
|
||||
{ -0.1875, 0.5, -0.1875, 0.1875, 0.5625, 0.1875 },
|
||||
{ -0.125, 0.4375, -0.125, 0.125, 0.5, 0.125 },
|
||||
{ -0.1875, 0.375, -0.1875, 0.1875, 0.4375, 0.1875 },
|
||||
{ -0.125, -0.5, -0.125, 0.125, 0.375, 0.125 }, -- the post, slightly short
|
||||
},
|
||||
-- connect_top =
|
||||
-- connect_bottom =
|
||||
connect_front = {{-1/16,3/16,-1/2,1/16,5/16,-1/8},
|
||||
{-1/16,-5/16,-1/2,1/16,-3/16,-1/8}},
|
||||
connect_left = {{-1/2,3/16,-1/16,-1/8,5/16,1/16},
|
||||
{-1/2,-5/16,-1/16,-1/8,-3/16,1/16}},
|
||||
connect_back = {{-1/16,3/16,1/8,1/16,5/16,1/2},
|
||||
{-1/16,-5/16,1/8,1/16,-3/16,1/2}},
|
||||
connect_right = {{1/8,3/16,-1/16,1/2,5/16,1/16},
|
||||
{1/8,-5/16,-1/16,1/2,-3/16,1/16}},
|
||||
},
|
||||
connects_to = {"group:fence", "group:wood", "group:tree"},
|
||||
groups = {fence=1, choppy=1, snappy=1, oddly_breakable_by_hand=1 },
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
}
|
||||
|
||||
if minetest.get_modpath("unifieddyes") then
|
||||
iclip_def.paramtype2 = "colorwallmounted"
|
||||
iclip_def.palette = "unifieddyes_palette_colorwallmounted.png"
|
||||
iclip_def.after_place_node = function(pos, placer, itemstack, pointed_thing)
|
||||
unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing)
|
||||
unifieddyes.recolor_on_place(pos, placer, itemstack, pointed_thing)
|
||||
end
|
||||
iclip_def.after_dig_node = unifieddyes.after_dig_node
|
||||
iclip_def.groups = {choppy=1, snappy=1, oddly_breakable_by_hand=1, ud_param2_colorable = 1}
|
||||
|
||||
iclipfence_def.paramtype2 = "color"
|
||||
iclipfence_def.palette = "unifieddyes_palette_extended.png"
|
||||
iclipfence_def.on_construct = unifieddyes.on_construct
|
||||
iclipfence_def.after_place_node = unifieddyes.recolor_on_place
|
||||
iclipfence_def.after_dig_node = unifieddyes.after_dig_node
|
||||
iclipfence_def.groups = {fence=1, choppy=1, snappy=1, oddly_breakable_by_hand=1, ud_param2_colorable = 1}
|
||||
iclipfence_def.place_param2 = 171 -- medium amber, low saturation, closest color to default:wood
|
||||
end
|
||||
|
||||
minetest.register_node(":technic:insulator_clip", iclip_def)
|
||||
minetest.register_node(":technic:insulator_clip_fencepost", iclipfence_def)
|
||||
|
||||
minetest.register_craft({
|
||||
output = "technic:insulator_clip",
|
||||
recipe = {
|
||||
{ "", "dye:white", ""},
|
||||
{ "", "technic:raw_latex", ""},
|
||||
{ "technic:raw_latex", "default:stone", "technic:raw_latex"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "technic:insulator_clip_fencepost 2",
|
||||
recipe = {
|
||||
{ "", "dye:white", ""},
|
||||
{ "", "technic:raw_latex", ""},
|
||||
{ "technic:raw_latex", "default:fence_wood", "technic:raw_latex"},
|
||||
}
|
||||
})
|
||||
|
7
mods/modpacks/technic/extranodes/locale/es.txt
Normal file
@ -0,0 +1,7 @@
|
||||
# technic_extranodes traducido por Carlos Barraza
|
||||
|
||||
Marble = Mármol
|
||||
Marble Bricks = Ladrillos de mármol
|
||||
Granite = Granito
|
||||
Concrete = Concreto
|
||||
|
@ -0,0 +1,173 @@
|
||||
# Blender v2.72 (sub 0) OBJ File: ''
|
||||
# www.blender.org
|
||||
o Cube
|
||||
v -0.500000 -0.500000 0.500000
|
||||
v -0.500000 -0.500000 -0.500000
|
||||
v 0.500000 -0.500000 -0.500000
|
||||
v 0.500000 -0.500000 0.500000
|
||||
v -0.249997 0.500000 0.249997
|
||||
v -0.249997 0.500000 -0.249997
|
||||
v 0.249997 0.500000 -0.249997
|
||||
v 0.249997 0.500000 0.249997
|
||||
v -0.187500 0.500000 0.187500
|
||||
v -0.187500 0.500000 -0.187500
|
||||
v 0.187500 0.500000 -0.187500
|
||||
v 0.187500 0.500000 0.187500
|
||||
v -0.187500 0.750000 0.187500
|
||||
v -0.187500 0.750000 -0.187500
|
||||
v 0.187500 0.750000 -0.187500
|
||||
v 0.187500 0.750000 0.187500
|
||||
v -0.250000 0.750000 0.250000
|
||||
v -0.250000 0.750000 -0.250000
|
||||
v 0.250000 0.750000 -0.250000
|
||||
v 0.250000 0.750000 0.250000
|
||||
v -0.250000 1.250000 0.250000
|
||||
v -0.250000 1.250000 -0.250000
|
||||
v 0.250000 1.250000 -0.250000
|
||||
v 0.250000 1.250000 0.250000
|
||||
v -0.500000 0.312500 0.500000
|
||||
v -0.500000 0.312500 -0.500000
|
||||
v 0.500000 0.312500 -0.500000
|
||||
v 0.500000 0.312500 0.500000
|
||||
v 0.187500 0.625000 0.187500
|
||||
v 0.187500 0.625000 -0.187500
|
||||
v -0.187500 0.625000 -0.187500
|
||||
v -0.187500 0.625000 0.187500
|
||||
v 0.187500 0.562500 0.187500
|
||||
v 0.187500 0.687500 -0.187500
|
||||
v -0.187500 0.687500 -0.187500
|
||||
v -0.187500 0.562500 0.187500
|
||||
v 0.187500 0.687500 0.187500
|
||||
v 0.187500 0.562500 -0.187500
|
||||
v -0.187500 0.562500 -0.187500
|
||||
v -0.187500 0.687500 0.187500
|
||||
v 0.168668 0.531250 0.168668
|
||||
v 0.168668 0.718750 -0.168668
|
||||
v -0.168668 0.718750 -0.168668
|
||||
v -0.168668 0.531250 0.168668
|
||||
v 0.168668 0.656250 0.168668
|
||||
v 0.168668 0.593750 -0.168668
|
||||
v -0.168668 0.593750 -0.168668
|
||||
v -0.168668 0.656250 0.168668
|
||||
v 0.168668 0.593750 0.168668
|
||||
v 0.168668 0.656250 -0.168668
|
||||
v -0.168668 0.656250 -0.168668
|
||||
v -0.168668 0.593750 0.168668
|
||||
v 0.168668 0.718750 0.168668
|
||||
v 0.168668 0.531250 -0.168668
|
||||
v -0.168668 0.531250 -0.168668
|
||||
v -0.168668 0.718750 0.168668
|
||||
vt 1.000000 0.000000
|
||||
vt 1.000000 1.000000
|
||||
vt 0.000000 1.000000
|
||||
vt 0.000000 0.000000
|
||||
vt 0.749997 0.749997
|
||||
vt 0.749997 0.250003
|
||||
vt 0.250003 0.250003
|
||||
vt 0.250003 0.749997
|
||||
vt 0.000000 0.812500
|
||||
vt 1.000000 0.812500
|
||||
vt 0.312500 0.312500
|
||||
vt 0.312500 0.687500
|
||||
vt 0.687500 0.312500
|
||||
vt 0.687500 0.687500
|
||||
vt 0.331332 1.218750
|
||||
vt 0.668668 1.218750
|
||||
vt 0.687500 1.250000
|
||||
vt 0.312500 1.250000
|
||||
vt 0.750000 1.250000
|
||||
vt 0.750000 1.750000
|
||||
vt 0.250000 1.750000
|
||||
vt 0.250000 1.250000
|
||||
vt 0.331332 1.093750
|
||||
vt 0.668668 1.093750
|
||||
vt 0.687500 1.125000
|
||||
vt 0.312500 1.125000
|
||||
vt 0.331332 1.093750
|
||||
vt 0.668668 1.093750
|
||||
vt 0.331332 1.156250
|
||||
vt 0.668668 1.156250
|
||||
vt 0.687500 1.187500
|
||||
vt 0.312500 1.187500
|
||||
vt 0.331332 1.156250
|
||||
vt 0.668668 1.156250
|
||||
vt 0.331332 1.031250
|
||||
vt 0.668668 1.031250
|
||||
vt 0.687500 1.062500
|
||||
vt 0.312500 1.062500
|
||||
vt 0.312500 1.000000
|
||||
vt 0.687500 1.000000
|
||||
vn 0.000000 -1.000000 -0.000000
|
||||
vn -0.600000 0.800000 -0.000000
|
||||
vn 0.000000 0.800000 -0.600000
|
||||
vn 0.600000 0.800000 0.000000
|
||||
vn -0.000000 0.000000 1.000000
|
||||
vn 0.000000 1.000000 0.000000
|
||||
vn 0.856500 -0.516200 0.000000
|
||||
vn 0.000000 -0.516200 -0.856500
|
||||
vn -0.000000 -0.516200 0.856500
|
||||
vn -0.856500 -0.516200 -0.000000
|
||||
vn -1.000000 0.000000 -0.000000
|
||||
vn 0.000000 -0.000000 -1.000000
|
||||
vn 1.000000 -0.000000 0.000000
|
||||
vn -0.000000 0.800000 0.600000
|
||||
vn 0.856500 0.516200 0.000000
|
||||
vn 0.000000 0.516200 -0.856500
|
||||
vn -0.000000 0.516200 0.856500
|
||||
vn -0.856500 0.516200 -0.000000
|
||||
g Cube_Cube_Material
|
||||
s off
|
||||
f 1/1/1 2/2/1 3/3/1 4/4/1
|
||||
f 25/2/2 5/5/2 6/6/2 26/1/2
|
||||
f 26/1/3 6/6/3 7/7/3 27/4/3
|
||||
f 27/4/4 7/7/4 8/8/4 28/3/4
|
||||
f 25/9/5 1/4/5 4/1/5 28/10/5
|
||||
f 8/8/6 7/7/6 11/11/6 12/12/6
|
||||
f 7/7/6 6/6/6 10/13/6 11/11/6
|
||||
f 5/5/6 8/8/6 12/12/6 9/14/6
|
||||
f 6/6/6 5/5/6 9/14/6 10/13/6
|
||||
f 53/15/7 42/16/7 15/17/7 16/18/7
|
||||
f 42/15/8 43/16/8 14/17/8 15/18/8
|
||||
f 56/15/9 53/16/9 16/17/9 13/18/9
|
||||
f 43/15/10 56/16/10 13/17/10 14/18/10
|
||||
f 14/4/1 18/4/1 19/4/1 15/4/1
|
||||
f 17/19/11 21/20/11 22/21/11 18/22/11
|
||||
f 18/19/12 22/20/12 23/21/12 19/22/12
|
||||
f 19/19/13 23/20/13 24/21/13 20/22/13
|
||||
f 21/21/5 17/22/5 20/19/5 24/20/5
|
||||
f 21/5/6 24/8/6 23/7/6 22/6/6
|
||||
f 15/4/1 19/4/1 20/4/1 16/4/1
|
||||
f 16/4/1 20/4/1 17/4/1 13/4/1
|
||||
f 13/4/1 17/4/1 18/4/1 14/4/1
|
||||
f 1/1/11 25/10/11 26/9/11 2/4/11
|
||||
f 2/1/12 26/10/12 27/9/12 3/4/12
|
||||
f 3/1/13 27/10/13 28/9/13 4/4/13
|
||||
f 5/5/14 25/2/14 28/3/14 8/8/14
|
||||
f 49/23/7 46/24/7 30/25/7 29/26/7
|
||||
f 46/27/8 47/28/8 31/25/8 30/26/8
|
||||
f 52/23/9 49/24/9 29/25/9 32/26/9
|
||||
f 47/23/10 52/24/10 32/25/10 31/26/10
|
||||
f 45/29/7 50/30/7 34/31/7 37/32/7
|
||||
f 50/33/8 51/34/8 35/31/8 34/32/8
|
||||
f 48/33/9 45/34/9 37/31/9 40/32/9
|
||||
f 51/29/10 48/30/10 40/31/10 35/32/10
|
||||
f 41/35/7 54/36/7 38/37/7 33/38/7
|
||||
f 54/35/8 55/36/8 39/37/8 38/38/8
|
||||
f 44/35/9 41/36/9 33/37/9 36/38/9
|
||||
f 55/35/10 44/36/10 36/37/10 39/38/10
|
||||
f 37/32/15 34/31/15 42/16/15 53/15/15
|
||||
f 34/32/16 35/31/16 43/16/16 42/15/16
|
||||
f 40/32/17 37/31/17 53/16/17 56/15/17
|
||||
f 35/32/18 40/31/18 56/16/18 43/15/18
|
||||
f 33/38/15 38/37/15 46/24/15 49/23/15
|
||||
f 38/38/16 39/37/16 47/28/16 46/27/16
|
||||
f 36/38/17 33/37/17 49/24/17 52/23/17
|
||||
f 39/38/18 36/37/18 52/24/18 47/23/18
|
||||
f 29/26/15 30/25/15 50/30/15 45/29/15
|
||||
f 30/26/16 31/25/16 51/34/16 50/33/16
|
||||
f 32/26/17 29/25/17 45/34/17 48/33/17
|
||||
f 31/26/18 32/25/18 48/30/18 51/29/18
|
||||
f 12/39/15 11/40/15 54/36/15 41/35/15
|
||||
f 11/39/16 10/40/16 55/36/16 54/35/16
|
||||
f 9/39/17 12/40/17 41/36/17 44/35/17
|
||||
f 10/39/18 9/40/18 44/36/18 55/35/18
|
After Width: | Height: | Size: 226 B |
@ -766,14 +766,12 @@ source than by actual attenuation. Dirt halves radiation in 2.4 m,
|
||||
and stone in 1.7 m. When a shield must be deliberately constructed,
|
||||
the preferred materials are metals, the denser the better. Iron and
|
||||
steel halve radiation in 1.1 m, copper in 1.0 m, and silver in 0.95 m.
|
||||
Lead would halve in 0.69 m if it were in the game, but it's not, which
|
||||
poses a bit of a problem due to the drawbacks of the three materials in
|
||||
the game that are better shielding than silver. Gold halves radiation
|
||||
Lead would halve in 0.69 m (its in-game shielding value is 80). Gold halves radiation
|
||||
in 0.53 m (factor of 3.7 per meter), but is a bit scarce to use for
|
||||
this purpose. Uranium halves radiation in 0.31 m (factor of 9.4 per
|
||||
meter), but is itself radioactive. The very best shielding in the game
|
||||
is nyancat material (nyancats and their rainbow blocks), which halves
|
||||
radiation in 0.22 m (factor of 24 per meter), but is extremely scarce.
|
||||
radiation in 0.22 m (factor of 24 per meter), but is extremely scarce. See [technic/technic/radiation.lua](https://github.com/minetest-technic/technic/blob/master/technic/radiation.lua) for the in-game shielding values, which are different from real-life values.
|
||||
|
||||
If the theoretical radiation damage from a particular source is
|
||||
sufficiently small, due to distance and shielding, then no damage at all
|
||||
@ -963,7 +961,8 @@ The primary purpose of battery boxes is to temporarily store electrical
|
||||
energy to let an electrical network cope with mismatched supply and
|
||||
demand. They have a secondary purpose of charging and discharging
|
||||
powered tools. They are thus a mixture of electrical infrastructure,
|
||||
powered machine, and generator.
|
||||
powered machine, and generator. Battery boxes connect to cables only
|
||||
from the bottom.
|
||||
|
||||
MV and HV battery boxes have upgrade slots. Energy upgrades increase
|
||||
the capacity of a battery box, each by 10% of the un-upgraded capacity.
|
||||
@ -978,10 +977,10 @@ be worth building a battery box of higher tier before one has other
|
||||
infrastructure of that tier, just to get access to faster charging.
|
||||
|
||||
MV and HV battery boxes work with pneumatic tubes. An item can be input
|
||||
to the charging slot through the bottom of the battery box, or to the
|
||||
discharging slot through the top. Items are not accepted through the
|
||||
front, back, or sides. With a tube upgrade, fully charged/discharged
|
||||
tools (as appropriate for their slot) will be ejected through a side.
|
||||
to the charging slot through the sides or back of the battery box, or
|
||||
to the discharging slot through the top. With a tube upgrade, fully
|
||||
charged/discharged tools (as appropriate for their slot) will be ejected
|
||||
through a side.
|
||||
|
||||
### processing machines ###
|
||||
|
||||
@ -1245,12 +1244,12 @@ with light sources such as meselamps.
|
||||
|
||||
### hydro generator ###
|
||||
|
||||
The hydro generator is an LV power generator that generates a small amount
|
||||
of power from the natural motion of water. To operate, the generator must
|
||||
be horizontally adjacent to water. It doesn't matter whether the water
|
||||
consists of source blocks or flowing blocks. Having water adjacent on
|
||||
more than one side, up to the full four, increases the generator's output.
|
||||
The water itself is unaffected by the generator.
|
||||
The hydro generator is an LV power generator that generates a respectable
|
||||
amount of power from the natural motion of water. To operate, the
|
||||
generator must be horizontally adjacent to flowing water. The power
|
||||
produced is dependent on how much flow there is across any or all four
|
||||
sides, the most flow of course coming from water that's flowing straight
|
||||
down.
|
||||
|
||||
### geothermal generator ###
|
||||
|
||||
|
@ -25,3 +25,11 @@ RealBadAngel: (WTFPL)
|
||||
* Everything else.
|
||||
|
||||
CC BY-SA 3.0: <http://creativecommons.org/licenses/by-sa/3.0/>
|
||||
|
||||
Sound licenses:
|
||||
|
||||
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/>
|
@ -12,6 +12,7 @@ local defaults = {
|
||||
enable_radiation_protection = "true",
|
||||
enable_entity_radiation_damage = "true",
|
||||
enable_longterm_radiation_damage = "true",
|
||||
enable_nuclear_reactor_digiline_selfdestruct = "false",
|
||||
}
|
||||
|
||||
for k, v in pairs(defaults) do
|
||||
|
@ -1,6 +1,23 @@
|
||||
-- check if we have the necessary dependencies to allow actually using these materials in the crafts
|
||||
local mesecons_materials = minetest.get_modpath("mesecons_materials")
|
||||
|
||||
-- Remove some recipes
|
||||
-- Bronze
|
||||
minetest.clear_craft({
|
||||
type = "shapeless",
|
||||
output = "default:bronze_ingot"
|
||||
})
|
||||
|
||||
-- Accelerator tube
|
||||
minetest.clear_craft({
|
||||
output = "pipeworks:accelerator_tube_1",
|
||||
})
|
||||
|
||||
-- Teleport tube
|
||||
minetest.clear_craft({
|
||||
output = "pipeworks:teleport_tube_1",
|
||||
})
|
||||
|
||||
-- tubes crafting recipes
|
||||
|
||||
minetest.register_craft({
|
||||
@ -163,31 +180,15 @@ minetest.register_craft({
|
||||
},
|
||||
})
|
||||
|
||||
-- Remove some recipes
|
||||
-- Bronze
|
||||
|
||||
minetest.register_craft({
|
||||
output = "default:dirt 2",
|
||||
type = "shapeless",
|
||||
output = "default:bronze_ingot 0",
|
||||
recipe = {"default:copper_ingot", "default:steel_ingot"}
|
||||
})
|
||||
|
||||
-- Accelerator tube
|
||||
minetest.register_craft({
|
||||
output = "pipeworks:accelerator_tube_1 0",
|
||||
replacements = {{"bucket:bucket_water","bucket:bucket_empty"}},
|
||||
recipe = {
|
||||
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" },
|
||||
{ "default:mese_crystal_fragment", "default:steel_ingot", "default:mese_crystal_fragment" },
|
||||
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" }
|
||||
"technic:stone_dust",
|
||||
"group:leaves",
|
||||
"bucket:bucket_water",
|
||||
"group:sand",
|
||||
},
|
||||
})
|
||||
|
||||
-- Teleport tube
|
||||
minetest.register_craft({
|
||||
output = "pipeworks:teleport_tube_1 0",
|
||||
recipe = {
|
||||
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" },
|
||||
{ "default:desert_stone", "default:mese", "default:desert_stone" },
|
||||
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" }
|
||||
},
|
||||
})
|
||||
|
||||
|
@ -2,8 +2,11 @@ default
|
||||
pipeworks
|
||||
technic_worldgen
|
||||
bucket?
|
||||
screwdriver?
|
||||
mesecons?
|
||||
mesecons_mvps?
|
||||
digilines?
|
||||
digiline_remote?
|
||||
intllib?
|
||||
unified_inventory?
|
||||
vector_extras?
|
||||
craft_guide?
|
||||
|
130
mods/modpacks/technic/technic/doc/api.md
Normal file
@ -0,0 +1,130 @@
|
||||
This file is fairly incomplete. Help is welcome.
|
||||
|
||||
Tiers
|
||||
-----
|
||||
The tier is a string, currently `"LV"`, `"MV"` and `"HV"` are supported.
|
||||
|
||||
Network
|
||||
-------
|
||||
The network is the cable with the connected machine nodes. Currently the
|
||||
switching station handles the network activity.
|
||||
|
||||
Helper functions
|
||||
----------------
|
||||
* `technic.pretty_num(num)`
|
||||
* Converts the number `num` to a human-readable string.
|
||||
* Use this function when showing players power values.
|
||||
* `technic.swap_node(pos, nodename)`
|
||||
* Same as `mintest.swap_node` but it only changes the nodename.
|
||||
* It uses `minetest.get_node` before swapping to ensure the new nodename
|
||||
is not the same as the current one.
|
||||
* `technic.get_or_load_node(pos)`
|
||||
* If the mapblock is loaded, it returns the node at pos,
|
||||
else it loads the chunk and returns `nil`.
|
||||
* `technic.set_RE_wear(itemstack, item_load, max_charge)`
|
||||
* If the `wear_represents` field in the item's nodedef is
|
||||
`"technic_RE_charge"`, this function does nothing.
|
||||
* `technic.refill_RE_charge(itemstack)`
|
||||
* This function fully recharges an RE chargeable item.
|
||||
* If `technic.power_tools[itemstack:get_name()]` is `nil` (or `false`), this
|
||||
function does nothing, else that value is the maximum charge.
|
||||
* The itemstack metadata is changed to contain the charge.
|
||||
* `technic.is_tier_cable(nodename, tier)`
|
||||
* Tells whether the node `nodename` is the cable of the tier `tier`.
|
||||
* `technic.get_cable_tier(nodename)`
|
||||
* Returns the tier of the cable `nodename` or `nil`.
|
||||
* `technic.trace_node_ray(pos, dir, range)`
|
||||
* Returns an iteration function (usable in the for loop) to iterate over the
|
||||
node positions along the specified ray.
|
||||
* The returned positions will not include the starting position `pos`.
|
||||
* `technic.trace_node_ray_fat(pos, dir, range)`
|
||||
* Like `technic.trace_node_ray` but includes extra positions near the ray.
|
||||
* The node ray functions are used for mining lasers.
|
||||
* `technic.config:get(name)`
|
||||
* Some configuration function
|
||||
* `technic.tube_inject_item(pos, start_pos, velocity, item)`
|
||||
* Same as `pipeworks.tube_inject_item`
|
||||
|
||||
Registration functions
|
||||
----------------------
|
||||
* `technic.register_power_tool(itemname, max_charge)`
|
||||
* Same as `technic.power_tools[itemname] = max_charge`
|
||||
* This function makes the craftitem `itemname` chargeable.
|
||||
* `technic.register_machine(tier, nodename, machine_type)`
|
||||
* Same as `technic.machines[tier][nodename] = machine_type`
|
||||
* Currently this is requisite to make technic recognize your node.
|
||||
* See also `Machine types`
|
||||
* `technic.register_tier(tier)`
|
||||
* Same as `technic.machines[tier] = {}`
|
||||
* See also `tiers`
|
||||
|
||||
### Specific machines
|
||||
* `technic.register_solar_array(data)`
|
||||
* data is a table
|
||||
|
||||
Used itemdef fields
|
||||
-------------------
|
||||
* groups:
|
||||
* `technic_<ltier> = 1` ltier is a tier in small letters; this group makes
|
||||
the node connect to the cable(s) of the right tier.
|
||||
* `technic_machine = 1` Currently used for
|
||||
* `connect_sides`
|
||||
* In addition to the default use (see lua_api.txt), this tells where the
|
||||
machine can be connected.
|
||||
#
|
||||
#
|
||||
* `technic_run(pos, node)`
|
||||
* This function is currently used to update the node.
|
||||
Modders have to manually change the information about supply etc. in the
|
||||
node metadata.
|
||||
|
||||
Machine types
|
||||
-------------
|
||||
There are currently following types:
|
||||
* `technic.receiver = "RE"` e.g. grinder
|
||||
* `technic.producer = "PR"` e.g. solar panel
|
||||
* `technic.producer_receiver = "PR_RE"` supply converter
|
||||
* `technic.battery = "BA"` e.g. LV batbox
|
||||
|
||||
Switching Station
|
||||
-----------------
|
||||
The switching station is the center of all power distribution on an electric
|
||||
network.
|
||||
|
||||
The station collects power from sources (PR), distributes it to sinks (RE),
|
||||
and uses the excess/shortfall to charge and discharge batteries (BA).
|
||||
|
||||
For now, all supply and demand values are expressed in kW.
|
||||
|
||||
It works like this:
|
||||
All PR,BA,RE nodes are indexed and tagged with the switching station.
|
||||
The tagging is a workaround to allow more stations to be built without allowing
|
||||
a cheat with duplicating power.
|
||||
All the RE nodes are queried for their current EU demand. Those which are off
|
||||
would require no or a small standby EU demand, while those which are on would
|
||||
require more.
|
||||
If the total demand is less than the available power they are all updated with
|
||||
the demand number.
|
||||
If any surplus exists from the PR nodes the batteries will be charged evenly
|
||||
with this.
|
||||
If the total demand requires draw on the batteries they will be discharged
|
||||
evenly.
|
||||
|
||||
If the total demand is more than the available power all RE nodes will be shut
|
||||
down. We have a brown-out situation.
|
||||
|
||||
Hence for now all the power distribution logic resides in this single node.
|
||||
|
||||
### Node meta usage
|
||||
Nodes connected to the network will have one or more of these parameters as meta
|
||||
data:
|
||||
* `<LV|MV|HV>_EU_supply` : Exists for PR and BA node types.
|
||||
This is the EU value supplied by the node. Output
|
||||
* `<LV|MV|HV>_EU_demand` : Exists for RE and BA node types.
|
||||
This is the EU value the node requires to run. Output
|
||||
* `<LV|MV|HV>_EU_input` : Exists for RE and BA node types.
|
||||
This is the actual EU value the network can give the node. Input
|
||||
|
||||
The reason the LV|MV|HV type is prepended to meta data is because some machine
|
||||
could require several supplies to work.
|
||||
This way the supplies are separated per network.
|
@ -5,7 +5,7 @@
|
||||
local load_start = os.clock()
|
||||
|
||||
technic = rawget(_G, "technic") or {}
|
||||
technic.creative_mode = minetest.setting_getbool("creative_mode")
|
||||
technic.creative_mode = minetest.settings:get_bool("creative_mode")
|
||||
|
||||
|
||||
local modpath = minetest.get_modpath("technic")
|
||||
@ -47,7 +47,7 @@ dofile(modpath.."/tools/init.lua")
|
||||
-- Aliases for legacy node/item names
|
||||
dofile(modpath.."/legacy.lua")
|
||||
|
||||
if minetest.setting_getbool("log_mods") then
|
||||
if minetest.settings:get_bool("log_mods") then
|
||||
print(S("[Technic] Loaded in %f seconds"):format(os.clock() - load_start))
|
||||
end
|
||||
|
||||
|
@ -26,8 +26,8 @@ Graphite = Lastra in graffite
|
||||
Carbon Cloth = Fibra di carbonio
|
||||
Raw Latex = Latex grezzo
|
||||
Rubber Fiber = Fibra di gomma
|
||||
%.1f%%-Fissile Uranium Ingot =
|
||||
%.1f%%-Fissile Uranium Block =
|
||||
%.1f%%-Fissile Uranium Ingot = %.1f%%-Lingotto di uranio fissile
|
||||
%.1f%%-Fissile Uranium Block = %.1f%%-Blocco di uranio fissile
|
||||
|
||||
## Machine misc
|
||||
Machine cannot be removed because it is not empty = La macchina non può essere rimossa perchè non è vuota
|
||||
@ -36,7 +36,7 @@ Inventory move disallowed due to protection = Impossibile muovere l'inventario a
|
||||
@1 Active (@2 EU) = @1 Attivo (@2 EU)
|
||||
%s Active = %s Attivo
|
||||
%s Disabled = %s Disabilitato
|
||||
%s Enabled =
|
||||
%s Enabled = %s Abilitato
|
||||
%s Idle = %s Inattivo
|
||||
%s Improperly Placed = %s Piazzato impropiamente
|
||||
%s Unpowered = %s Non alimentato
|
||||
@ -46,18 +46,18 @@ Inventory move disallowed due to protection = Impossibile muovere l'inventario a
|
||||
%s Finished = %s Finito
|
||||
Enable/Disable = Abilita/Disabilita
|
||||
Range = Raggio
|
||||
Upgrade Slots =
|
||||
Upgrade Slots = Alloggi di aggiornamento
|
||||
In: = Ingresso:
|
||||
Out: = Uscita:
|
||||
Slot %d =
|
||||
Slot %d = Alloggio %d
|
||||
Itemwise = Singolo elemento
|
||||
Stackwise = pila completa
|
||||
Owner: =
|
||||
Unlocked =
|
||||
Locked =
|
||||
Radius: =
|
||||
Enabled =
|
||||
Disabled =
|
||||
Owner: = Proprietario:
|
||||
Unlocked = Non chiuso a chiave
|
||||
Locked = Chiuso a chiave
|
||||
Radius: = Raggio:
|
||||
Enabled = Abilitato
|
||||
Disabled = Disabilitato
|
||||
|
||||
## Machine names
|
||||
# $1: Tier
|
||||
@ -84,10 +84,10 @@ Self-Contained Injector = Ignettore
|
||||
Constructor Mk%d = Costruttore Mk%d
|
||||
Frame = Cornice
|
||||
Frame Motor = Cornice del motore
|
||||
Template =
|
||||
Template (replacing) = Template (rimpiazzato)
|
||||
Template Motor =
|
||||
Template Tool =
|
||||
Template = Sagoma
|
||||
Template (replacing) = Sagoma (di rimpiazzo)
|
||||
Template Motor = Motore per sagome
|
||||
Template Tool = Strumento per sagome
|
||||
Battery Box = Box batterie
|
||||
Supply Converter = Trasformatore
|
||||
Switching Station = Stazione di controllo
|
||||
@ -96,7 +96,7 @@ Fuel-Fired Furnace = Fornace a carbone
|
||||
Wind Mill Frame = Pala eolica
|
||||
Forcefield = Campo di forza
|
||||
Nuclear Reactor Rod Compartment = Compartimento combustibile nucleare
|
||||
Administrative World Anchor =
|
||||
Administrative World Anchor = Ancora-mondo amministrativa
|
||||
|
||||
## Machine-specific
|
||||
# $1: Pruduced EU
|
||||
@ -111,12 +111,12 @@ Production at %d%% = Produzione a %d%%
|
||||
Choose Milling Program: = Scegliere un programma di Fresatura
|
||||
Slim Elements half / normal height: = Metà elementi sottili / altezza normale:
|
||||
Current track %s = Traccia corrente %s
|
||||
Stopped =
|
||||
Keeping %d/%d map blocks loaded =
|
||||
Digging not started =
|
||||
Digging finished =
|
||||
Digging %d m above machine =
|
||||
Digging %d m below machine =
|
||||
Stopped = Fermato
|
||||
Keeping %d/%d map blocks loaded = Mantenimento di %d/%d blocchi mappa caricati
|
||||
Digging not started = Scavo non iniziato
|
||||
Digging finished = Scavo finito
|
||||
Digging %d m above machine = Scavo di %d m sopra la macchina
|
||||
Digging %d m below machine = Scavo di %d m sotto la macchina
|
||||
|
||||
## CNC
|
||||
Cylinder = Cilindro
|
||||
@ -174,10 +174,10 @@ Talinite = Talinite
|
||||
Tin = Stagno
|
||||
Wrought Iron = Ferro Battuto
|
||||
Zinc = Zinco
|
||||
%.1f%%-Fissile Uranium =
|
||||
%.1f%%-Fissile Uranium = %.1f%%-Uranio fissile
|
||||
|
||||
## Tools
|
||||
RE Battery =
|
||||
RE Battery = Batteria RE
|
||||
Water Can = Serbatoio d'acqua
|
||||
Lava Can = Serbatoio di lava
|
||||
Chainsaw = Motosega
|
||||
|
@ -1,4 +1,5 @@
|
||||
-- HV battery box
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:hv_battery_box0',
|
||||
recipe = {
|
||||
|
@ -6,16 +6,20 @@
|
||||
|
||||
-- How expensive is the generator?
|
||||
-- Leaves room for upgrades lowering the power drain?
|
||||
local digilines_path = minetest.get_modpath("digilines")
|
||||
|
||||
local forcefield_power_drain = 10
|
||||
|
||||
local S = technic.getter
|
||||
|
||||
local cable_entry = "^technic_cable_connection_overlay.png"
|
||||
|
||||
minetest.register_craft({
|
||||
output = "technic:forcefield_emitter_off",
|
||||
recipe = {
|
||||
{"default:mese", "technic:motor", "default:mese" },
|
||||
{"technic:deployer_off", "technic:machine_casing", "technic:deployer_off"},
|
||||
{"default:mese", "technic:hv_cable", "default:mese" },
|
||||
{"default:mese", "technic:motor", "default:mese" },
|
||||
{"technic:deployer_off", "technic:machine_casing", "technic:deployer_off"},
|
||||
{"default:mese", "technic:hv_cable", "default:mese" },
|
||||
}
|
||||
})
|
||||
|
||||
@ -90,7 +94,14 @@ local function update_forcefield(pos, meta, active, first)
|
||||
end
|
||||
|
||||
local function set_forcefield_formspec(meta)
|
||||
local formspec = "size[5,2.25]"..
|
||||
local formspec
|
||||
if digilines_path then
|
||||
formspec = "size[5,3.25]"..
|
||||
"field[0.3,3;5,1;channel;Digiline Channel;"..meta:get_string("channel").."]"
|
||||
else
|
||||
formspec = "size[5,2.25]"
|
||||
end
|
||||
formspec = formspec..
|
||||
"field[0.3,0.5;2,1;range;"..S("Range")..";"..meta:get_int("range").."]"
|
||||
-- The names for these toggle buttons are explicit about which
|
||||
-- state they'll switch to, so that multiple presses (arising
|
||||
@ -130,9 +141,10 @@ local forcefield_receive_fields = function(pos, formname, fields, sender)
|
||||
update_forcefield(pos, meta, false)
|
||||
end
|
||||
if range then meta:set_int("range", range) end
|
||||
if fields.shape0 then meta:set_int("shape", 0) end
|
||||
if fields.shape1 then meta:set_int("shape", 1) end
|
||||
if fields.enable then meta:set_int("enabled", 1) end
|
||||
if fields.channel then meta:set_string("channel", fields.channel) end
|
||||
if fields.shape0 then meta:set_int("shape", 0) end
|
||||
if fields.shape1 then meta:set_int("shape", 1) end
|
||||
if fields.enable then meta:set_int("enabled", 1) end
|
||||
if fields.disable then meta:set_int("enabled", 0) end
|
||||
if fields.mesecon_mode_0 then meta:set_int("mesecon_mode", 0) end
|
||||
if fields.mesecon_mode_1 then meta:set_int("mesecon_mode", 1) end
|
||||
@ -150,10 +162,89 @@ local mesecons = {
|
||||
}
|
||||
}
|
||||
|
||||
local digiline_def = {
|
||||
receptor = {action = function() end},
|
||||
effector = {
|
||||
action = function(pos, node, channel, msg)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if channel ~= meta:get_string("channel") then
|
||||
return
|
||||
end
|
||||
local msgt = type(msg)
|
||||
if msgt == "string" then
|
||||
local smsg = msg:lower()
|
||||
msg = {}
|
||||
if smsg == "get" then
|
||||
msg.command = "get"
|
||||
elseif smsg == "off" then
|
||||
msg.command = "off"
|
||||
elseif smsg == "on" then
|
||||
msg.command = "on"
|
||||
elseif smsg == "toggle" then
|
||||
msg.command = "toggle"
|
||||
elseif smsg:sub(1, 5) == "range" then
|
||||
msg.command = "range"
|
||||
msg.value = tonumber(smsg:sub(7))
|
||||
elseif smsg:sub(1, 5) == "shape" then
|
||||
msg.command = "shape"
|
||||
msg.value = smsg:sub(7):lower()
|
||||
msg.value = tonumber(msg.value) or msg.value
|
||||
end
|
||||
elseif msgt ~= "table" then
|
||||
return
|
||||
end
|
||||
if msg.command == "get" then
|
||||
digilines.receptor_send(pos, digilines.rules.default, channel, {
|
||||
enabled = meta:get_int("enabled"),
|
||||
range = meta:get_int("range"),
|
||||
shape = meta:get_int("shape")
|
||||
})
|
||||
return
|
||||
elseif msg.command == "off" then
|
||||
meta:set_int("enabled", 0)
|
||||
elseif msg.command == "on" then
|
||||
meta:set_int("enabled", 1)
|
||||
elseif msg.command == "toggle" then
|
||||
local onn = meta:get_int("enabled")
|
||||
onn = 1-onn -- Mirror onn with pivot 0.5, so switch between 1 and 0.
|
||||
meta:set_int("enabled", onn)
|
||||
elseif msg.command == "range" then
|
||||
if type(msg.value) ~= "number" then
|
||||
return
|
||||
end
|
||||
msg.value = math.max(msg.value, 5)
|
||||
msg.value = math.min(msg.value, 20)
|
||||
update_forcefield(pos, meta, false)
|
||||
meta:set_int("range", msg.value)
|
||||
elseif msg.command == "shape" then
|
||||
local valuet = type(msg.value)
|
||||
if valuet == "string" then
|
||||
if msg.value == "sphere" then
|
||||
msg.value = 0
|
||||
elseif msg.value == "cube" then
|
||||
msg.value = 1
|
||||
end
|
||||
elseif valuet ~= "number" then
|
||||
return
|
||||
end
|
||||
if not msg.value then
|
||||
return
|
||||
end
|
||||
update_forcefield(pos, meta, false)
|
||||
meta:set_int("shape", msg.value)
|
||||
else
|
||||
return
|
||||
end
|
||||
set_forcefield_formspec(meta)
|
||||
end
|
||||
},
|
||||
}
|
||||
|
||||
local function run(pos, node)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local eu_input = meta:get_int("HV_EU_input")
|
||||
local enabled = meta:get_int("enabled") ~= 0 and (meta:get_int("mesecon_mode") == 0 or meta:get_int("mesecon_effect") ~= 0)
|
||||
local enabled = meta:get_int("enabled") ~= 0 and
|
||||
(meta:get_int("mesecon_mode") == 0 or meta:get_int("mesecon_effect") ~= 0)
|
||||
local machine_name = S("%s Forcefield Emitter"):format("HV")
|
||||
|
||||
local range = meta:get_int("range")
|
||||
@ -194,7 +285,14 @@ end
|
||||
|
||||
minetest.register_node("technic:forcefield_emitter_off", {
|
||||
description = S("%s Forcefield Emitter"):format("HV"),
|
||||
tiles = {"technic_forcefield_emitter_off.png"},
|
||||
tiles = {
|
||||
"technic_forcefield_emitter_off.png",
|
||||
"technic_machine_bottom.png"..cable_entry,
|
||||
"technic_forcefield_emitter_off.png",
|
||||
"technic_forcefield_emitter_off.png",
|
||||
"technic_forcefield_emitter_off.png",
|
||||
"technic_forcefield_emitter_off.png"
|
||||
},
|
||||
groups = {cracky = 1, technic_machine = 1, technic_hv = 1},
|
||||
on_receive_fields = forcefield_receive_fields,
|
||||
on_construct = function(pos)
|
||||
@ -205,16 +303,27 @@ minetest.register_node("technic:forcefield_emitter_off", {
|
||||
meta:set_int("enabled", 0)
|
||||
meta:set_int("mesecon_mode", 0)
|
||||
meta:set_int("mesecon_effect", 0)
|
||||
if digilines_path then
|
||||
meta:set_string("channel", "forcefield"..minetest.pos_to_string(pos))
|
||||
end
|
||||
meta:set_string("infotext", S("%s Forcefield Emitter"):format("HV"))
|
||||
set_forcefield_formspec(meta)
|
||||
end,
|
||||
mesecons = mesecons,
|
||||
digiline = digiline_def,
|
||||
technic_run = run,
|
||||
})
|
||||
|
||||
minetest.register_node("technic:forcefield_emitter_on", {
|
||||
description = S("%s Forcefield Emitter"):format("HV"),
|
||||
tiles = {"technic_forcefield_emitter_on.png"},
|
||||
tiles = {
|
||||
"technic_forcefield_emitter_on.png",
|
||||
"technic_machine_bottom.png"..cable_entry,
|
||||
"technic_forcefield_emitter_on.png",
|
||||
"technic_forcefield_emitter_on.png",
|
||||
"technic_forcefield_emitter_on.png",
|
||||
"technic_forcefield_emitter_on.png"
|
||||
},
|
||||
groups = {cracky = 1, technic_machine = 1, technic_hv = 1,
|
||||
not_in_creative_inventory=1},
|
||||
drop = "technic:forcefield_emitter_off",
|
||||
@ -224,12 +333,17 @@ minetest.register_node("technic:forcefield_emitter_on", {
|
||||
update_forcefield(pos, meta, false)
|
||||
end,
|
||||
mesecons = mesecons,
|
||||
digiline = digiline_def,
|
||||
technic_run = run,
|
||||
technic_on_disable = function (pos, node)
|
||||
local meta = minetest.get_meta(pos)
|
||||
update_forcefield(pos, meta, false)
|
||||
technic.swap_node(pos, "technic:forcefield_emitter_off")
|
||||
end,
|
||||
on_blast = function(pos, intensity)
|
||||
minetest.dig_node(pos)
|
||||
return {"technic:forcefield_emitter_off"}
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("technic:forcefield", {
|
||||
@ -238,7 +352,7 @@ minetest.register_node("technic:forcefield", {
|
||||
drawtype = "glasslike",
|
||||
groups = {not_in_creative_inventory=1},
|
||||
paramtype = "light",
|
||||
light_source = 15,
|
||||
light_source = default.LIGHT_MAX,
|
||||
diggable = false,
|
||||
drop = '',
|
||||
tiles = {{
|
||||
@ -250,6 +364,8 @@ minetest.register_node("technic:forcefield", {
|
||||
length = 1.0,
|
||||
},
|
||||
}},
|
||||
on_blast = function(pos, intensity)
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
|
@ -12,11 +12,13 @@ intact the reactor will melt down!
|
||||
local burn_ticks = 7 * 24 * 60 * 60 -- Seconds
|
||||
local power_supply = 100000 -- EUs
|
||||
local fuel_type = "technic:uranium_fuel" -- The reactor burns this
|
||||
local digiline_meltdown = technic.config:get_bool("enable_nuclear_reactor_digiline_selfdestruct")
|
||||
local digiline_remote_path = minetest.get_modpath("digiline_remote")
|
||||
|
||||
local S = technic.getter
|
||||
|
||||
local reactor_desc = S("@1 Nuclear Reactor Core", S("HV")),
|
||||
|
||||
local reactor_desc = S("@1 Nuclear Reactor Core", S("HV"))
|
||||
local cable_entry = "^technic_cable_connection_overlay.png"
|
||||
|
||||
-- FIXME: Recipe should make more sense like a rod recepticle, steam chamber, HV generator?
|
||||
minetest.register_craft({
|
||||
@ -28,32 +30,26 @@ minetest.register_craft({
|
||||
}
|
||||
})
|
||||
|
||||
local reactor_formspec =
|
||||
"invsize[8,9;]"..
|
||||
local function make_reactor_formspec(meta)
|
||||
local f = "size[8,9]"..
|
||||
"label[0,0;"..S("Nuclear Reactor Rod Compartment").."]"..
|
||||
"list[current_name;src;2,1;3,2;]"..
|
||||
"list[current_player;main;0,5;8,4;]"..
|
||||
"listring[]"
|
||||
|
||||
-- "Boxy sphere"
|
||||
local node_box = {
|
||||
{-0.353, -0.353, -0.353, 0.353, 0.353, 0.353}, -- Box
|
||||
{-0.495, -0.064, -0.064, 0.495, 0.064, 0.064}, -- Circle +-x
|
||||
{-0.483, -0.128, -0.128, 0.483, 0.128, 0.128},
|
||||
{-0.462, -0.191, -0.191, 0.462, 0.191, 0.191},
|
||||
{-0.433, -0.249, -0.249, 0.433, 0.249, 0.249},
|
||||
{-0.397, -0.303, -0.303, 0.397, 0.303, 0.303},
|
||||
{-0.305, -0.396, -0.305, 0.305, 0.396, 0.305}, -- Circle +-y
|
||||
{-0.250, -0.432, -0.250, 0.250, 0.432, 0.250},
|
||||
{-0.191, -0.461, -0.191, 0.191, 0.461, 0.191},
|
||||
{-0.130, -0.482, -0.130, 0.130, 0.482, 0.130},
|
||||
{-0.066, -0.495, -0.066, 0.066, 0.495, 0.066},
|
||||
{-0.064, -0.064, -0.495, 0.064, 0.064, 0.495}, -- Circle +-z
|
||||
{-0.128, -0.128, -0.483, 0.128, 0.128, 0.483},
|
||||
{-0.191, -0.191, -0.462, 0.191, 0.191, 0.462},
|
||||
{-0.249, -0.249, -0.433, 0.249, 0.249, 0.433},
|
||||
{-0.303, -0.303, -0.397, 0.303, 0.303, 0.397},
|
||||
}
|
||||
"listring[]"..
|
||||
"button[5.5,1.5;2,1;start;Start]"..
|
||||
"checkbox[5.5,2.5;autostart;automatic Start;"..meta:get_string("autostart").."]"
|
||||
if not digiline_remote_path then
|
||||
return f
|
||||
end
|
||||
local digiline_enabled = meta:get_string("enable_digiline")
|
||||
f = f.."checkbox[0.5,2.8;enable_digiline;Enable Digiline;"..digiline_enabled.."]"
|
||||
if digiline_enabled ~= "true" then
|
||||
return f
|
||||
end
|
||||
return f..
|
||||
"button_exit[4.6,3.69;2,1;save;Save]"..
|
||||
"field[1,4;4,1;remote_channel;Digiline Remote Channel;${remote_channel}]"
|
||||
end
|
||||
|
||||
local SS_OFF = 0
|
||||
local SS_DANGER = 1
|
||||
@ -216,11 +212,42 @@ end
|
||||
|
||||
local function melt_down_reactor(pos)
|
||||
minetest.log("action", "A reactor melted down at "..minetest.pos_to_string(pos))
|
||||
minetest.set_node(pos, {name="technic:corium_source"})
|
||||
minetest.set_node(pos, {name = "technic:corium_source"})
|
||||
end
|
||||
|
||||
|
||||
local function start_reactor(pos, meta)
|
||||
if minetest.get_node(pos).name ~= "technic:hv_nuclear_reactor_core" then
|
||||
return false
|
||||
end
|
||||
local inv = meta:get_inventory()
|
||||
if inv:is_empty("src") then
|
||||
return false
|
||||
end
|
||||
local src_list = inv:get_list("src")
|
||||
local correct_fuel_count = 0
|
||||
for _, src_stack in pairs(src_list) do
|
||||
if src_stack and src_stack:get_name() == fuel_type then
|
||||
correct_fuel_count = correct_fuel_count + 1
|
||||
end
|
||||
end
|
||||
-- Check that the reactor is complete and has the correct fuel
|
||||
if correct_fuel_count ~= 6 or reactor_structure_badness(pos) ~= 0 then
|
||||
return false
|
||||
end
|
||||
meta:set_int("burn_time", 1)
|
||||
technic.swap_node(pos, "technic:hv_nuclear_reactor_core_active")
|
||||
meta:set_int("HV_EU_supply", power_supply)
|
||||
for idx, src_stack in pairs(src_list) do
|
||||
src_stack:take_item()
|
||||
inv:set_stack("src", idx, src_stack)
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
minetest.register_abm({
|
||||
label = "Machines: reactor melt-down check",
|
||||
nodenames = {"technic:hv_nuclear_reactor_core_active"},
|
||||
interval = 4,
|
||||
chance = 1,
|
||||
@ -248,27 +275,13 @@ minetest.register_abm({
|
||||
local function run(pos, node)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local burn_time = meta:get_int("burn_time") or 0
|
||||
|
||||
if burn_time >= burn_ticks or burn_time == 0 then
|
||||
local inv = meta:get_inventory()
|
||||
if not inv:is_empty("src") then
|
||||
local src_list = inv:get_list("src")
|
||||
local correct_fuel_count = 0
|
||||
for _, src_stack in pairs(src_list) do
|
||||
if src_stack and src_stack:get_name() == fuel_type then
|
||||
correct_fuel_count = correct_fuel_count + 1
|
||||
end
|
||||
end
|
||||
-- Check that the reactor is complete and has the correct fuel
|
||||
if correct_fuel_count == 6 and
|
||||
reactor_structure_badness(pos) == 0 then
|
||||
meta:set_int("burn_time", 1)
|
||||
technic.swap_node(pos, "technic:hv_nuclear_reactor_core_active")
|
||||
meta:set_int("HV_EU_supply", power_supply)
|
||||
for idx, src_stack in pairs(src_list) do
|
||||
src_stack:take_item()
|
||||
inv:set_stack("src", idx, src_stack)
|
||||
end
|
||||
if digiline_remote_path and meta:get_int("HV_EU_supply") == power_supply then
|
||||
digiline_remote.send_to_node(pos, meta:get_string("remote_channel"),
|
||||
"fuel used", 6, true)
|
||||
end
|
||||
if meta:get_string("autostart") == "true" then
|
||||
if start_reactor(pos, meta) then
|
||||
return
|
||||
end
|
||||
end
|
||||
@ -287,26 +300,127 @@ local function run(pos, node)
|
||||
end
|
||||
end
|
||||
|
||||
local nuclear_reactor_receive_fields = function(pos, formname, fields, sender)
|
||||
local player_name = sender:get_player_name()
|
||||
if minetest.is_protected(pos, player_name) then
|
||||
minetest.chat_send_player(player_name, "You are not allowed to edit this!")
|
||||
minetest.record_protection_violation(pos, player_name)
|
||||
return
|
||||
end
|
||||
local meta = minetest.get_meta(pos)
|
||||
local update_formspec = false
|
||||
if fields.remote_channel then
|
||||
meta:set_string("remote_channel", fields.remote_channel)
|
||||
end
|
||||
if fields.start then
|
||||
local b = start_reactor(pos, meta)
|
||||
if b then
|
||||
minetest.chat_send_player(player_name, "Start successful")
|
||||
else
|
||||
minetest.chat_send_player(player_name, "Error")
|
||||
end
|
||||
end
|
||||
if fields.autostart then
|
||||
meta:set_string("autostart", fields.autostart)
|
||||
update_formspec = true
|
||||
end
|
||||
if fields.enable_digiline then
|
||||
meta:set_string("enable_digiline", fields.enable_digiline)
|
||||
update_formspec = true
|
||||
end
|
||||
if update_formspec then
|
||||
meta:set_string("formspec", make_reactor_formspec(meta))
|
||||
end
|
||||
end
|
||||
|
||||
local digiline_remote_def = function(pos, channel, msg)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if meta:get_string("enable_digiline") ~= "true" or
|
||||
channel ~= meta:get_string("remote_channel") then
|
||||
return
|
||||
end
|
||||
-- Convert string messages to tables:
|
||||
local msgt = type(msg)
|
||||
if msgt == "string" then
|
||||
local smsg = msg:lower()
|
||||
msg = {}
|
||||
if smsg == "get" then
|
||||
msg.command = "get"
|
||||
elseif smsg:sub(1, 13) == "self_destruct" then
|
||||
msg.command = "self_destruct"
|
||||
msg.timer = tonumber(smsg:sub(15)) or 0
|
||||
elseif smsg == "start" then
|
||||
msg.command = "start"
|
||||
end
|
||||
elseif msgt ~= "table" then
|
||||
return
|
||||
end
|
||||
|
||||
if msg.command == "get" then
|
||||
local inv = meta:get_inventory()
|
||||
local invtable = {}
|
||||
for i = 1, 6 do
|
||||
local stack = inv:get_stack("src", i)
|
||||
if stack:is_empty() then
|
||||
invtable[i] = 0
|
||||
elseif stack:get_name() == fuel_type then
|
||||
invtable[i] = stack:get_count()
|
||||
else
|
||||
invtable[i] = -stack:get_count()
|
||||
end
|
||||
end
|
||||
digiline_remote.send_to_node(pos, channel, {
|
||||
burn_time = meta:get_int("burn_time"),
|
||||
enabled = meta:get_int("HV_EU_supply") == power_supply,
|
||||
siren = meta:get_int("siren") == 1,
|
||||
structure_accumulated_badness = meta:get_int("structure_accumulated_badness"),
|
||||
rods = invtable
|
||||
}, 6, true)
|
||||
elseif digiline_meltdown and msg.command == "self_destruct" and
|
||||
minetest.get_node(pos).name == "technic:hv_nuclear_reactor_core_active" then
|
||||
if msg.timer ~= 0 and type(msg.timer) == "number" then
|
||||
siren_danger(pos, meta)
|
||||
minetest.after(msg.timer, melt_down_reactor, pos)
|
||||
else
|
||||
melt_down_reactor(pos)
|
||||
end
|
||||
elseif msg.command == "start" then
|
||||
local b = start_reactor(pos, meta)
|
||||
if b then
|
||||
digiline_remote.send_to_node(pos, channel, "Start successful", 6, true)
|
||||
else
|
||||
digiline_remote.send_to_node(pos, channel, "Error", 6, true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_node("technic:hv_nuclear_reactor_core", {
|
||||
description = reactor_desc,
|
||||
tiles = {"technic_hv_nuclear_reactor_core.png"},
|
||||
groups = {cracky=1, technic_machine=1, technic_hv=1},
|
||||
tiles = {
|
||||
"technic_hv_nuclear_reactor_core.png",
|
||||
"technic_hv_nuclear_reactor_core.png"..cable_entry
|
||||
},
|
||||
drawtype = "mesh",
|
||||
mesh = "technic_reactor.obj",
|
||||
groups = {cracky = 1, technic_machine = 1, technic_hv = 1, digiline_remote_receive = 1},
|
||||
legacy_facedir_simple = true,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
stack_max = 1,
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = node_box
|
||||
},
|
||||
on_receive_fields = nuclear_reactor_receive_fields,
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("infotext", reactor_desc)
|
||||
meta:set_string("formspec", reactor_formspec)
|
||||
meta:set_string("formspec", make_reactor_formspec(meta))
|
||||
if digiline_remote_path then
|
||||
meta:set_string("remote_channel",
|
||||
"nucelear_reactor"..minetest.pos_to_string(pos))
|
||||
end
|
||||
local inv = meta:get_inventory()
|
||||
inv:set_size("src", 6)
|
||||
end,
|
||||
_on_digiline_remote_receive = digiline_remote_def,
|
||||
can_dig = technic.machine_can_dig,
|
||||
on_destruct = function(pos) siren_set_state(pos, SS_OFF) end,
|
||||
allow_metadata_inventory_put = technic.machine_inventory_put,
|
||||
@ -316,19 +430,22 @@ minetest.register_node("technic:hv_nuclear_reactor_core", {
|
||||
})
|
||||
|
||||
minetest.register_node("technic:hv_nuclear_reactor_core_active", {
|
||||
tiles = {"technic_hv_nuclear_reactor_core.png"},
|
||||
groups = {cracky=1, technic_machine=1, technic_hv=1,
|
||||
radioactive=4, not_in_creative_inventory=1},
|
||||
tiles = {
|
||||
"technic_hv_nuclear_reactor_core.png",
|
||||
"technic_hv_nuclear_reactor_core.png"..cable_entry
|
||||
},
|
||||
drawtype = "mesh",
|
||||
mesh = "technic_reactor.obj",
|
||||
groups = {cracky = 1, technic_machine = 1, technic_hv = 1, radioactive = 4,
|
||||
not_in_creative_inventory = 1, digiline_remote_receive = 1},
|
||||
legacy_facedir_simple = true,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
drop = "technic:hv_nuclear_reactor_core",
|
||||
drawtype = "nodebox",
|
||||
light_source = 14,
|
||||
paramtype = "light",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = node_box
|
||||
},
|
||||
paramtype2 = "facedir",
|
||||
on_receive_fields = nuclear_reactor_receive_fields,
|
||||
_on_digiline_remote_receive = digiline_remote_def,
|
||||
can_dig = technic.machine_can_dig,
|
||||
after_dig_node = melt_down_reactor,
|
||||
on_destruct = function(pos) siren_set_state(pos, SS_OFF) end,
|
||||
|
@ -1,6 +1,9 @@
|
||||
|
||||
local S = technic.getter
|
||||
|
||||
local tube_entry = "^pipeworks_tube_connection_metallic.png"
|
||||
local cable_entry = "^technic_cable_connection_overlay.png"
|
||||
|
||||
minetest.register_craft({
|
||||
recipe = {
|
||||
{"technic:carbon_plate", "pipeworks:filter", "technic:composite_plate"},
|
||||
@ -12,6 +15,7 @@ minetest.register_craft({
|
||||
local quarry_dig_above_nodes = 3 -- How far above the quarry we will dig nodes
|
||||
local quarry_max_depth = 100
|
||||
local quarry_demand = 10000
|
||||
local quarry_eject_dir = vector.new(0, 1, 0)
|
||||
|
||||
local function set_quarry_formspec(meta)
|
||||
local radius = meta:get_int("size")
|
||||
@ -83,7 +87,7 @@ local function quarry_handle_purge(pos)
|
||||
if stack then
|
||||
local item = stack:to_table()
|
||||
if item then
|
||||
technic.tube_inject_item(pos, pos, vector.new(0, 1, 0), item)
|
||||
technic.tube_inject_item(pos, pos, quarry_eject_dir, item)
|
||||
stack:clear()
|
||||
inv:set_stack("cache", i, stack)
|
||||
break
|
||||
@ -206,17 +210,29 @@ end
|
||||
|
||||
minetest.register_node("technic:quarry", {
|
||||
description = S("%s Quarry"):format("HV"),
|
||||
tiles = {"technic_carbon_steel_block.png", "technic_carbon_steel_block.png",
|
||||
"technic_carbon_steel_block.png", "technic_carbon_steel_block.png",
|
||||
"technic_carbon_steel_block.png^default_tool_mesepick.png", "technic_carbon_steel_block.png"},
|
||||
inventory_image = minetest.inventorycube("technic_carbon_steel_block.png",
|
||||
"technic_carbon_steel_block.png^default_tool_mesepick.png",
|
||||
"technic_carbon_steel_block.png"),
|
||||
tiles = {
|
||||
"technic_carbon_steel_block.png"..tube_entry,
|
||||
"technic_carbon_steel_block.png"..cable_entry,
|
||||
"technic_carbon_steel_block.png"..cable_entry,
|
||||
"technic_carbon_steel_block.png"..cable_entry,
|
||||
"technic_carbon_steel_block.png^default_tool_mesepick.png",
|
||||
"technic_carbon_steel_block.png"..cable_entry
|
||||
},
|
||||
paramtype2 = "facedir",
|
||||
groups = {cracky=2, tubedevice=1, technic_machine=1, technic_hv=1},
|
||||
connect_sides = {"bottom", "front", "left", "right"},
|
||||
tube = {
|
||||
connect_sides = {top = 1},
|
||||
-- lower priority than other tubes, so that quarries will prefer any
|
||||
-- other tube to another quarry, which could lead to server freezes
|
||||
-- in certain quarry placements (2x2 for example would never eject)
|
||||
priority = 10,
|
||||
can_go = function(pos, node, velocity, stack)
|
||||
-- always eject the same, even if items came in another way
|
||||
-- this further mitigates loops and generally avoids random sideway movement
|
||||
-- that can be expected in certain quarry placements
|
||||
return { quarry_eject_dir }
|
||||
end
|
||||
},
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
|
@ -1,3 +1,4 @@
|
||||
-- LV Battery box
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:lv_battery_box0',
|
||||
|
@ -4,6 +4,8 @@
|
||||
|
||||
local S = technic.getter
|
||||
|
||||
local cable_entry = "^technic_cable_connection_overlay.png"
|
||||
|
||||
minetest.register_alias("water_mill", "technic:water_mill")
|
||||
|
||||
minetest.register_craft({
|
||||
@ -30,7 +32,7 @@ local run = function(pos, node)
|
||||
local lava_nodes = 0
|
||||
local production_level = 0
|
||||
local eu_supply = 0
|
||||
local max_output = 50 * 45 -- four param2's at 15 makes 60, cap it lower for "overload protection"
|
||||
local max_output = 35 * 45 -- four param2's at 15 makes 60, cap it lower for "overload protection"
|
||||
-- (plus we want the gen to report 100% if three sides have full flow)
|
||||
|
||||
local positions = {
|
||||
@ -47,12 +49,10 @@ local run = function(pos, node)
|
||||
end
|
||||
end
|
||||
|
||||
eu_supply = 50 * water_flow
|
||||
eu_supply = math.min(35 * water_flow, max_output)
|
||||
production_level = math.floor(100 * eu_supply / max_output)
|
||||
|
||||
if production_level > 0 then
|
||||
meta:set_int("LV_EU_supply", eu_supply)
|
||||
end
|
||||
meta:set_int("LV_EU_supply", eu_supply)
|
||||
|
||||
meta:set_string("infotext",
|
||||
S("Hydro %s Generator"):format("LV").." ("..production_level.."%)")
|
||||
@ -70,9 +70,14 @@ end
|
||||
|
||||
minetest.register_node("technic:water_mill", {
|
||||
description = S("Hydro %s Generator"):format("LV"),
|
||||
tiles = {"technic_water_mill_top.png", "technic_machine_bottom.png",
|
||||
"technic_water_mill_side.png", "technic_water_mill_side.png",
|
||||
"technic_water_mill_side.png", "technic_water_mill_side.png"},
|
||||
tiles = {
|
||||
"technic_water_mill_top.png",
|
||||
"technic_machine_bottom.png"..cable_entry,
|
||||
"technic_water_mill_side.png",
|
||||
"technic_water_mill_side.png",
|
||||
"technic_water_mill_side.png",
|
||||
"technic_water_mill_side.png"
|
||||
},
|
||||
paramtype2 = "facedir",
|
||||
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
|
||||
technic_machine=1, technic_lv=1},
|
||||
|
@ -146,6 +146,7 @@ minetest.register_node("technic:power_radiator", {
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
label = "Machines: run power radiator",
|
||||
nodenames = {"technic:power_radiator"},
|
||||
interval = 1,
|
||||
chance = 1,
|
||||
|
@ -5,6 +5,8 @@ minetest.register_alias("tool_workshop", "technic:tool_workshop")
|
||||
|
||||
local S = technic.getter
|
||||
|
||||
local tube_entry = "^pipeworks_tube_connection_wooden.png"
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:tool_workshop',
|
||||
recipe = {
|
||||
@ -83,8 +85,14 @@ end
|
||||
minetest.register_node("technic:tool_workshop", {
|
||||
description = S("%s Tool Workshop"):format("MV"),
|
||||
paramtype2 = "facedir",
|
||||
tiles = {"technic_workshop_top.png", "technic_machine_bottom.png", "technic_workshop_side.png",
|
||||
"technic_workshop_side.png", "technic_workshop_side.png", "technic_workshop_side.png"},
|
||||
tiles = {
|
||||
"technic_workshop_top.png"..tube_entry,
|
||||
"technic_machine_bottom.png"..tube_entry,
|
||||
"technic_workshop_side.png"..tube_entry,
|
||||
"technic_workshop_side.png"..tube_entry,
|
||||
"technic_workshop_side.png"..tube_entry,
|
||||
"technic_workshop_side.png"
|
||||
},
|
||||
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
|
||||
technic_machine=1, technic_mv=1, tubedevice=1, tubedevice_receiver=1},
|
||||
connect_sides = {"bottom", "back", "left", "right"},
|
||||
|
@ -8,6 +8,7 @@ dofile(path.."/MV/init.lua")
|
||||
dofile(path.."/HV/init.lua")
|
||||
|
||||
dofile(path.."/switching_station.lua")
|
||||
dofile(path.."/power_monitor.lua")
|
||||
dofile(path.."/supply_converter.lua")
|
||||
|
||||
dofile(path.."/other/init.lua")
|
||||
|
@ -70,6 +70,7 @@ minetest.register_node("technic:coal_alloy_furnace_active", {
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
label = "Machines: run coal alloy furnace",
|
||||
nodenames = {"technic:coal_alloy_furnace", "technic:coal_alloy_furnace_active"},
|
||||
interval = 1,
|
||||
chance = 1,
|
||||
|
@ -2,6 +2,7 @@
|
||||
local S = technic.getter
|
||||
|
||||
local function deploy_node(inv, slot_name, pos, node, machine_node)
|
||||
if node.param2 > 3 then return end
|
||||
if node.name ~= "air" then
|
||||
if node.name == "ignore" or
|
||||
node.name == "default:lava_source" or
|
||||
@ -21,7 +22,7 @@ local function deploy_node(inv, slot_name, pos, node, machine_node)
|
||||
end
|
||||
if remove_to then
|
||||
for i = 1, remove_to do
|
||||
inv:remove_item(drops[i])
|
||||
inv:remove_item(slot_name, drops[i])
|
||||
end
|
||||
else
|
||||
minetest.remove_node(pos)
|
||||
@ -162,6 +163,7 @@ local function make_constructor(mark, length)
|
||||
allow_metadata_inventory_put = technic.machine_inventory_put,
|
||||
allow_metadata_inventory_take = technic.machine_inventory_take,
|
||||
allow_metadata_inventory_move = technic.machine_inventory_move,
|
||||
on_rotate = screwdriver.rotate_simple
|
||||
})
|
||||
|
||||
minetest.register_node("technic:constructor_mk"..mark.."_on", {
|
||||
@ -180,6 +182,7 @@ local function make_constructor(mark, length)
|
||||
allow_metadata_inventory_put = technic.machine_inventory_put,
|
||||
allow_metadata_inventory_take = technic.machine_inventory_take,
|
||||
allow_metadata_inventory_move = technic.machine_inventory_move,
|
||||
on_rotate = false
|
||||
})
|
||||
end
|
||||
|
||||
|
@ -3,7 +3,7 @@ local S = technic.getter
|
||||
|
||||
frames = {}
|
||||
|
||||
local infinite_stacks = minetest.setting_getbool("creative_mode") and minetest.get_modpath("unified_inventory") == nil
|
||||
local infinite_stacks = minetest.settings:get_bool("creative_mode") and minetest.get_modpath("unified_inventory") == nil
|
||||
|
||||
local frames_pos = {}
|
||||
|
||||
|
@ -1,6 +1,10 @@
|
||||
|
||||
local S = technic.getter
|
||||
|
||||
local fs_helpers = pipeworks.fs_helpers
|
||||
|
||||
local tube_entry = "^pipeworks_tube_connection_metallic.png"
|
||||
|
||||
local function inject_items (pos)
|
||||
local meta=minetest.get_meta(pos)
|
||||
local inv = meta:get_inventory()
|
||||
@ -51,37 +55,59 @@ minetest.register_craft({
|
||||
local function set_injector_formspec(meta)
|
||||
local is_stack = meta:get_string("mode") == "whole stacks"
|
||||
meta:set_string("formspec",
|
||||
"invsize[8,9;]"..
|
||||
"item_image[0,0;1,1;technic:injector]"..
|
||||
"label[1,0;"..S("Self-Contained Injector").."]"..
|
||||
(is_stack and
|
||||
"button[0,1;2,1;mode_item;"..S("Stackwise").."]" or
|
||||
"button[0,1;2,1;mode_stack;"..S("Itemwise").."]")..
|
||||
"list[current_name;main;0,2;8,2;]"..
|
||||
"list[current_player;main;0,5;8,4;]"..
|
||||
"listring[]")
|
||||
"invsize[8,9;]"..
|
||||
"item_image[0,0;1,1;technic:injector]"..
|
||||
"label[1,0;"..S("Self-Contained Injector").."]"..
|
||||
(is_stack and
|
||||
"button[0,1;2,1;mode_item;"..S("Stackwise").."]" or
|
||||
"button[0,1;2,1;mode_stack;"..S("Itemwise").."]")..
|
||||
"list[current_name;main;0,2;8,2;]"..
|
||||
"list[current_player;main;0,5;8,4;]"..
|
||||
"listring[]"..
|
||||
fs_helpers.cycling_button(
|
||||
meta,
|
||||
pipeworks.button_base,
|
||||
"splitstacks",
|
||||
{
|
||||
pipeworks.button_off,
|
||||
pipeworks.button_on
|
||||
}
|
||||
)..pipeworks.button_label
|
||||
)
|
||||
end
|
||||
|
||||
minetest.register_node("technic:injector", {
|
||||
description = S("Self-Contained Injector"),
|
||||
tiles = {"technic_injector_top.png", "technic_injector_bottom.png", "technic_injector_side.png",
|
||||
"technic_injector_side.png", "technic_injector_side.png", "technic_injector_side.png"},
|
||||
tiles = {
|
||||
"technic_injector_top.png"..tube_entry,
|
||||
"technic_injector_bottom.png",
|
||||
"technic_injector_side.png"..tube_entry,
|
||||
"technic_injector_side.png"..tube_entry,
|
||||
"technic_injector_side.png"..tube_entry,
|
||||
"technic_injector_side.png"
|
||||
},
|
||||
paramtype2 = "facedir",
|
||||
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, tubedevice=1, tubedevice_receiver=1},
|
||||
tube = {
|
||||
can_insert = function(pos, node, stack, direction)
|
||||
return minetest.get_meta(pos):get_inventory():room_for_item("main",stack)
|
||||
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 meta:get_inventory():room_for_item("main", stack)
|
||||
end,
|
||||
insert_object = function(pos, node, stack, direction)
|
||||
return minetest.get_meta(pos):get_inventory():add_item("main",stack)
|
||||
return minetest.get_meta(pos):get_inventory():add_item("main", stack)
|
||||
end,
|
||||
connect_sides = {left=1, right=1, front=1, back=1, top=1, bottom=1},
|
||||
connect_sides = {left=1, right=1, back=1, top=1, bottom=1},
|
||||
},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("infotext", S("Self-Contained Injector"))
|
||||
local inv = meta:get_inventory()
|
||||
inv:set_size("main", 8*4)
|
||||
inv:set_size("main", 8*2)
|
||||
meta:set_string("mode","single items")
|
||||
set_injector_formspec(meta)
|
||||
end,
|
||||
@ -94,6 +120,12 @@ minetest.register_node("technic:injector", {
|
||||
local meta = minetest.get_meta(pos)
|
||||
if fields.mode_item then meta:set_string("mode", "single items") end
|
||||
if fields.mode_stack then meta:set_string("mode", "whole stacks") end
|
||||
|
||||
if fields["fs_helpers_cycling:0:splitstacks"]
|
||||
or fields["fs_helpers_cycling:1:splitstacks"] then
|
||||
if not pipeworks.may_configure(pos, sender) then return end
|
||||
fs_helpers.on_receive_fields(pos, fields)
|
||||
end
|
||||
set_injector_formspec(meta)
|
||||
end,
|
||||
allow_metadata_inventory_put = technic.machine_inventory_put,
|
||||
@ -104,6 +136,7 @@ minetest.register_node("technic:injector", {
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
label = "Machines: run injector",
|
||||
nodenames = {"technic:injector"},
|
||||
interval = 1,
|
||||
chance = 1,
|
||||
|
69
mods/modpacks/technic/technic/machines/power_monitor.lua
Normal file
@ -0,0 +1,69 @@
|
||||
-- POWER MONITOR
|
||||
-- The power monitor can be used to monitor how much power is available on a network,
|
||||
-- similarly to the old "slave" switching stations.
|
||||
|
||||
local S = technic.getter
|
||||
|
||||
local cable_entry = "^technic_cable_connection_overlay.png"
|
||||
|
||||
minetest.register_craft({
|
||||
output = "technic:power_monitor",
|
||||
recipe = {
|
||||
{"", "", ""},
|
||||
{"", "technic:machine_casing", "default:copper_ingot"},
|
||||
{"technic:lv_cable", "technic:lv_cable", "technic:lv_cable"}
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_node("technic:power_monitor",{
|
||||
description = S("Power Monitor"),
|
||||
tiles = {
|
||||
"technic_power_monitor_sides.png",
|
||||
"technic_power_monitor_sides.png"..cable_entry,
|
||||
"technic_power_monitor_sides.png",
|
||||
"technic_power_monitor_sides.png",
|
||||
"technic_power_monitor_sides.png"..cable_entry,
|
||||
"technic_power_monitor_front.png"
|
||||
},
|
||||
paramtype2 = "facedir",
|
||||
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_all_tiers=1, technic_machine=1},
|
||||
connect_sides = {"bottom", "back"},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("infotext", S("Power Monitor"))
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"technic:power_monitor"},
|
||||
label = "Machines: run power monitor",
|
||||
interval = 1,
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local network_hash = technic.cables[minetest.hash_node_position(pos)]
|
||||
local network = network_hash and minetest.get_position_from_hash(network_hash)
|
||||
local sw_pos = network and {x=network.x,y=network.y+1,z=network.z}
|
||||
local timeout = 0
|
||||
for tier in pairs(technic.machines) do
|
||||
timeout = math.max(meta:get_int(tier.."_EU_timeout"),timeout)
|
||||
end
|
||||
if timeout > 0 and sw_pos and minetest.get_node(sw_pos).name == "technic:switching_station" then
|
||||
local sw_meta = minetest.get_meta(sw_pos)
|
||||
local supply = sw_meta:get_int("supply")
|
||||
local demand = sw_meta:get_int("demand")
|
||||
meta:set_string("infotext",
|
||||
S("Power Monitor. Supply: @1 Demand: @2",
|
||||
technic.pretty_num(supply), technic.pretty_num(demand)))
|
||||
else
|
||||
meta:set_string("infotext",S("Power Monitor Has No Network"))
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
for tier in pairs(technic.machines) do
|
||||
-- RE in order to use the "timeout" functions, although it consumes 0 power
|
||||
technic.register_machine(tier, "technic:power_monitor", "RE")
|
||||
end
|
||||
|
@ -1,17 +1,70 @@
|
||||
|
||||
local digilines_path = minetest.get_modpath("digilines")
|
||||
|
||||
local S = technic.getter
|
||||
local tube_entry = "^pipeworks_tube_connection_metallic.png"
|
||||
local cable_entry = "^technic_cable_connection_overlay.png"
|
||||
|
||||
local fs_helpers = pipeworks.fs_helpers
|
||||
|
||||
technic.register_power_tool("technic:battery", 10000)
|
||||
technic.register_power_tool("technic:red_energy_crystal", 50000)
|
||||
technic.register_power_tool("technic:green_energy_crystal", 150000)
|
||||
technic.register_power_tool("technic:blue_energy_crystal", 450000)
|
||||
|
||||
-- Battery recipes:
|
||||
-- Tin-copper recipe:
|
||||
minetest.register_craft({
|
||||
output = 'technic:battery',
|
||||
output = "technic:battery",
|
||||
recipe = {
|
||||
{'group:wood', 'default:copper_ingot', 'group:wood'},
|
||||
{'group:wood', 'moreores:tin_ingot', 'group:wood'},
|
||||
{'group:wood', 'default:copper_ingot', 'group:wood'},
|
||||
{"group:wood", "default:copper_ingot", "group:wood"},
|
||||
{"group:wood", "moreores:tin_ingot", "group:wood"},
|
||||
{"group:wood", "default:copper_ingot", "group:wood"},
|
||||
}
|
||||
})
|
||||
-- Sulfur-lead-water recipes:
|
||||
-- With sulfur lumps:
|
||||
-- With water:
|
||||
minetest.register_craft({
|
||||
output = "technic:battery",
|
||||
recipe = {
|
||||
{"group:wood", "technic:sulfur_lump", "group:wood"},
|
||||
{"technic:lead_ingot", "bucket:bucket_water", "technic:lead_ingot"},
|
||||
{"group:wood", "technic:sulfur_lump", "group:wood"},
|
||||
},
|
||||
replacements = {
|
||||
{"bucket:bucket_water", "bucket:bucket_empty"}
|
||||
}
|
||||
})
|
||||
-- With oil extract:
|
||||
minetest.register_craft({
|
||||
output = "technic:battery",
|
||||
recipe = {
|
||||
{"group:wood", "technic:sulfur_lump", "group:wood"},
|
||||
{"technic:lead_ingot", "homedecor:oil_extract", "technic:lead_ingot"},
|
||||
{"group:wood", "technic:sulfur_lump", "group:wood"},
|
||||
}
|
||||
})
|
||||
-- With sulfur dust:
|
||||
-- With water:
|
||||
minetest.register_craft({
|
||||
output = "technic:battery",
|
||||
recipe = {
|
||||
{"group:wood", "technic:sulfur_dust", "group:wood"},
|
||||
{"technic:lead_ingot", "bucket:bucket_water", "technic:lead_ingot"},
|
||||
{"group:wood", "technic:sulfur_dust", "group:wood"},
|
||||
},
|
||||
replacements = {
|
||||
{"bucket:bucket_water", "bucket:bucket_empty"}
|
||||
}
|
||||
})
|
||||
-- With oil extract:
|
||||
minetest.register_craft({
|
||||
output = "technic:battery",
|
||||
recipe = {
|
||||
{"group:wood", "technic:sulfur_dust", "group:wood"},
|
||||
{"technic:lead_ingot", "homedecor:oil_extract", "technic:lead_ingot"},
|
||||
{"group:wood", "technic:sulfur_dust", "group:wood"},
|
||||
}
|
||||
})
|
||||
|
||||
@ -29,67 +82,124 @@ minetest.register_tool("technic:battery", {
|
||||
}
|
||||
})
|
||||
|
||||
-- x+2 + (z+2)*2
|
||||
local dirtab = {
|
||||
[4] = 2,
|
||||
[5] = 3,
|
||||
[7] = 1,
|
||||
[8] = 0
|
||||
}
|
||||
|
||||
local tube = {
|
||||
insert_object = function(pos, node, stack, direction)
|
||||
if direction.y == 0 then
|
||||
print(minetest.pos_to_string(direction), dirtab[direction.x+2+(direction.z+2)*2], node.param2)
|
||||
if direction.y == 1
|
||||
or (direction.y == 0 and dirtab[direction.x+2+(direction.z+2)*2] == node.param2) then
|
||||
return stack
|
||||
end
|
||||
local meta = minetest.get_meta(pos)
|
||||
local inv = meta:get_inventory()
|
||||
if direction.y > 0 then
|
||||
if direction.y == 0 then
|
||||
return inv:add_item("src", stack)
|
||||
else
|
||||
return inv:add_item("dst", stack)
|
||||
end
|
||||
end,
|
||||
can_insert = function(pos, node, stack, direction)
|
||||
if direction.y == 0 then
|
||||
print(minetest.pos_to_string(direction), dirtab[direction.x+2+(direction.z+2)*2], node.param2)
|
||||
if direction.y == 1
|
||||
or (direction.y == 0 and dirtab[direction.x+2+(direction.z+2)*2] == node.param2) then
|
||||
return false
|
||||
end
|
||||
local meta = minetest.get_meta(pos)
|
||||
local inv = meta:get_inventory()
|
||||
if direction.y > 0 then
|
||||
if direction.y == 0 then
|
||||
if meta:get_int("split_src_stacks") == 1 then
|
||||
stack = stack:peek_item(1)
|
||||
end
|
||||
return inv:room_for_item("src", stack)
|
||||
else
|
||||
if meta:get_int("split_dst_stacks") == 1 then
|
||||
stack = stack:peek_item(1)
|
||||
end
|
||||
return inv:room_for_item("dst", stack)
|
||||
end
|
||||
end,
|
||||
connect_sides = {left=1, right=1, back=1, top=1, bottom=1},
|
||||
connect_sides = {left=1, right=1, back=1, top=1},
|
||||
}
|
||||
|
||||
local function add_on_off_buttons(meta, ltier, charge_percent)
|
||||
local formspec = ""
|
||||
if ltier == "mv" or ltier == "hv" then
|
||||
formspec = "image[1,1;1,2;technic_power_meter_bg.png"
|
||||
.."^[lowpart:"..charge_percent
|
||||
..":technic_power_meter_fg.png]"..
|
||||
fs_helpers.cycling_button(
|
||||
meta,
|
||||
"image_button[3,2.0;1,0.6",
|
||||
"split_src_stacks",
|
||||
{
|
||||
pipeworks.button_off,
|
||||
pipeworks.button_on
|
||||
}
|
||||
).."label[3.9,2.01;Allow splitting incoming 'charge' stacks from tubes]"..
|
||||
fs_helpers.cycling_button(
|
||||
meta,
|
||||
"image_button[3,2.5;1,0.6",
|
||||
"split_dst_stacks",
|
||||
{
|
||||
pipeworks.button_off,
|
||||
pipeworks.button_on
|
||||
}
|
||||
).."label[3.9,2.51;Allow splitting incoming 'discharge' stacks]"
|
||||
end
|
||||
return formspec
|
||||
end
|
||||
|
||||
function technic.register_battery_box(data)
|
||||
local tier = data.tier
|
||||
local ltier = string.lower(tier)
|
||||
|
||||
local formspec =
|
||||
"invsize[8,9;]"..
|
||||
"size[8,9]"..
|
||||
"image[1,1;1,2;technic_power_meter_bg.png]"..
|
||||
"list[current_name;src;3,1;1,1;]"..
|
||||
"list[context;src;3,1;1,1;]"..
|
||||
"image[4,1;1,1;technic_battery_reload.png]"..
|
||||
"list[current_name;dst;5,1;1,1;]"..
|
||||
"list[context;dst;5,1;1,1;]"..
|
||||
"label[0,0;"..S("%s Battery Box"):format(tier).."]"..
|
||||
"label[3,0;"..S("Charge").."]"..
|
||||
"label[5,0;"..S("Discharge").."]"..
|
||||
"label[1,3;"..S("Power level").."]"..
|
||||
"list[current_player;main;0,5;8,4;]"..
|
||||
"listring[current_name;dst]"..
|
||||
"listring[context;dst]"..
|
||||
"listring[current_player;main]"..
|
||||
"listring[current_name;src]"..
|
||||
"listring[context;src]"..
|
||||
"listring[current_player;main]"
|
||||
|
||||
if digilines_path then
|
||||
formspec = formspec.."button[0.6,3.7;2,1;edit_channel;edit Channel]"
|
||||
end
|
||||
|
||||
if data.upgrade then
|
||||
formspec = formspec..
|
||||
"list[current_name;upgrade1;3.5,3;1,1;]"..
|
||||
"list[current_name;upgrade2;4.5,3;1,1;]"..
|
||||
"list[context;upgrade1;3.5,3;1,1;]"..
|
||||
"list[context;upgrade2;4.5,3;1,1;]"..
|
||||
"label[3.5,4;"..S("Upgrade Slots").."]"..
|
||||
"listring[current_name;upgrade1]"..
|
||||
"listring[context;upgrade1]"..
|
||||
"listring[current_player;main]"..
|
||||
"listring[current_name;upgrade2]"..
|
||||
"listring[context;upgrade2]"..
|
||||
"listring[current_player;main]"
|
||||
end
|
||||
|
||||
local run = function(pos, node)
|
||||
local below = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z})
|
||||
local meta = minetest.get_meta(pos)
|
||||
|
||||
if not technic.is_tier_cable(below.name, tier) then
|
||||
meta:set_string("infotext", S("%s Battery Box Has No Network"):format(tier))
|
||||
return
|
||||
end
|
||||
|
||||
local eu_input = meta:get_int(tier.."_EU_input")
|
||||
local current_charge = meta:get_int("internal_EU_charge")
|
||||
|
||||
@ -98,7 +208,7 @@ function technic.register_battery_box(data)
|
||||
EU_upgrade, tube_upgrade = technic.handle_machine_upgrades(meta)
|
||||
end
|
||||
local max_charge = data.max_charge * (1 + EU_upgrade / 10)
|
||||
|
||||
|
||||
-- Charge/discharge the battery with the input EUs
|
||||
if eu_input >= 0 then
|
||||
current_charge = math.min(current_charge + eu_input, max_charge)
|
||||
@ -113,7 +223,7 @@ function technic.register_battery_box(data)
|
||||
current_charge, tool_empty = technic.discharge_tools(meta,
|
||||
current_charge, data.discharge_step,
|
||||
max_charge)
|
||||
|
||||
|
||||
if data.tube then
|
||||
local inv = meta:get_inventory()
|
||||
technic.handle_machine_pipeworks(pos, tube_upgrade,
|
||||
@ -144,12 +254,7 @@ function technic.register_battery_box(data)
|
||||
end
|
||||
|
||||
local charge_percent = math.floor(current_charge / max_charge * 100)
|
||||
meta:set_string("formspec",
|
||||
formspec..
|
||||
"image[1,1;1,2;technic_power_meter_bg.png"
|
||||
.."^[lowpart:"..charge_percent
|
||||
..":technic_power_meter_fg.png]")
|
||||
|
||||
meta:set_string("formspec", formspec..add_on_off_buttons(meta, ltier, charge_percent))
|
||||
local infotext = S("@1 Battery Box: @2/@3", tier,
|
||||
technic.pretty_num(current_charge), technic.pretty_num(max_charge))
|
||||
if eu_input == 0 then
|
||||
@ -157,27 +262,39 @@ function technic.register_battery_box(data)
|
||||
end
|
||||
meta:set_string("infotext", infotext)
|
||||
end
|
||||
|
||||
|
||||
for i = 0, 8 do
|
||||
local groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
|
||||
technic_machine=1, ["technic_"..ltier]=1}
|
||||
if i ~= 0 then
|
||||
groups.not_in_creative_inventory = 1
|
||||
end
|
||||
|
||||
|
||||
if data.tube then
|
||||
groups.tubedevice = 1
|
||||
groups.tubedevice_receiver = 1
|
||||
end
|
||||
|
||||
|
||||
local top_tex = "technic_"..ltier.."_battery_box_top.png"..tube_entry
|
||||
local front_tex = "technic_"..ltier.."_battery_box_front.png^technic_power_meter"..i..".png"
|
||||
local side_tex = "technic_"..ltier.."_battery_box_side.png"..tube_entry
|
||||
local bottom_tex = "technic_"..ltier.."_battery_box_bottom.png"..cable_entry
|
||||
|
||||
if ltier == "lv" then
|
||||
top_tex = "technic_"..ltier.."_battery_box_top.png"
|
||||
front_tex = "technic_"..ltier.."_battery_box_side.png^technic_power_meter"..i..".png"
|
||||
side_tex = "technic_"..ltier.."_battery_box_side.png^technic_power_meter"..i..".png"
|
||||
end
|
||||
|
||||
minetest.register_node("technic:"..ltier.."_battery_box"..i, {
|
||||
description = S("%s Battery Box"):format(tier),
|
||||
tiles = {"technic_"..ltier.."_battery_box_top.png",
|
||||
"technic_"..ltier.."_battery_box_bottom.png",
|
||||
"technic_"..ltier.."_battery_box_side.png^technic_power_meter"..i..".png",
|
||||
"technic_"..ltier.."_battery_box_side.png^technic_power_meter"..i..".png",
|
||||
"technic_"..ltier.."_battery_box_side.png^technic_power_meter"..i..".png",
|
||||
"technic_"..ltier.."_battery_box_side.png^technic_power_meter"..i..".png"},
|
||||
tiles = {
|
||||
top_tex,
|
||||
bottom_tex,
|
||||
side_tex,
|
||||
side_tex,
|
||||
side_tex,
|
||||
front_tex},
|
||||
groups = groups,
|
||||
connect_sides = {"bottom"},
|
||||
tube = data.tube and tube or nil,
|
||||
@ -186,11 +303,18 @@ function technic.register_battery_box(data)
|
||||
drop = "technic:"..ltier.."_battery_box0",
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local EU_upgrade, tube_upgrade = 0, 0
|
||||
if data.upgrade then
|
||||
EU_upgrade, tube_upgrade = technic.handle_machine_upgrades(meta)
|
||||
end
|
||||
local max_charge = data.max_charge * (1 + EU_upgrade / 10)
|
||||
local charge = meta:get_int("internal_EU_charge")
|
||||
local cpercent = math.floor(charge / max_charge * 100)
|
||||
local inv = meta:get_inventory()
|
||||
local node = minetest.get_node(pos)
|
||||
|
||||
meta:set_string("infotext", S("%s Battery Box"):format(tier))
|
||||
meta:set_string("formspec", formspec)
|
||||
meta:set_string("formspec", formspec..add_on_off_buttons(meta, ltier, cpercent))
|
||||
meta:set_string("channel", ltier.."_battery_box"..minetest.pos_to_string(pos))
|
||||
meta:set_int(tier.."_EU_demand", 0)
|
||||
meta:set_int(tier.."_EU_supply", 0)
|
||||
meta:set_int(tier.."_EU_input", 0)
|
||||
@ -205,8 +329,59 @@ function technic.register_battery_box(data)
|
||||
allow_metadata_inventory_take = technic.machine_inventory_take,
|
||||
allow_metadata_inventory_move = technic.machine_inventory_move,
|
||||
technic_run = run,
|
||||
on_rotate = screwdriver.rotate_simple,
|
||||
after_place_node = data.tube and pipeworks.after_place,
|
||||
after_dig_node = technic.machine_after_dig_node
|
||||
after_dig_node = technic.machine_after_dig_node,
|
||||
on_receive_fields = function(pos, formname, fields, sender)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local nodename = minetest.get_node(pos).name
|
||||
if fields.edit_channel then
|
||||
minetest.show_formspec(sender:get_player_name(),
|
||||
"technic:battery_box_edit_channel"..minetest.pos_to_string(pos),
|
||||
"field[channel;Digiline Channel;"..meta:get_string("channel").."]")
|
||||
elseif fields["fs_helpers_cycling:0:split_src_stacks"]
|
||||
or fields["fs_helpers_cycling:0:split_dst_stacks"]
|
||||
or fields["fs_helpers_cycling:1:split_src_stacks"]
|
||||
or fields["fs_helpers_cycling:1:split_dst_stacks"] then
|
||||
local meta = minetest.get_meta(pos)
|
||||
if not pipeworks.may_configure(pos, sender) then return end
|
||||
fs_helpers.on_receive_fields(pos, fields)
|
||||
local EU_upgrade, tube_upgrade = 0, 0
|
||||
if data.upgrade then
|
||||
EU_upgrade, tube_upgrade = technic.handle_machine_upgrades(meta)
|
||||
end
|
||||
local max_charge = data.max_charge * (1 + EU_upgrade / 10)
|
||||
local charge = meta:get_int("internal_EU_charge")
|
||||
local cpercent = math.floor(charge / max_charge * 100)
|
||||
meta:set_string("formspec", formspec..add_on_off_buttons(meta, ltier, cpercent))
|
||||
end
|
||||
end,
|
||||
digiline = {
|
||||
receptor = {action = function() end},
|
||||
effector = {
|
||||
action = function(pos, node, channel, msg)
|
||||
if msg ~= "GET" and msg ~= "get" then
|
||||
return
|
||||
end
|
||||
local meta = minetest.get_meta(pos)
|
||||
if channel ~= meta:get_string("channel") then
|
||||
return
|
||||
end
|
||||
local inv = meta:get_inventory()
|
||||
digilines.receptor_send(pos, digilines.rules.default, channel, {
|
||||
demand = meta:get_int(tier.."_EU_demand"),
|
||||
supply = meta:get_int(tier.."_EU_supply"),
|
||||
input = meta:get_int(tier.."_EU_input"),
|
||||
charge = meta:get_int("internal_EU_charge"),
|
||||
max_charge = data.max_charge * (1 + technic.handle_machine_upgrades(meta) / 10),
|
||||
src = inv:get_stack("src", 1):to_table(),
|
||||
dst = inv:get_stack("dst", 1):to_table(),
|
||||
upgrade1 = inv:get_stack("upgrade1", 1):to_table(),
|
||||
upgrade2 = inv:get_stack("upgrade2", 1):to_table()
|
||||
})
|
||||
end
|
||||
},
|
||||
},
|
||||
})
|
||||
end
|
||||
|
||||
@ -218,6 +393,22 @@ function technic.register_battery_box(data)
|
||||
|
||||
end -- End registration
|
||||
|
||||
minetest.register_on_player_receive_fields(
|
||||
function(player, formname, fields)
|
||||
if formname:sub(1, 32) ~= "technic:battery_box_edit_channel" or
|
||||
not fields.channel then
|
||||
return
|
||||
end
|
||||
local pos = minetest.string_to_pos(formname:sub(33))
|
||||
local plname = player:get_player_name()
|
||||
if minetest.is_protected(pos, plname) then
|
||||
minetest.record_protection_violation(pos, plname)
|
||||
return
|
||||
end
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("channel", fields.channel)
|
||||
end
|
||||
)
|
||||
|
||||
function technic.charge_tools(meta, batt_charge, charge_step)
|
||||
local inv = meta:get_inventory()
|
||||
|
@ -11,15 +11,118 @@ function technic.get_cable_tier(name)
|
||||
return cable_tier[name]
|
||||
end
|
||||
|
||||
local function clear_networks()
|
||||
technic.networks = {}
|
||||
local function check_connections(pos)
|
||||
-- Build a table of all machines
|
||||
local machines = {}
|
||||
for tier,list in pairs(technic.machines) do
|
||||
for k,v in pairs(list) do
|
||||
machines[k] = v
|
||||
end
|
||||
end
|
||||
local connections = {}
|
||||
local positions = {
|
||||
{x=pos.x+1, y=pos.y, z=pos.z},
|
||||
{x=pos.x-1, y=pos.y, z=pos.z},
|
||||
{x=pos.x, y=pos.y+1, z=pos.z},
|
||||
{x=pos.x, y=pos.y-1, z=pos.z},
|
||||
{x=pos.x, y=pos.y, z=pos.z+1},
|
||||
{x=pos.x, y=pos.y, z=pos.z-1}}
|
||||
for _,connected_pos in pairs(positions) do
|
||||
local name = minetest.get_node(connected_pos).name
|
||||
if machines[name] or technic.get_cable_tier(name) then
|
||||
table.insert(connections,connected_pos)
|
||||
end
|
||||
end
|
||||
return connections
|
||||
end
|
||||
|
||||
local function clear_networks(pos)
|
||||
local node = minetest.get_node(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local placed = node.name ~= "air"
|
||||
local positions = check_connections(pos)
|
||||
if #positions < 1 then return end
|
||||
local dead_end = #positions == 1
|
||||
for _,connected_pos in pairs(positions) do
|
||||
local net = technic.cables[minetest.hash_node_position(connected_pos)]
|
||||
if net and technic.networks[net] then
|
||||
if dead_end and placed then
|
||||
-- Dead end placed, add it to the network
|
||||
-- Get the network
|
||||
local network_id = technic.cables[minetest.hash_node_position(positions[1])]
|
||||
if not network_id then
|
||||
-- We're evidently not on a network, nothing to add ourselves to
|
||||
return
|
||||
end
|
||||
local sw_pos = minetest.get_position_from_hash(network_id)
|
||||
sw_pos.y = sw_pos.y + 1
|
||||
local network = technic.networks[network_id]
|
||||
local tier = network.tier
|
||||
|
||||
-- Actually add it to the (cached) network
|
||||
-- This is similar to check_node_subp
|
||||
technic.cables[minetest.hash_node_position(pos)] = network_id
|
||||
pos.visited = 1
|
||||
if technic.is_tier_cable(name, tier) then
|
||||
table.insert(network.all_nodes,pos)
|
||||
elseif technic.machines[tier][node.name] then
|
||||
meta:set_string(tier.."_network",minetest.pos_to_string(sw_pos))
|
||||
if technic.machines[tier][node.name] == technic.producer then
|
||||
table.insert(network.PR_nodes,pos)
|
||||
elseif technic.machines[tier][node.name] == technic.receiver then
|
||||
table.insert(network.RE_nodes,pos)
|
||||
elseif technic.machines[tier][node.name] == technic.producer_receiver then
|
||||
table.insert(network.PR_nodes,pos)
|
||||
table.insert(network.RE_nodes,pos)
|
||||
elseif technic.machines[tier][node.name] == "SPECIAL" and
|
||||
(pos.x ~= sw_pos.x or pos.y ~= sw_pos.y or pos.z ~= sw_pos.z) and
|
||||
from_below then
|
||||
table.insert(network.SP_nodes,pos)
|
||||
elseif technic.machines[tier][node.name] == technic.battery then
|
||||
table.insert(network.BA_nodes,pos)
|
||||
end
|
||||
end
|
||||
elseif dead_end and not placed then
|
||||
-- Dead end removed, remove it from the network
|
||||
-- Get the network
|
||||
local network_id = technic.cables[minetest.hash_node_position(positions[1])]
|
||||
if not network_id then
|
||||
-- We're evidently not on a network, nothing to add ourselves to
|
||||
return
|
||||
end
|
||||
local network = technic.networks[network_id]
|
||||
|
||||
-- Search for and remove machine
|
||||
technic.cables[minetest.hash_node_position(pos)] = nil
|
||||
for tblname,table in pairs(network) do
|
||||
if tblname ~= "tier" then
|
||||
for machinenum,machine in pairs(table) do
|
||||
if machine.x == pos.x
|
||||
and machine.y == pos.y
|
||||
and machine.z == pos.z then
|
||||
table[machinenum] = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
-- Not a dead end, so the whole network needs to be recalculated
|
||||
for _,v in pairs(technic.networks[net].all_nodes) do
|
||||
local pos1 = minetest.hash_node_position(v)
|
||||
technic.cables[pos1] = nil
|
||||
end
|
||||
technic.networks[net] = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function technic.register_cable(tier, size)
|
||||
local ltier = string.lower(tier)
|
||||
cable_tier["technic:"..ltier.."_cable"] = tier
|
||||
|
||||
local groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2}
|
||||
local groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
|
||||
["technic_"..ltier.."_cable"] = 1}
|
||||
|
||||
local node_box = {
|
||||
type = "connected",
|
||||
@ -44,18 +147,136 @@ function technic.register_cable(tier, size)
|
||||
sunlight_propagates = true,
|
||||
drawtype = "nodebox",
|
||||
node_box = node_box,
|
||||
connects_to = {"technic:"..ltier.."_cable",
|
||||
connects_to = {"group:technic_"..ltier.."_cable",
|
||||
"group:technic_"..ltier, "group:technic_all_tiers"},
|
||||
on_construct = clear_networks,
|
||||
on_destruct = clear_networks,
|
||||
})
|
||||
|
||||
local xyz = {
|
||||
["-x"] = 1,
|
||||
["-y"] = 2,
|
||||
["-z"] = 3,
|
||||
["x"] = 4,
|
||||
["y"] = 5,
|
||||
["z"] = 6,
|
||||
}
|
||||
local notconnects = {
|
||||
[1] = "left",
|
||||
[2] = "bottom",
|
||||
[3] = "front",
|
||||
[4] = "right",
|
||||
[5] = "top",
|
||||
[6] = "back",
|
||||
}
|
||||
local function s(p)
|
||||
if p:find("-") then
|
||||
return p:sub(2)
|
||||
else
|
||||
return "-"..p
|
||||
end
|
||||
end
|
||||
for p, i in pairs(xyz) do
|
||||
local def = {
|
||||
description = S("%s Cable Plate"):format(tier),
|
||||
tiles = {"technic_"..ltier.."_cable.png"},
|
||||
groups = table.copy(groups),
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
drop = "technic:"..ltier.."_cable_plate_1",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
drawtype = "nodebox",
|
||||
node_box = table.copy(node_box),
|
||||
connects_to = {"group:technic_"..ltier.."_cable",
|
||||
"group:technic_"..ltier, "group:technic_all_tiers"},
|
||||
on_construct = clear_networks,
|
||||
on_destruct = clear_networks,
|
||||
}
|
||||
def.node_box.fixed = {
|
||||
{-size, -size, -size, size, size, size},
|
||||
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}
|
||||
}
|
||||
def.node_box.fixed[1][xyz[p]] = 7/16 * (i-3.5)/math.abs(i-3.5)
|
||||
def.node_box.fixed[2][xyz[s(p)]] = 3/8 * (i-3.5)/math.abs(i-3.5)
|
||||
def.node_box["connect_"..notconnects[i]] = nil
|
||||
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 changed
|
||||
for k, v in pairs(pointed_thing_diff) do
|
||||
if v ~= 0 then
|
||||
changed = k
|
||||
num = xyz[s(tostring(v):sub(-2, -2)..k)]
|
||||
break
|
||||
end
|
||||
end
|
||||
local crtl = placer:get_player_control()
|
||||
if (crtl.aux1 or crtl.sneak) and not (crtl.aux1 and crtl.sneak) 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
|
||||
local ps = {}
|
||||
for p, _ in pairs(fine_pointed) do
|
||||
ps[#ps+1] = p
|
||||
end
|
||||
local bigger = (math.abs(fine_pointed[ps[1]]) > math.abs(fine_pointed[ps[2]]) and ps[1]) or ps[2]
|
||||
if math.abs(fine_pointed[bigger]) < 0.3 then
|
||||
num = num + 3
|
||||
num = (num <= 6 and num) or num - 6
|
||||
else
|
||||
num = xyz[((fine_pointed[bigger] < 0 and "-") or "") .. bigger]
|
||||
end
|
||||
end
|
||||
minetest.set_node(pointed_thing.above, {name = "technic:"..ltier.."_cable_plate_"..num})
|
||||
if not (creative and creative.is_enabled_for(placer)) then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
else
|
||||
def.groups.not_in_creative_inventory = 1
|
||||
end
|
||||
def.on_rotate = function(pos, node, user, mode, new_param2)
|
||||
local dir = 0
|
||||
if mode == screwdriver.ROTATE_FACE then -- left-click
|
||||
dir = 1
|
||||
elseif mode == screwdriver.ROTATE_AXIS then -- right-click
|
||||
dir = -1
|
||||
end
|
||||
local num = tonumber(node.name:sub(-1))
|
||||
num = num + dir
|
||||
num = (num >= 1 and num) or num + 6
|
||||
num = (num <= 6 and num) or num - 6
|
||||
minetest.swap_node(pos, {name = "technic:"..ltier.."_cable_plate_"..num})
|
||||
end
|
||||
minetest.register_node("technic:"..ltier.."_cable_plate_"..i, def)
|
||||
cable_tier["technic:"..ltier.."_cable_plate_"..i] = tier
|
||||
end
|
||||
|
||||
local c = "technic:"..ltier.."_cable"
|
||||
minetest.register_craft({
|
||||
output = "technic:"..ltier.."_cable_plate_1 5",
|
||||
recipe = {
|
||||
{"", "", c},
|
||||
{c , c , c},
|
||||
{"", "", c},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = c,
|
||||
recipe = {
|
||||
{"technic:"..ltier.."_cable_plate_1"},
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
local function clear_nets_if_machine(pos, node)
|
||||
for tier, machine_list in pairs(technic.machines) do
|
||||
if machine_list[node.name] ~= nil then
|
||||
return clear_networks()
|
||||
return clear_networks(pos)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -14,6 +14,8 @@ local recipes = {
|
||||
{ "technic:bronze_dust 4", "technic:copper_dust 3", "technic:tin_dust" },
|
||||
{ "technic:stainless_steel_dust 4", "technic:wrought_iron_dust 3", "technic:chromium_dust" },
|
||||
{ "technic:brass_dust 3", "technic:copper_dust 2", "technic:zinc_dust" },
|
||||
{ "technic:chernobylite_dust", "default:sand", "technic:uranium3_dust" },
|
||||
{ "default:dirt 4", "default:sand", "default:gravel", "default:clay_lump 2" },
|
||||
}
|
||||
|
||||
local function uranium_dust(p)
|
||||
@ -34,5 +36,5 @@ if minetest.get_modpath("farming") then
|
||||
end
|
||||
|
||||
for _, data in pairs(recipes) do
|
||||
technic.register_separating_recipe({ input = { data[1] }, output = { data[2], data[3] } })
|
||||
technic.register_separating_recipe({ input = { data[1] }, output = { data[2], data[3], data[4] } })
|
||||
end
|
||||
|
@ -20,11 +20,11 @@ local recipes = {
|
||||
}
|
||||
|
||||
-- defuse the default sandstone recipe, since we have the compressor to take over in a more realistic manner
|
||||
minetest.register_craft({
|
||||
output = "default:sand 0",
|
||||
minetest.clear_craft({
|
||||
output = "default:sandstone",
|
||||
recipe = {
|
||||
{'group:sand', 'group:sand'},
|
||||
{'group:sand', 'group:sand'}
|
||||
{'group:sand', 'group:sand'}
|
||||
},
|
||||
})
|
||||
|
||||
|
@ -1,5 +1,8 @@
|
||||
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)
|
||||
@ -9,12 +12,16 @@ local tube = {
|
||||
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.register_generator(data)
|
||||
function technic.register_generator(data)
|
||||
|
||||
local tier = data.tier
|
||||
local ltier = string.lower(tier)
|
||||
|
||||
@ -76,21 +83,44 @@ function technic.register_generator(data)
|
||||
if burn_totaltime == 0 then burn_totaltime = 1 end
|
||||
local percent = math.floor((burn_time / burn_totaltime) * 100)
|
||||
meta:set_string("infotext", desc.." ("..percent.."%)")
|
||||
meta:set_string("formspec",
|
||||
"size[8, 9]"..
|
||||
"label[0, 0;"..minetest.formspec_escape(desc).."]"..
|
||||
"list[current_name;src;3, 1;1, 1;]"..
|
||||
"image[4, 1;1, 1;default_furnace_fire_bg.png^[lowpart:"..
|
||||
(percent)..":default_furnace_fire_fg.png]"..
|
||||
"list[current_player;main;0, 5;8, 4;]"..
|
||||
"listring[]")
|
||||
|
||||
local form_buttons = ""
|
||||
if ltier ~= "lv" then
|
||||
form_buttons = fs_helpers.cycling_button(
|
||||
meta,
|
||||
pipeworks.button_base,
|
||||
"splitstacks",
|
||||
{
|
||||
pipeworks.button_off,
|
||||
pipeworks.button_on
|
||||
}
|
||||
)..pipeworks.button_label
|
||||
end
|
||||
meta:set_string("formspec",
|
||||
"size[8, 9]"..
|
||||
"label[0, 0;"..minetest.formspec_escape(desc).."]"..
|
||||
"list[current_name;src;3, 1;1, 1;]"..
|
||||
"image[4, 1;1, 1;default_furnace_fire_bg.png^[lowpart:"..
|
||||
(percent)..":default_furnace_fire_fg.png]"..
|
||||
"list[current_player;main;0, 5;8, 4;]"..
|
||||
"listring[]"..
|
||||
form_buttons
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
local tentry = tube_entry
|
||||
if ltier == "lv" then tentry = "" end
|
||||
|
||||
minetest.register_node("technic:"..ltier.."_generator", {
|
||||
description = desc,
|
||||
tiles = {"technic_"..ltier.."_generator_top.png", "technic_machine_bottom.png",
|
||||
"technic_"..ltier.."_generator_side.png", "technic_"..ltier.."_generator_side.png",
|
||||
"technic_"..ltier.."_generator_side.png", "technic_"..ltier.."_generator_front.png"},
|
||||
tiles = {
|
||||
"technic_"..ltier.."_generator_top.png"..tentry,
|
||||
"technic_machine_bottom.png"..tentry,
|
||||
"technic_"..ltier.."_generator_side.png"..tentry,
|
||||
"technic_"..ltier.."_generator_side.png"..tentry,
|
||||
"technic_"..ltier.."_generator_side.png"..tentry,
|
||||
"technic_"..ltier.."_generator_front.png"
|
||||
},
|
||||
paramtype2 = "facedir",
|
||||
groups = groups,
|
||||
connect_sides = {"bottom", "back", "left", "right"},
|
||||
@ -99,11 +129,24 @@ function technic.register_generator(data)
|
||||
tube = data.tube and tube or nil,
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local node = minetest.get_node(pos)
|
||||
meta:set_string("infotext", desc)
|
||||
meta:set_int(data.tier.."_EU_supply", 0)
|
||||
meta:set_int("burn_time", 0)
|
||||
meta:set_int("tube_time", 0)
|
||||
meta:set_string("formspec", generator_formspec)
|
||||
local form_buttons = ""
|
||||
if not string.find(node.name, ":lv_") then
|
||||
form_buttons = fs_helpers.cycling_button(
|
||||
meta,
|
||||
pipeworks.button_base,
|
||||
"splitstacks",
|
||||
{
|
||||
pipeworks.button_off,
|
||||
pipeworks.button_on
|
||||
}
|
||||
)..pipeworks.button_label
|
||||
end
|
||||
meta:set_string("formspec", generator_formspec..form_buttons)
|
||||
local inv = meta:get_inventory()
|
||||
inv:set_size("src", 1)
|
||||
end,
|
||||
@ -113,14 +156,39 @@ function technic.register_generator(data)
|
||||
allow_metadata_inventory_move = technic.machine_inventory_move,
|
||||
technic_run = run,
|
||||
after_place_node = data.tube and pipeworks.after_place,
|
||||
after_dig_node = technic.machine_after_dig_node
|
||||
after_dig_node = technic.machine_after_dig_node,
|
||||
on_receive_fields = function(pos, formname, fields, sender)
|
||||
if not pipeworks.may_configure(pos, sender) then return end
|
||||
fs_helpers.on_receive_fields(pos, fields)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local node = minetest.get_node(pos)
|
||||
local form = generator_formspec
|
||||
local form_buttons = ""
|
||||
if not string.find(node.name, ":lv_") then
|
||||
form_buttons = fs_helpers.cycling_button(
|
||||
meta,
|
||||
pipeworks.button_base,
|
||||
"splitstacks",
|
||||
{
|
||||
pipeworks.button_off,
|
||||
pipeworks.button_on
|
||||
}
|
||||
)..pipeworks.button_label
|
||||
end
|
||||
meta:set_string("formspec", generator_formspec..form_buttons)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("technic:"..ltier.."_generator_active", {
|
||||
description = desc,
|
||||
tiles = {"technic_"..ltier.."_generator_top.png", "technic_machine_bottom.png",
|
||||
"technic_"..ltier.."_generator_side.png", "technic_"..ltier.."_generator_side.png",
|
||||
"technic_"..ltier.."_generator_side.png", "technic_"..ltier.."_generator_front_active.png"},
|
||||
tiles = {
|
||||
"technic_"..ltier.."_generator_top.png"..tube_entry,
|
||||
"technic_machine_bottom.png"..tube_entry,
|
||||
"technic_"..ltier.."_generator_side.png"..tube_entry,
|
||||
"technic_"..ltier.."_generator_side.png"..tube_entry,
|
||||
"technic_"..ltier.."_generator_side.png"..tube_entry,
|
||||
"technic_"..ltier.."_generator_front_active.png"
|
||||
},
|
||||
paramtype2 = "facedir",
|
||||
groups = active_groups,
|
||||
connect_sides = {"bottom"},
|
||||
@ -129,6 +197,7 @@ function technic.register_generator(data)
|
||||
tube = data.tube and tube or nil,
|
||||
drop = "technic:"..ltier.."_generator",
|
||||
can_dig = technic.machine_can_dig,
|
||||
after_dig_node = technic.machine_after_dig_node,
|
||||
allow_metadata_inventory_put = technic.machine_inventory_put,
|
||||
allow_metadata_inventory_take = technic.machine_inventory_take,
|
||||
allow_metadata_inventory_move = technic.machine_inventory_move,
|
||||
@ -139,7 +208,8 @@ function technic.register_generator(data)
|
||||
end,
|
||||
on_timer = function(pos, node)
|
||||
local meta = minetest.get_meta(pos)
|
||||
|
||||
local node = minetest.get_node(pos)
|
||||
|
||||
-- Connected back?
|
||||
if meta:get_int(tier.."_EU_timeout") > 0 then return false end
|
||||
|
||||
@ -157,6 +227,19 @@ function technic.register_generator(data)
|
||||
burn_time = burn_time - 1
|
||||
meta:set_int("burn_time", burn_time)
|
||||
local percent = math.floor(burn_time / burn_totaltime * 100)
|
||||
|
||||
local form_buttons = ""
|
||||
if not string.find(node.name, ":lv_") then
|
||||
form_buttons = fs_helpers.cycling_button(
|
||||
meta,
|
||||
pipeworks.button_base,
|
||||
"splitstacks",
|
||||
{
|
||||
pipeworks.button_off,
|
||||
pipeworks.button_on
|
||||
}
|
||||
)..pipeworks.button_label
|
||||
end
|
||||
meta:set_string("formspec",
|
||||
"size[8, 9]"..
|
||||
"label[0, 0;"..minetest.formspec_escape(desc).."]"..
|
||||
@ -164,9 +247,44 @@ function technic.register_generator(data)
|
||||
"image[4, 1;1, 1;default_furnace_fire_bg.png^[lowpart:"..
|
||||
(percent)..":default_furnace_fire_fg.png]"..
|
||||
"list[current_player;main;0, 5;8, 4;]"..
|
||||
"listring[]")
|
||||
"listring[]"..
|
||||
form_buttons
|
||||
)
|
||||
return true
|
||||
end,
|
||||
on_receive_fields = function(pos, formname, fields, sender)
|
||||
if not pipeworks.may_configure(pos, sender) then return end
|
||||
fs_helpers.on_receive_fields(pos, fields)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local node = minetest.get_node(pos)
|
||||
local form_buttons = ""
|
||||
if not string.find(node.name, ":lv_") then
|
||||
form_buttons = fs_helpers.cycling_button(
|
||||
meta,
|
||||
pipeworks.button_base,
|
||||
"splitstacks",
|
||||
{
|
||||
pipeworks.button_off,
|
||||
pipeworks.button_on
|
||||
}
|
||||
)..pipeworks.button_label
|
||||
end
|
||||
|
||||
local burn_totaltime = meta:get_int("burn_totaltime") or 0
|
||||
local burn_time = meta:get_int("burn_time")
|
||||
local percent = math.floor(burn_time / burn_totaltime * 100)
|
||||
|
||||
meta:set_string("formspec",
|
||||
"size[8, 9]"..
|
||||
"label[0, 0;"..minetest.formspec_escape(desc).."]"..
|
||||
"list[current_name;src;3, 1;1, 1;]"..
|
||||
"image[4, 1;1, 1;default_furnace_fire_bg.png^[lowpart:"..
|
||||
(percent)..":default_furnace_fire_fg.png]"..
|
||||
"list[current_player;main;0, 5;8, 4;]"..
|
||||
"listring[]"..
|
||||
form_buttons
|
||||
)
|
||||
end,
|
||||
})
|
||||
|
||||
technic.register_machine(tier, "technic:"..ltier.."_generator", technic.producer)
|
||||
|
@ -10,27 +10,27 @@ end
|
||||
|
||||
local recipes = {
|
||||
-- Dusts
|
||||
{"default:coal_lump", "technic:coal_dust 2"},
|
||||
{"default:copper_lump", "technic:copper_dust 2"},
|
||||
{"default:desert_stone", "default:desert_sand"},
|
||||
{"default:gold_lump", "technic:gold_dust 2"},
|
||||
{"default:iron_lump", "technic:wrought_iron_dust 2"},
|
||||
{"technic:chromium_lump", "technic:chromium_dust 2"},
|
||||
{"technic:uranium_lump", "technic:uranium_dust 2"},
|
||||
{"technic:zinc_lump", "technic:zinc_dust 2"},
|
||||
{"technic:lead_lump", "technic:lead_dust 2"},
|
||||
{"technic:sulfur_lump", "technic:sulfur_dust 2"},
|
||||
{"default:coal_lump", "technic:coal_dust 2"},
|
||||
{"default:copper_lump", "technic:copper_dust 2"},
|
||||
{"default:desert_stone", "default:desert_sand"},
|
||||
{"default:gold_lump", "technic:gold_dust 2"},
|
||||
{"default:iron_lump", "technic:wrought_iron_dust 2"},
|
||||
{"technic:chromium_lump", "technic:chromium_dust 2"},
|
||||
{"technic:uranium_lump", "technic:uranium_dust 2"},
|
||||
{"technic:zinc_lump", "technic:zinc_dust 2"},
|
||||
{"technic:lead_lump", "technic:lead_dust 2"},
|
||||
{"technic:sulfur_lump", "technic:sulfur_dust 2"},
|
||||
{"default:stone", "technic:stone_dust"},
|
||||
{"default:sand", "technic:stone_dust"},
|
||||
|
||||
-- Other
|
||||
{"default:cobble", "default:gravel"},
|
||||
{"default:gravel", "default:dirt"},
|
||||
{"default:stone", "default:sand"},
|
||||
{"default:gravel", "default:sand"},
|
||||
{"default:sandstone", "default:sand 2"}, -- reverse recipe can be found in the compressor
|
||||
}
|
||||
|
||||
-- defuse the sandstone -> 4 sand recipe to avoid infinite sand bugs (also consult the inverse compressor recipe)
|
||||
minetest.register_craft({
|
||||
output = "default:sandstone 0",
|
||||
minetest.clear_craft({
|
||||
recipe = {
|
||||
{'default:sandstone'}
|
||||
},
|
||||
@ -62,12 +62,6 @@ for _, data in pairs(recipes) do
|
||||
technic.register_grinder_recipe({input = {data[1]}, output = data[2]})
|
||||
end
|
||||
|
||||
-- defuse common grinder unfriendly recipes
|
||||
if minetest.get_modpath("fake_fire") then -- from homedecor_modpack
|
||||
minetest.register_craft({ output='default:cobble 0', recipe={{'default:cobble'}}})
|
||||
minetest.register_craft({ output='default:gravel 0', recipe={{'default:gravel'}}})
|
||||
end
|
||||
|
||||
-- dusts
|
||||
local function register_dust(name, ingot)
|
||||
local lname = string.lower(name)
|
||||
@ -91,6 +85,7 @@ register_dust("Brass", "technic:brass_ingot")
|
||||
register_dust("Bronze", "default:bronze_ingot")
|
||||
register_dust("Carbon Steel", "technic:carbon_steel_ingot")
|
||||
register_dust("Cast Iron", "technic:cast_iron_ingot")
|
||||
register_dust("Chernobylite", "technic:chernobylite_block")
|
||||
register_dust("Chromium", "technic:chromium_ingot")
|
||||
register_dust("Coal", nil)
|
||||
register_dust("Copper", "default:copper_ingot")
|
||||
@ -99,6 +94,7 @@ register_dust("Gold", "default:gold_ingot")
|
||||
register_dust("Mithril", "moreores:mithril_ingot")
|
||||
register_dust("Silver", "moreores:silver_ingot")
|
||||
register_dust("Stainless Steel", "technic:stainless_steel_ingot")
|
||||
register_dust("Stone", "default:stone")
|
||||
register_dust("Sulfur", nil)
|
||||
register_dust("Tin", "moreores:tin_ingot")
|
||||
register_dust("Wrought Iron", "technic:wrought_iron_ingot")
|
||||
|
@ -1,6 +1,9 @@
|
||||
|
||||
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)
|
||||
@ -10,6 +13,9 @@ local tube = {
|
||||
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},
|
||||
@ -133,15 +139,21 @@ function technic.register_base_machine(data)
|
||||
inv:set_list("dst", inv:get_list("dst_tmp"))
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local tentry = tube_entry
|
||||
if ltier == "lv" then
|
||||
tentry = ""
|
||||
end
|
||||
minetest.register_node("technic:"..ltier.."_"..machine_name, {
|
||||
description = machine_desc:format(tier),
|
||||
tiles = {"technic_"..ltier.."_"..machine_name.."_top.png",
|
||||
"technic_"..ltier.."_"..machine_name.."_bottom.png",
|
||||
"technic_"..ltier.."_"..machine_name.."_side.png",
|
||||
"technic_"..ltier.."_"..machine_name.."_side.png",
|
||||
"technic_"..ltier.."_"..machine_name.."_side.png",
|
||||
"technic_"..ltier.."_"..machine_name.."_front.png"},
|
||||
tiles = {
|
||||
"technic_"..ltier.."_"..machine_name.."_top.png"..tentry,
|
||||
"technic_"..ltier.."_"..machine_name.."_bottom.png"..tentry,
|
||||
"technic_"..ltier.."_"..machine_name.."_side.png"..tentry,
|
||||
"technic_"..ltier.."_"..machine_name.."_side.png"..tentry,
|
||||
"technic_"..ltier.."_"..machine_name.."_side.png"..tentry,
|
||||
"technic_"..ltier.."_"..machine_name.."_front.png"
|
||||
},
|
||||
paramtype2 = "facedir",
|
||||
groups = groups,
|
||||
tube = data.tube and tube or nil,
|
||||
@ -151,9 +163,23 @@ function technic.register_base_machine(data)
|
||||
on_construct = function(pos)
|
||||
local node = minetest.get_node(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
|
||||
local form_buttons = ""
|
||||
if not string.find(node.name, ":lv_") then
|
||||
form_buttons = fs_helpers.cycling_button(
|
||||
meta,
|
||||
pipeworks.button_base,
|
||||
"splitstacks",
|
||||
{
|
||||
pipeworks.button_off,
|
||||
pipeworks.button_on
|
||||
}
|
||||
)..pipeworks.button_label
|
||||
end
|
||||
|
||||
meta:set_string("infotext", machine_desc:format(tier))
|
||||
meta:set_int("tube_time", 0)
|
||||
meta:set_string("formspec", formspec)
|
||||
meta:set_string("formspec", formspec..form_buttons)
|
||||
local inv = meta:get_inventory()
|
||||
inv:set_size("src", input_size)
|
||||
inv:set_size("dst", 4)
|
||||
@ -166,17 +192,38 @@ function technic.register_base_machine(data)
|
||||
allow_metadata_inventory_move = technic.machine_inventory_move,
|
||||
technic_run = run,
|
||||
after_place_node = data.tube and pipeworks.after_place,
|
||||
after_dig_node = technic.machine_after_dig_node
|
||||
after_dig_node = technic.machine_after_dig_node,
|
||||
on_receive_fields = function(pos, formname, fields, sender)
|
||||
local node = minetest.get_node(pos)
|
||||
if not pipeworks.may_configure(pos, sender) then return end
|
||||
fs_helpers.on_receive_fields(pos, fields)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local form_buttons = ""
|
||||
if not string.find(node.name, ":lv_") then
|
||||
form_buttons = fs_helpers.cycling_button(
|
||||
meta,
|
||||
pipeworks.button_base,
|
||||
"splitstacks",
|
||||
{
|
||||
pipeworks.button_off,
|
||||
pipeworks.button_on
|
||||
}
|
||||
)..pipeworks.button_label
|
||||
end
|
||||
meta:set_string("formspec", formspec..form_buttons)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("technic:"..ltier.."_"..machine_name.."_active",{
|
||||
description = machine_desc:format(tier),
|
||||
tiles = {"technic_"..ltier.."_"..machine_name.."_top.png",
|
||||
"technic_"..ltier.."_"..machine_name.."_bottom.png",
|
||||
"technic_"..ltier.."_"..machine_name.."_side.png",
|
||||
"technic_"..ltier.."_"..machine_name.."_side.png",
|
||||
"technic_"..ltier.."_"..machine_name.."_side.png",
|
||||
"technic_"..ltier.."_"..machine_name.."_front_active.png"},
|
||||
tiles = {
|
||||
"technic_"..ltier.."_"..machine_name.."_top.png"..tentry,
|
||||
"technic_"..ltier.."_"..machine_name.."_bottom.png"..tentry,
|
||||
"technic_"..ltier.."_"..machine_name.."_side.png"..tentry,
|
||||
"technic_"..ltier.."_"..machine_name.."_side.png"..tentry,
|
||||
"technic_"..ltier.."_"..machine_name.."_side.png"..tentry,
|
||||
"technic_"..ltier.."_"..machine_name.."_front_active.png"
|
||||
},
|
||||
paramtype2 = "facedir",
|
||||
drop = "technic:"..ltier.."_"..machine_name,
|
||||
groups = active_groups,
|
||||
@ -190,6 +237,25 @@ function technic.register_base_machine(data)
|
||||
allow_metadata_inventory_move = technic.machine_inventory_move,
|
||||
technic_run = run,
|
||||
technic_disabled_machine_name = "technic:"..ltier.."_"..machine_name,
|
||||
on_receive_fields = function(pos, formname, fields, sender)
|
||||
local node = minetest.get_node(pos)
|
||||
if not pipeworks.may_configure(pos, sender) then return end
|
||||
fs_helpers.on_receive_fields(pos, fields)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local form_buttons = ""
|
||||
if not string.find(node.name, ":lv_") then
|
||||
form_buttons = fs_helpers.cycling_button(
|
||||
meta,
|
||||
pipeworks.button_base,
|
||||
"splitstacks",
|
||||
{
|
||||
pipeworks.button_off,
|
||||
pipeworks.button_on
|
||||
}
|
||||
)..pipeworks.button_label
|
||||
end
|
||||
meta:set_string("formspec", formspec..form_buttons)
|
||||
end,
|
||||
})
|
||||
|
||||
technic.register_machine(tier, "technic:"..ltier.."_"..machine_name, technic.receiver)
|
||||
|
@ -7,14 +7,128 @@
|
||||
-- Once the receiver side is powered it will deliver power to the other side.
|
||||
-- Unused power is wasted just like any other producer!
|
||||
|
||||
local digilines_path = minetest.get_modpath("digilines")
|
||||
|
||||
local S = technic.getter
|
||||
|
||||
local run = function(pos, node)
|
||||
local demand = 10000
|
||||
local cable_entry = "^technic_cable_connection_overlay.png"
|
||||
|
||||
local function set_supply_converter_formspec(meta)
|
||||
local formspec = "size[5,2.25]"..
|
||||
"field[0.3,0.5;2,1;power;"..S("Input Power")..";"..meta:get_int("power").."]"
|
||||
if digilines_path then
|
||||
formspec = formspec..
|
||||
"field[2.3,0.5;3,1;channel;Digiline Channel;"..meta:get_string("channel").."]"
|
||||
end
|
||||
-- The names for these toggle buttons are explicit about which
|
||||
-- state they'll switch to, so that multiple presses (arising
|
||||
-- from the ambiguity between lag and a missed press) only make
|
||||
-- the single change that the user expects.
|
||||
if meta:get_int("mesecon_mode") == 0 then
|
||||
formspec = formspec.."button[0,1;5,1;mesecon_mode_1;"..S("Ignoring Mesecon Signal").."]"
|
||||
else
|
||||
formspec = formspec.."button[0,1;5,1;mesecon_mode_0;"..S("Controlled by Mesecon Signal").."]"
|
||||
end
|
||||
if meta:get_int("enabled") == 0 then
|
||||
formspec = formspec.."button[0,1.75;5,1;enable;"..S("%s Disabled"):format(S("Supply Converter")).."]"
|
||||
else
|
||||
formspec = formspec.."button[0,1.75;5,1;disable;"..S("%s Enabled"):format(S("Supply Converter")).."]"
|
||||
end
|
||||
meta:set_string("formspec", formspec)
|
||||
end
|
||||
|
||||
local supply_converter_receive_fields = function(pos, formname, fields, sender)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local power = nil
|
||||
if fields.power then
|
||||
power = tonumber(fields.power) or 0
|
||||
power = math.max(power, 0)
|
||||
power = math.min(power, 10000)
|
||||
power = 100 * math.floor(power / 100)
|
||||
if power == meta:get_int("power") then power = nil end
|
||||
end
|
||||
if power then meta:set_int("power", power) end
|
||||
if fields.channel then meta:set_string("channel", fields.channel) end
|
||||
if fields.enable then meta:set_int("enabled", 1) end
|
||||
if fields.disable then meta:set_int("enabled", 0) end
|
||||
if fields.mesecon_mode_0 then meta:set_int("mesecon_mode", 0) end
|
||||
if fields.mesecon_mode_1 then meta:set_int("mesecon_mode", 1) end
|
||||
set_supply_converter_formspec(meta)
|
||||
end
|
||||
|
||||
local mesecons = {
|
||||
effector = {
|
||||
action_on = function(pos, node)
|
||||
minetest.get_meta(pos):set_int("mesecon_effect", 1)
|
||||
end,
|
||||
action_off = function(pos, node)
|
||||
minetest.get_meta(pos):set_int("mesecon_effect", 0)
|
||||
end
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
local digiline_def = {
|
||||
receptor = {action = function() end},
|
||||
effector = {
|
||||
action = function(pos, node, channel, msg)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if channel ~= meta:get_string("channel") then
|
||||
return
|
||||
end
|
||||
msg = msg:lower()
|
||||
if msg == "get" then
|
||||
digilines.receptor_send(pos, digilines.rules.default, channel, {
|
||||
enabled = meta:get_int("enabled"),
|
||||
power = meta:get_int("power"),
|
||||
mesecon_mode = meta:get_int("mesecon_mode")
|
||||
})
|
||||
return
|
||||
elseif msg == "off" then
|
||||
meta:set_int("enabled", 0)
|
||||
elseif msg == "on" then
|
||||
meta:set_int("enabled", 1)
|
||||
elseif msg == "toggle" then
|
||||
local onn = meta:get_int("enabled")
|
||||
onn = -(onn-1) -- Mirror onn with pivot 0.5, so switch between 1 and 0.
|
||||
meta:set_int("enabled", onn)
|
||||
elseif msg:sub(1, 5) == "power" then
|
||||
local power = tonumber(msg:sub(7))
|
||||
if not power then
|
||||
return
|
||||
end
|
||||
power = math.max(power, 0)
|
||||
power = math.min(power, 10000)
|
||||
power = 100 * math.floor(power / 100)
|
||||
meta:set_int("power", power)
|
||||
elseif msg:sub(1, 12) == "mesecon_mode" then
|
||||
meta:set_int("mesecon_mode", tonumber(msg:sub(14)))
|
||||
end
|
||||
set_supply_converter_formspec(meta)
|
||||
end
|
||||
},
|
||||
}
|
||||
|
||||
local run = function(pos, node, run_stage)
|
||||
-- run only in producer stage.
|
||||
if run_stage == technic.receiver then
|
||||
return
|
||||
end
|
||||
|
||||
local remain = 0.9
|
||||
-- Machine information
|
||||
local machine_name = S("Supply Converter")
|
||||
local meta = minetest.get_meta(pos)
|
||||
local enabled = meta:get_string("enabled")
|
||||
if enabled == "" then
|
||||
-- Backwards compatibility
|
||||
minetest.registered_nodes["technic:supply_converter"].on_construct(pos)
|
||||
enabled = true
|
||||
else
|
||||
enabled = enabled == "1"
|
||||
end
|
||||
enabled = enabled and (meta:get_int("mesecon_mode") == 0 or meta:get_int("mesecon_effect") ~= 0)
|
||||
local demand = enabled and meta:get_int("power") or 0
|
||||
|
||||
local pos_up = {x=pos.x, y=pos.y+1, z=pos.z}
|
||||
local pos_down = {x=pos.x, y=pos.y-1, z=pos.z}
|
||||
@ -46,19 +160,35 @@ end
|
||||
|
||||
minetest.register_node("technic:supply_converter", {
|
||||
description = S("Supply Converter"),
|
||||
tiles = {"technic_supply_converter_top.png", "technic_supply_converter_bottom.png",
|
||||
"technic_supply_converter_side.png", "technic_supply_converter_side.png",
|
||||
"technic_supply_converter_side.png", "technic_supply_converter_side.png"},
|
||||
tiles = {
|
||||
"technic_supply_converter_tb.png"..cable_entry,
|
||||
"technic_supply_converter_tb.png"..cable_entry,
|
||||
"technic_supply_converter_side.png",
|
||||
"technic_supply_converter_side.png",
|
||||
"technic_supply_converter_side.png",
|
||||
"technic_supply_converter_side.png"
|
||||
},
|
||||
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
|
||||
technic_machine=1, technic_all_tiers=1},
|
||||
connect_sides = {"top", "bottom"},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
on_receive_fields = supply_converter_receive_fields,
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("infotext", S("Supply Converter"))
|
||||
meta:set_float("active", false)
|
||||
if digilines_path then
|
||||
meta:set_string("channel", "supply_converter"..minetest.pos_to_string(pos))
|
||||
end
|
||||
meta:set_int("power", 10000)
|
||||
meta:set_int("enabled", 1)
|
||||
meta:set_int("mesecon_mode", 0)
|
||||
meta:set_int("mesecon_effect", 0)
|
||||
set_supply_converter_formspec(meta)
|
||||
end,
|
||||
mesecons = mesecons,
|
||||
digiline = digiline_def,
|
||||
technic_run = run,
|
||||
technic_on_disable = run,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
|
@ -1,40 +1,15 @@
|
||||
-- SWITCHING STATION
|
||||
-- The switching station is the center of all power distribution on an electric network.
|
||||
--
|
||||
-- The station collects power from sources (PR), distributes it to sinks (RE),
|
||||
-- and uses the excess/shortfall to charge and discharge batteries (BA).
|
||||
--
|
||||
-- For now, all supply and demand values are expressed in kW.
|
||||
--
|
||||
-- It works like this:
|
||||
-- All PR,BA,RE nodes are indexed and tagged with the switching station.
|
||||
-- The tagging is to allow more stations to be built without allowing a cheat
|
||||
-- with duplicating power.
|
||||
-- All the RE nodes are queried for their current EU demand. Those which are off
|
||||
-- would require no or a small standby EU demand, while those which are on would
|
||||
-- require more.
|
||||
-- If the total demand is less than the available power they are all updated with the
|
||||
-- demand number.
|
||||
-- If any surplus exists from the PR nodes the batteries will be charged evenly with this.
|
||||
-- If the total demand requires draw on the batteries they will be discharged evenly.
|
||||
--
|
||||
-- If the total demand is more than the available power all RE nodes will be shut down.
|
||||
-- We have a brown-out situation.
|
||||
--
|
||||
-- Hence all the power distribution logic resides in this single node.
|
||||
--
|
||||
-- Nodes connected to the network will have one or more of these parameters as meta data:
|
||||
-- <LV|MV|HV>_EU_supply : Exists for PR and BA node types. This is the EU value supplied by the node. Output
|
||||
-- <LV|MV|HV>_EU_demand : Exists for RE and BA node types. This is the EU value the node requires to run. Output
|
||||
-- <LV|MV|HV>_EU_input : Exists for RE and BA node types. This is the actual EU value the network can give the node. Input
|
||||
--
|
||||
-- The reason the LV|MV|HV type is prepended toe meta data is because some machine could require several supplies to work.
|
||||
-- This way the supplies are separated per network.
|
||||
-- See also technic/doc/api.md
|
||||
|
||||
technic.networks = {}
|
||||
technic.cables = {}
|
||||
|
||||
local mesecons_path = minetest.get_modpath("mesecons")
|
||||
local digilines_path = minetest.get_modpath("digilines")
|
||||
|
||||
local S = technic.getter
|
||||
|
||||
local cable_entry = "^technic_cable_connection_overlay.png"
|
||||
|
||||
minetest.register_craft({
|
||||
output = "technic:switching_station",
|
||||
recipe = {
|
||||
@ -44,11 +19,22 @@ minetest.register_craft({
|
||||
}
|
||||
})
|
||||
|
||||
local mesecon_def
|
||||
if mesecons_path then
|
||||
mesecon_def = {effector = {
|
||||
rules = mesecon.rules.default,
|
||||
}}
|
||||
end
|
||||
|
||||
minetest.register_node("technic:switching_station",{
|
||||
description = S("Switching Station"),
|
||||
tiles = {"technic_water_mill_top_active.png", "technic_water_mill_top_active.png",
|
||||
"technic_water_mill_top_active.png", "technic_water_mill_top_active.png",
|
||||
"technic_water_mill_top_active.png", "technic_water_mill_top_active.png"},
|
||||
tiles = {
|
||||
"technic_water_mill_top_active.png",
|
||||
"technic_water_mill_top_active.png"..cable_entry,
|
||||
"technic_water_mill_top_active.png",
|
||||
"technic_water_mill_top_active.png",
|
||||
"technic_water_mill_top_active.png",
|
||||
"technic_water_mill_top_active.png"},
|
||||
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_all_tiers=1},
|
||||
connect_sides = {"bottom"},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
@ -56,7 +42,45 @@ minetest.register_node("technic:switching_station",{
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("infotext", S("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}]")
|
||||
end,
|
||||
after_dig_node = function(pos)
|
||||
minetest.forceload_free_block(pos)
|
||||
pos.y = pos.y - 1
|
||||
minetest.forceload_free_block(pos)
|
||||
end,
|
||||
on_receive_fields = function(pos, formname, fields, sender)
|
||||
if not fields.channel then
|
||||
return
|
||||
end
|
||||
local plname = sender:get_player_name()
|
||||
if minetest.is_protected(pos, plname) then
|
||||
minetest.record_protection_violation(pos, plname)
|
||||
return
|
||||
end
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("channel", fields.channel)
|
||||
end,
|
||||
mesecons = mesecon_def,
|
||||
digiline = {
|
||||
receptor = {action = function() end},
|
||||
effector = {
|
||||
action = function(pos, node, channel, msg)
|
||||
if msg ~= "GET" and msg ~= "get" then
|
||||
return
|
||||
end
|
||||
local meta = minetest.get_meta(pos)
|
||||
if channel ~= meta:get_string("channel") then
|
||||
return
|
||||
end
|
||||
digilines.receptor_send(pos, digilines.rules.default, channel, {
|
||||
supply = meta:get_int("supply"),
|
||||
demand = meta:get_int("demand")
|
||||
})
|
||||
end
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
--------------------------------------------------
|
||||
@ -64,7 +88,8 @@ minetest.register_node("technic:switching_station",{
|
||||
--------------------------------------------------
|
||||
|
||||
-- Add a wire node to the LV/MV/HV network
|
||||
local add_new_cable_node = function(nodes, pos)
|
||||
local add_new_cable_node = function(nodes, pos, network_id)
|
||||
technic.cables[minetest.hash_node_position(pos)] = network_id
|
||||
-- Ignore if the node has already been added
|
||||
for i = 1, #nodes do
|
||||
if pos.x == nodes[i].x and
|
||||
@ -78,31 +103,31 @@ local add_new_cable_node = function(nodes, pos)
|
||||
end
|
||||
|
||||
-- Generic function to add found connected nodes to the right classification array
|
||||
local check_node_subp = function(PR_nodes, RE_nodes, BA_nodes, SP_nodes, all_nodes, pos, machines, tier, sw_pos, from_below)
|
||||
local check_node_subp = function(PR_nodes, RE_nodes, BA_nodes, SP_nodes, all_nodes, pos, machines, tier, sw_pos, from_below, network_id)
|
||||
technic.get_or_load_node(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local name = minetest.get_node(pos).name
|
||||
|
||||
if technic.is_tier_cable(name, tier) then
|
||||
add_new_cable_node(all_nodes, pos)
|
||||
add_new_cable_node(all_nodes, pos,network_id)
|
||||
elseif machines[name] then
|
||||
--dprint(name.." is a "..machines[name])
|
||||
meta:set_string(tier.."_network",minetest.pos_to_string(sw_pos))
|
||||
if machines[name] == technic.producer then
|
||||
add_new_cable_node(PR_nodes, pos)
|
||||
add_new_cable_node(PR_nodes, pos, network_id)
|
||||
elseif machines[name] == technic.receiver then
|
||||
add_new_cable_node(RE_nodes, pos)
|
||||
add_new_cable_node(RE_nodes, pos, network_id)
|
||||
elseif machines[name] == technic.producer_receiver then
|
||||
add_new_cable_node(PR_nodes, pos)
|
||||
add_new_cable_node(RE_nodes, pos)
|
||||
add_new_cable_node(PR_nodes, pos, network_id)
|
||||
add_new_cable_node(RE_nodes, pos, network_id)
|
||||
elseif machines[name] == "SPECIAL" and
|
||||
(pos.x ~= sw_pos.x or pos.y ~= sw_pos.y or pos.z ~= sw_pos.z) and
|
||||
from_below then
|
||||
-- Another switching station -> disable it
|
||||
add_new_cable_node(SP_nodes, pos)
|
||||
add_new_cable_node(SP_nodes, pos, network_id)
|
||||
meta:set_int("active", 0)
|
||||
meta:set_string("active_pos", minetest.serialize(sw_pos))
|
||||
elseif machines[name] == technic.battery then
|
||||
add_new_cable_node(BA_nodes, pos)
|
||||
add_new_cable_node(BA_nodes, pos, network_id)
|
||||
end
|
||||
|
||||
meta:set_int(tier.."_EU_timeout", 2) -- Touch node
|
||||
@ -110,7 +135,7 @@ local check_node_subp = function(PR_nodes, RE_nodes, BA_nodes, SP_nodes, all_nod
|
||||
end
|
||||
|
||||
-- Traverse a network given a list of machines and a cable type name
|
||||
local traverse_network = function(PR_nodes, RE_nodes, BA_nodes, SP_nodes, all_nodes, i, machines, tier, sw_pos)
|
||||
local traverse_network = function(PR_nodes, RE_nodes, BA_nodes, SP_nodes, all_nodes, i, machines, tier, sw_pos, network_id)
|
||||
local pos = all_nodes[i]
|
||||
local positions = {
|
||||
{x=pos.x+1, y=pos.y, z=pos.z},
|
||||
@ -121,7 +146,7 @@ local traverse_network = function(PR_nodes, RE_nodes, BA_nodes, SP_nodes, all_no
|
||||
{x=pos.x, y=pos.y, z=pos.z-1}}
|
||||
--print("ON")
|
||||
for i, cur_pos in pairs(positions) do
|
||||
check_node_subp(PR_nodes, RE_nodes, BA_nodes, SP_nodes, all_nodes, cur_pos, machines, tier, sw_pos, i == 3)
|
||||
check_node_subp(PR_nodes, RE_nodes, BA_nodes, SP_nodes, all_nodes, cur_pos, machines, tier, sw_pos, i == 3, network_id)
|
||||
end
|
||||
end
|
||||
|
||||
@ -153,11 +178,11 @@ local get_network = function(sw_pos, pos1, tier)
|
||||
local all_nodes = {pos1}
|
||||
repeat
|
||||
traverse_network(PR_nodes, RE_nodes, BA_nodes, SP_nodes, all_nodes,
|
||||
i, technic.machines[tier], tier, sw_pos)
|
||||
i, technic.machines[tier], tier, sw_pos, minetest.hash_node_position(pos1))
|
||||
i = i + 1
|
||||
until all_nodes[i] == nil
|
||||
technic.networks[minetest.hash_node_position(pos1)] = {tier = tier, PR_nodes = PR_nodes,
|
||||
RE_nodes = RE_nodes, BA_nodes = BA_nodes, SP_nodes = SP_nodes}
|
||||
RE_nodes = RE_nodes, BA_nodes = BA_nodes, SP_nodes = SP_nodes, all_nodes = all_nodes}
|
||||
return PR_nodes, BA_nodes, RE_nodes
|
||||
end
|
||||
|
||||
@ -184,31 +209,34 @@ minetest.register_abm({
|
||||
local RE_nodes
|
||||
local machine_name = S("Switching Station")
|
||||
|
||||
if meta:get_int("active") ~= 1 then
|
||||
meta:set_int("active", 1)
|
||||
local active_pos = minetest.deserialize(meta:get_string("active_pos"))
|
||||
if active_pos then
|
||||
local meta1 = minetest.get_meta(active_pos)
|
||||
meta:set_string("infotext", S("%s (Slave)"):format(meta1:get_string("infotext")))
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
-- Which kind of network are we on:
|
||||
pos1 = {x=pos.x, y=pos.y-1, z=pos.z}
|
||||
|
||||
--Disable if necessary
|
||||
if meta:get_int("active") ~= 1 then
|
||||
minetest.forceload_free_block(pos)
|
||||
minetest.forceload_free_block(pos1)
|
||||
meta:set_string("infotext",S("%s Already Present"):format(machine_name))
|
||||
return
|
||||
end
|
||||
|
||||
local name = minetest.get_node(pos1).name
|
||||
local tier = technic.get_cable_tier(name)
|
||||
if tier then
|
||||
-- Forceload switching station
|
||||
minetest.forceload_block(pos)
|
||||
minetest.forceload_block(pos1)
|
||||
PR_nodes, BA_nodes, RE_nodes = get_network(pos, pos1, tier)
|
||||
else
|
||||
--dprint("Not connected to a network")
|
||||
meta:set_string("infotext", S("%s Has No Network"):format(machine_name))
|
||||
minetest.forceload_free_block(pos)
|
||||
minetest.forceload_free_block(pos1)
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
-- Run all the nodes
|
||||
local function run_nodes(list)
|
||||
local function run_nodes(list, run_stage)
|
||||
for _, pos2 in ipairs(list) do
|
||||
technic.get_or_load_node(pos2)
|
||||
local node2 = minetest.get_node(pos2)
|
||||
@ -217,14 +245,14 @@ minetest.register_abm({
|
||||
nodedef = minetest.registered_nodes[node2.name]
|
||||
end
|
||||
if nodedef and nodedef.technic_run then
|
||||
nodedef.technic_run(pos2, node2)
|
||||
nodedef.technic_run(pos2, node2, run_stage)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
run_nodes(PR_nodes)
|
||||
run_nodes(RE_nodes)
|
||||
run_nodes(BA_nodes)
|
||||
|
||||
run_nodes(PR_nodes, technic.producer)
|
||||
run_nodes(RE_nodes, technic.receiver)
|
||||
run_nodes(BA_nodes, technic.battery)
|
||||
|
||||
-- Strings for the meta data
|
||||
local eu_demand_str = tier.."_EU_demand"
|
||||
@ -291,6 +319,23 @@ minetest.register_abm({
|
||||
S("@1. Supply: @2 Demand: @3",
|
||||
machine_name, technic.pretty_num(PR_eu_supply), technic.pretty_num(RE_eu_demand)))
|
||||
|
||||
-- If mesecon signal and power supply or demand changed then
|
||||
-- send them via digilines.
|
||||
if mesecons_path and digilines_path and mesecon.is_powered(pos) then
|
||||
if PR_eu_supply ~= meta:get_int("supply") or
|
||||
RE_eu_demand ~= meta:get_int("demand") then
|
||||
local channel = meta:get_string("channel")
|
||||
digilines.receptor_send(pos, digilines.rules.default, channel, {
|
||||
supply = PR_eu_supply,
|
||||
demand = RE_eu_demand
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
-- Data that will be used by the power monitor
|
||||
meta:set_int("supply",PR_eu_supply)
|
||||
meta:set_int("demand",RE_eu_demand)
|
||||
|
||||
-- If the PR supply is enough for the RE demand supply them all
|
||||
if PR_eu_supply >= RE_eu_demand then
|
||||
--dprint("PR_eu_supply"..PR_eu_supply.." >= RE_eu_demand"..RE_eu_demand)
|
||||
@ -352,6 +397,7 @@ minetest.register_abm({
|
||||
meta1 = minetest.get_meta(pos1)
|
||||
meta1:set_int(eu_input_str, 0)
|
||||
end
|
||||
|
||||
end,
|
||||
})
|
||||
|
||||
@ -370,10 +416,12 @@ local function switching_station_timeout_count(pos, tier)
|
||||
end
|
||||
end
|
||||
minetest.register_abm({
|
||||
label = "Machines: timeout check",
|
||||
nodenames = {"group:technic_machine"},
|
||||
interval = 1,
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local meta = minetest.get_meta(pos)
|
||||
for tier, machines in pairs(technic.machines) do
|
||||
if machines[node.name] and switching_station_timeout_count(pos, tier) then
|
||||
local nodedef = minetest.registered_nodes[node.name]
|
||||
@ -392,6 +440,24 @@ minetest.register_abm({
|
||||
end,
|
||||
})
|
||||
|
||||
--Re-enable disabled switching station if necessary, similar to the timeout above
|
||||
minetest.register_abm({
|
||||
label = "Machines: re-enable check",
|
||||
nodenames = {"technic:switching_station"},
|
||||
interval = 1,
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local pos1 = {x=pos.x,y=pos.y-1,z=pos.z}
|
||||
local tier = technic.get_cable_tier(minetest.get_node(pos1).name)
|
||||
if not tier then return end
|
||||
if switching_station_timeout_count(pos, tier) then
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_int("active",1)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
for tier, machines in pairs(technic.machines) do
|
||||
-- SPECIAL will not be traversed
|
||||
technic.register_machine(tier, "technic:switching_station", "SPECIAL")
|
||||
|
362
mods/modpacks/technic/technic/models/technic_reactor.obj
Normal file
@ -0,0 +1,362 @@
|
||||
# Blender v2.78 (sub 0) OBJ File: 'technic-reactor.blend'
|
||||
# www.blender.org
|
||||
o Cube.002
|
||||
v 0.249998 -0.500500 -0.249998
|
||||
v 0.249998 -0.500500 0.249998
|
||||
v -0.249999 -0.500500 -0.249998
|
||||
v -0.249999 -0.500500 0.249998
|
||||
v 0.283224 0.283132 0.423876
|
||||
v 0.283224 -0.283316 0.423876
|
||||
v -0.283224 0.283132 0.423875
|
||||
v -0.283224 -0.283316 0.423875
|
||||
v 0.195088 -0.195188 0.470985
|
||||
v 0.195088 0.194988 0.470985
|
||||
v -0.195088 -0.195188 0.470985
|
||||
v -0.195088 0.194988 0.470985
|
||||
v 0.099454 -0.099560 0.499495
|
||||
v 0.099454 0.099349 0.499495
|
||||
v -0.099455 -0.099560 0.499495
|
||||
v -0.099455 0.099349 0.499495
|
||||
v -0.360476 -0.360431 -0.360476
|
||||
v -0.195088 -0.195024 -0.470985
|
||||
v -0.195088 0.195153 -0.470985
|
||||
v 0.195089 -0.195024 -0.470985
|
||||
v 0.195089 0.195153 -0.470985
|
||||
v 0.283225 -0.283168 -0.423875
|
||||
v 0.283225 0.283281 -0.423875
|
||||
v -0.283224 -0.283168 -0.423875
|
||||
v -0.283224 0.283281 -0.423875
|
||||
v 0.099455 -0.099386 -0.499495
|
||||
v 0.099455 0.099525 -0.499495
|
||||
v -0.099455 -0.099386 -0.499495
|
||||
v -0.099455 0.099525 -0.499495
|
||||
v -0.360492 0.360411 0.360457
|
||||
v -0.099717 0.499491 0.099455
|
||||
v 0.099194 0.499491 0.099456
|
||||
v -0.195335 0.470933 0.195089
|
||||
v 0.195097 0.470933 0.195089
|
||||
v 0.194842 0.471069 0.194640
|
||||
v -0.283446 0.423808 0.283224
|
||||
v 0.283003 0.424005 0.282855
|
||||
v 0.360288 0.360647 0.360170
|
||||
v -0.099717 0.499526 -0.099455
|
||||
v 0.099194 0.499526 -0.099455
|
||||
v -0.194886 0.471001 -0.195088
|
||||
v 0.194842 0.471001 -0.195088
|
||||
v -0.195335 0.470865 -0.195343
|
||||
v -0.283076 0.423907 -0.283224
|
||||
v 0.283003 0.423907 -0.283224
|
||||
v -0.360358 0.360522 -0.360476
|
||||
v 0.360429 0.360474 -0.360515
|
||||
v 0.360664 -0.360306 -0.360247
|
||||
v -0.423875 -0.283187 0.283224
|
||||
v -0.423875 0.283165 0.283224
|
||||
v -0.423727 -0.283464 -0.283405
|
||||
v -0.423875 0.283165 -0.283224
|
||||
v 0.283446 -0.423844 -0.283224
|
||||
v -0.283244 -0.423843 -0.283224
|
||||
v -0.470985 0.195015 -0.195088
|
||||
v -0.470985 -0.195016 -0.195088
|
||||
v -0.360287 -0.360683 0.360323
|
||||
v 0.283446 -0.423745 0.283465
|
||||
v -0.283002 -0.423942 0.283224
|
||||
v 0.360664 -0.360306 0.360247
|
||||
v 0.423875 0.283152 0.283225
|
||||
v 0.423727 0.283428 -0.283405
|
||||
v 0.424023 -0.283021 0.282947
|
||||
v -0.470985 -0.195017 0.195088
|
||||
v 0.470985 0.195317 0.195089
|
||||
v 0.424023 -0.283021 -0.282948
|
||||
v 0.470985 -0.194860 -0.195088
|
||||
v 0.470883 0.195317 -0.195279
|
||||
v 0.471087 -0.194860 0.194752
|
||||
v -0.471087 0.194824 0.194751
|
||||
v -0.499495 0.099176 0.099455
|
||||
v -0.499495 -0.099735 0.099455
|
||||
v -0.499495 0.099175 -0.099455
|
||||
v -0.499495 -0.099735 -0.099455
|
||||
v 0.499495 -0.099212 0.099456
|
||||
v 0.499495 0.099699 0.099456
|
||||
v 0.499495 -0.099212 -0.099455
|
||||
v 0.499495 0.099699 -0.099455
|
||||
v 0.254894 -0.439053 0.254894
|
||||
v 0.254894 -0.438992 -0.254894
|
||||
v -0.254894 -0.439019 -0.254894
|
||||
v -0.254664 -0.439081 0.254894
|
||||
vt 0.2500 0.0000
|
||||
vt 0.2451 0.0610
|
||||
vt 0.7549 0.0609
|
||||
vt 0.7500 0.0000
|
||||
vt 0.2500 0.0000
|
||||
vt 0.2451 0.0609
|
||||
vt 0.7547 0.0609
|
||||
vt 0.7500 0.0000
|
||||
vt 0.2500 0.0000
|
||||
vt 0.2451 0.0609
|
||||
vt 0.7549 0.0610
|
||||
vt 0.7500 0.0000
|
||||
vt 0.2498 0.0000
|
||||
vt 0.2449 0.0610
|
||||
vt 0.7547 0.0610
|
||||
vt 0.7498 0.0000
|
||||
vt 0.2168 0.2167
|
||||
vt 0.1393 0.1397
|
||||
vt 0.1397 0.8606
|
||||
vt 0.2168 0.7831
|
||||
vt 0.4004 0.4006
|
||||
vt 0.3047 0.3050
|
||||
vt 0.3047 0.6952
|
||||
vt 0.4004 0.5995
|
||||
vt 0.7830 0.2168
|
||||
vt 0.8605 0.1397
|
||||
vt 0.1393 0.1396
|
||||
vt 0.2166 0.2168
|
||||
vt 0.3049 0.3048
|
||||
vt 0.3049 0.6950
|
||||
vt 0.6949 0.3050
|
||||
vt 0.5993 0.4006
|
||||
vt 0.5993 0.5995
|
||||
vt 0.6949 0.6952
|
||||
vt 0.7830 0.7833
|
||||
vt 0.2166 0.7833
|
||||
vt 0.7832 0.7831
|
||||
vt 0.6951 0.6950
|
||||
vt 0.8602 0.8605
|
||||
vt 0.1395 0.8605
|
||||
vt 0.4005 0.5993
|
||||
vt 0.5995 0.5993
|
||||
vt 0.6951 0.3048
|
||||
vt 0.7832 0.2167
|
||||
vt 0.5995 0.4004
|
||||
vt 0.8605 0.1396
|
||||
vt 0.7834 0.2165
|
||||
vt 0.7832 0.7832
|
||||
vt 0.8605 0.8605
|
||||
vt 0.4005 0.4004
|
||||
vt 0.8605 0.8604
|
||||
vt 0.1396 0.1395
|
||||
vt 0.2170 0.2168
|
||||
vt 0.2170 0.7829
|
||||
vt 0.1397 0.8602
|
||||
vt 0.2168 0.2168
|
||||
vt 0.1397 0.1393
|
||||
vt 0.1396 0.8604
|
||||
vt 0.2168 0.7832
|
||||
vt 0.6951 0.6950
|
||||
vt 0.3053 0.6948
|
||||
vt 0.6953 0.3047
|
||||
vt 0.7831 0.2168
|
||||
vt 0.7834 0.7832
|
||||
vt 0.6953 0.6951
|
||||
vt 0.8604 0.1395
|
||||
vt 0.3052 0.3049
|
||||
vt 0.6949 0.3049
|
||||
vt 0.8602 0.1397
|
||||
vt 0.7829 0.2170
|
||||
vt 0.7832 0.7832
|
||||
vt 0.8602 0.8606
|
||||
vt 0.3052 0.6946
|
||||
vt 0.3049 0.6951
|
||||
vt 0.2171 0.2170
|
||||
vt 0.1398 0.1397
|
||||
vt 0.1395 0.8605
|
||||
vt 0.2166 0.7834
|
||||
vt 0.4005 0.4008
|
||||
vt 0.3049 0.3051
|
||||
vt 0.3047 0.6953
|
||||
vt 0.4005 0.5997
|
||||
vt 0.6951 0.6953
|
||||
vt 0.4006 0.4003
|
||||
vt 0.4006 0.5992
|
||||
vt 0.5995 0.5992
|
||||
vt 0.5995 0.4003
|
||||
vt 0.6948 0.3051
|
||||
vt 0.5995 0.4008
|
||||
vt 0.5995 0.5997
|
||||
vt 0.5997 0.4005
|
||||
vt 0.5997 0.5995
|
||||
vt 0.6951 0.3050
|
||||
vt 0.3049 0.3050
|
||||
vt 0.4008 0.4005
|
||||
vt 0.4008 0.5995
|
||||
vt 0.8603 0.1393
|
||||
vt 0.2169 0.2168
|
||||
vt 0.1397 0.1395
|
||||
vt 0.1395 0.8605
|
||||
vt 0.2166 0.7832
|
||||
vt 0.8605 0.8605
|
||||
vt 0.1393 0.1398
|
||||
vt 0.2166 0.2168
|
||||
vt 0.7832 0.2168
|
||||
vt 0.8605 0.1395
|
||||
vt 0.1393 0.8602
|
||||
vt 0.2166 0.7835
|
||||
vt 0.7830 0.7832
|
||||
vt 0.8603 0.8603
|
||||
vt 0.2451 0.2451
|
||||
vt 0.7549 0.2451
|
||||
vt 0.7547 0.7549
|
||||
vt 0.2451 0.7549
|
||||
vt 0.2500 0.7500
|
||||
vt 0.7500 0.7500
|
||||
vt 0.7500 0.2500
|
||||
vt 0.2500 0.2500
|
||||
vn 0.9968 -0.0794 -0.0000
|
||||
vn 0.0000 -0.0794 0.9968
|
||||
vn -0.9970 -0.0776 0.0002
|
||||
vn 0.0000 -0.0794 -0.9968
|
||||
vn 0.6360 0.0002 0.7717
|
||||
vn -0.2857 0.0000 -0.9583
|
||||
vn 0.0002 -0.6353 -0.7722
|
||||
vn 0.4714 -0.0000 0.8819
|
||||
vn 0.2857 0.0000 -0.9583
|
||||
vn 0.0000 -0.2857 -0.9583
|
||||
vn 0.0000 0.4714 -0.8819
|
||||
vn -0.0000 0.4714 0.8819
|
||||
vn 0.6346 -0.0000 -0.7728
|
||||
vn -0.6347 0.0001 -0.7728
|
||||
vn -0.0000 0.2857 0.9583
|
||||
vn -0.0000 -0.4714 0.8819
|
||||
vn -0.2857 -0.0000 0.9583
|
||||
vn -0.7727 0.0001 -0.6347
|
||||
vn -0.0000 -0.2857 0.9583
|
||||
vn -0.4714 0.0000 -0.8819
|
||||
vn 0.2857 -0.0000 0.9583
|
||||
vn -0.4714 -0.0000 0.8819
|
||||
vn 0.4714 0.0000 -0.8819
|
||||
vn 0.0001 0.6347 0.7728
|
||||
vn 0.0000 -0.4714 -0.8819
|
||||
vn 0.0000 0.2857 -0.9583
|
||||
vn 0.6339 0.7734 -0.0001
|
||||
vn -0.7722 -0.0002 0.6353
|
||||
vn -0.8820 0.4713 0.0000
|
||||
vn -0.4717 0.8817 -0.0002
|
||||
vn 0.0000 0.7730 -0.6344
|
||||
vn 0.0000 0.8820 -0.4713
|
||||
vn 0.7721 0.0002 0.6355
|
||||
vn 0.4711 0.8821 -0.0002
|
||||
vn 0.0000 0.0000 -1.0000
|
||||
vn 0.7732 -0.0000 -0.6342
|
||||
vn -0.0000 -0.0000 1.0000
|
||||
vn 0.9583 0.0001 -0.2859
|
||||
vn -0.7730 0.6345 -0.0000
|
||||
vn 0.8815 0.4723 -0.0001
|
||||
vn -1.0000 -0.0000 0.0000
|
||||
vn 0.9583 0.0000 0.2857
|
||||
vn 0.0000 0.6344 -0.7730
|
||||
vn -0.2867 0.9580 -0.0001
|
||||
vn -0.9580 -0.2867 0.0000
|
||||
vn 0.0000 0.9583 -0.2858
|
||||
vn 0.7733 -0.6340 0.0000
|
||||
vn 1.0000 0.0000 0.0000
|
||||
vn -0.8818 -0.0000 -0.4716
|
||||
vn 0.9585 -0.2852 -0.0002
|
||||
vn 0.2853 0.9584 -0.0001
|
||||
vn 0.9582 0.2862 -0.0002
|
||||
vn -0.0000 0.8819 0.4715
|
||||
vn 0.0002 -0.6359 0.7718
|
||||
vn -0.7728 -0.6346 0.0000
|
||||
vn -0.9586 0.2849 -0.0001
|
||||
vn -0.6353 -0.0002 0.7722
|
||||
vn -0.0000 0.9582 0.2861
|
||||
vn -0.9583 0.0000 -0.2857
|
||||
vn 0.8821 -0.0001 0.4711
|
||||
vn -0.6348 0.7727 -0.0001
|
||||
vn -0.8821 0.0001 0.4711
|
||||
vn 0.8818 0.0000 -0.4716
|
||||
vn -0.9583 -0.0000 0.2857
|
||||
vn -0.8820 -0.4713 -0.0000
|
||||
vn 0.0000 1.0000 0.0002
|
||||
vn 0.8824 -0.4705 -0.0001
|
||||
vn 0.7729 0.6346 0.0000
|
||||
vn 0.0001 0.7732 0.6342
|
||||
vn 0.0002 -0.7722 -0.6354
|
||||
vn 0.6351 -0.7724 0.0001
|
||||
vn -0.6340 -0.7733 0.0000
|
||||
vn 0.0000 -0.8817 -0.4719
|
||||
vn -0.4716 -0.8818 0.0001
|
||||
vn 0.0003 -0.7720 0.6356
|
||||
vn 0.4706 -0.8823 0.0000
|
||||
vn 0.0001 -0.8817 0.4718
|
||||
vn 0.0000 -1.0000 0.0000
|
||||
g Cube.002_Cube.002_allsides
|
||||
s off
|
||||
f 1/1/1 80/2/1 79/3/1 2/4/1
|
||||
f 2/5/2 79/6/2 82/7/2 4/8/2
|
||||
f 4/9/3 82/10/3 81/11/3 3/12/3
|
||||
f 3/13/4 81/14/4 80/15/4 1/16/4
|
||||
f 6/17/5 60/18/5 38/19/5 5/20/5
|
||||
f 28/21/6 18/22/6 19/23/6 29/24/6
|
||||
f 22/25/7 48/26/7 17/27/7 24/28/7
|
||||
f 9/29/8 6/17/8 5/20/8 10/30/8
|
||||
f 20/31/9 26/32/9 27/33/9 21/34/9
|
||||
f 26/32/10 20/31/10 18/22/10 28/21/10
|
||||
f 23/35/11 21/34/11 19/23/11 25/36/11
|
||||
f 10/30/12 5/20/12 7/37/12 12/38/12
|
||||
f 48/26/13 22/25/13 23/35/13 47/39/13
|
||||
f 24/28/14 17/27/14 46/40/14 25/36/14
|
||||
f 14/41/15 10/30/15 12/38/15 16/42/15
|
||||
f 6/17/16 9/29/16 11/43/16 8/44/16
|
||||
f 11/43/17 15/45/17 16/42/17 12/38/17
|
||||
f 17/46/18 51/47/18 52/48/18 46/49/18
|
||||
f 9/29/19 13/50/19 15/45/19 11/43/19
|
||||
f 18/22/20 24/28/20 25/36/20 19/23/20
|
||||
f 13/50/21 9/29/21 10/30/21 14/41/21
|
||||
f 8/44/22 11/43/22 12/38/22 7/37/22
|
||||
f 22/25/23 20/31/23 21/34/23 23/35/23
|
||||
f 5/20/24 38/19/24 30/51/24 7/37/24
|
||||
f 20/31/25 22/25/25 24/28/25 18/22/25
|
||||
f 21/34/26 27/33/26 29/24/26 19/23/26
|
||||
f 47/52/27 45/53/27 37/54/27 38/55/27
|
||||
f 49/56/28 57/57/28 30/58/28 50/59/28
|
||||
f 52/48/29 55/60/29 70/61/29 50/59/29
|
||||
f 43/62/30 44/63/30 36/64/30 33/65/30
|
||||
f 45/53/31 47/52/31 46/66/31 44/63/31
|
||||
f 42/67/32 45/53/32 44/63/32 43/62/32 41/68/32
|
||||
f 60/69/33 63/70/33 61/71/33 38/72/33
|
||||
f 45/53/34 42/67/34 35/73/34 34/74/34 37/54/34
|
||||
f 28/21/35 29/24/35 27/33/35 26/32/35
|
||||
f 66/75/36 48/76/36 47/77/36 62/78/36
|
||||
f 13/50/37 14/41/37 16/42/37 15/45/37
|
||||
f 77/79/38 67/80/38 68/81/38 78/82/38
|
||||
f 46/49/39 52/48/39 50/59/39 30/58/39
|
||||
f 68/81/40 62/78/40 61/71/40 65/83/40
|
||||
f 72/84/41 71/85/41 73/86/41 74/87/41
|
||||
f 69/88/42 75/89/42 76/90/42 65/83/42
|
||||
f 47/39/43 23/35/43 25/36/43 46/40/43
|
||||
f 39/91/44 41/68/44 43/62/44 33/65/44 31/92/44
|
||||
f 74/87/45 56/93/45 64/94/45 72/84/45
|
||||
f 40/95/46 42/67/46 41/68/46 39/91/46
|
||||
f 48/76/47 66/75/47 63/70/47 60/69/47
|
||||
f 77/79/48 78/82/48 76/90/48 75/89/48
|
||||
f 51/47/49 56/93/49 55/60/49 52/48/49
|
||||
f 67/80/50 77/79/50 75/89/50 69/88/50
|
||||
f 42/67/51 40/95/51 32/96/51 35/73/51
|
||||
f 78/82/52 68/81/52 65/83/52 76/90/52
|
||||
f 37/54/53 34/74/53 33/65/53 36/64/53
|
||||
f 60/18/54 6/17/54 8/44/54 57/97/54
|
||||
f 51/47/55 17/46/55 57/57/55 49/56/55
|
||||
f 55/60/56 73/86/56 71/85/56 70/61/56
|
||||
f 57/97/57 8/44/57 7/37/57 30/51/57
|
||||
f 34/74/58 35/73/58 32/96/58 31/92/58 33/65/58
|
||||
f 56/93/59 74/87/59 73/86/59 55/60/59
|
||||
f 63/70/60 69/88/60 65/83/60 61/71/60
|
||||
f 44/98/61 46/99/61 30/100/61 36/101/61
|
||||
f 64/94/62 49/56/62 50/59/62 70/61/62
|
||||
f 67/80/63 66/75/63 62/78/63 68/81/63
|
||||
f 72/84/64 64/94/64 70/61/64 71/85/64
|
||||
f 56/93/65 51/47/65 49/56/65 64/94/65
|
||||
f 40/95/66 39/91/66 31/92/66 32/96/66
|
||||
f 66/75/67 67/80/67 69/88/67 63/70/67
|
||||
f 62/78/68 47/77/68 38/72/68 61/71/68
|
||||
f 30/102/69 38/55/69 37/54/69 36/64/69
|
||||
g Cube.002_Cube.002_bottom
|
||||
f 48/103/70 53/104/70 54/105/70 17/106/70
|
||||
f 53/104/71 48/103/71 60/107/71 58/108/71
|
||||
f 17/106/72 54/105/72 59/109/72 57/110/72
|
||||
f 53/104/73 80/111/73 81/112/73 54/105/73
|
||||
f 54/105/74 81/112/74 82/113/74 59/109/74
|
||||
f 58/108/75 60/107/75 57/110/75 59/109/75
|
||||
f 79/114/76 80/111/76 53/104/76 58/108/76
|
||||
f 82/113/77 79/114/77 58/108/77 59/109/77
|
||||
f 2/115/78 4/116/78 3/117/78 1/118/78
|
@ -54,8 +54,14 @@ local rad_resistance_node = {
|
||||
["default:lava_source"] = 17,
|
||||
["default:mese"] = 21,
|
||||
["default:mossycobble"] = 15,
|
||||
["default:nyancat"] = 1000,
|
||||
["default:nyancat_rainbow"] = 1000,
|
||||
["pbj_pup:pbj_pup"] = 10000,
|
||||
["pbj_pup:pbj_pup_candies"] = 10000,
|
||||
["gloopblocks:rainbow_block_diagonal"] = 5000,
|
||||
["gloopblocks:rainbow_block_horizontal"] = 10000,
|
||||
["default:nyancat"] = 10000,
|
||||
["default:nyancat_rainbow"] = 10000,
|
||||
["nyancat:nyancat"] = 10000,
|
||||
["nyancat:nyancat_rainbow"] = 10000,
|
||||
["default:obsidian"] = 18,
|
||||
["default:obsidian_glass"] = 18,
|
||||
["default:sand"] = 10,
|
||||
@ -338,8 +344,9 @@ local function dmg_abm(pos, node)
|
||||
end
|
||||
end
|
||||
|
||||
if minetest.setting_getbool("enable_damage") then
|
||||
if minetest.settings:get_bool("enable_damage") then
|
||||
minetest.register_abm({
|
||||
label = "Radiation damage",
|
||||
nodenames = {"group:radioactive"},
|
||||
interval = 1,
|
||||
chance = 1,
|
||||
@ -377,7 +384,7 @@ for _, state in pairs({"flowing", "source"}) do
|
||||
minetest.register_node("technic:corium_"..state, {
|
||||
description = S(state == "source" and "Corium Source" or "Flowing Corium"),
|
||||
drawtype = (state == "source" and "liquid" or "flowingliquid"),
|
||||
[state == "source" and "tiles" or "special_tiles"] = {{
|
||||
tiles = {{
|
||||
name = "technic_corium_"..state.."_animated.png",
|
||||
animation = {
|
||||
type = "vertical_frames",
|
||||
@ -386,6 +393,28 @@ for _, state in pairs({"flowing", "source"}) do
|
||||
length = 3.0,
|
||||
},
|
||||
}},
|
||||
special_tiles = {
|
||||
{
|
||||
name = "technic_corium_"..state.."_animated.png",
|
||||
backface_culling = false,
|
||||
animation = {
|
||||
type = "vertical_frames",
|
||||
aspect_w = 16,
|
||||
aspect_h = 16,
|
||||
length = 3.0,
|
||||
},
|
||||
},
|
||||
{
|
||||
name = "technic_corium_"..state.."_animated.png",
|
||||
backface_culling = true,
|
||||
animation = {
|
||||
type = "vertical_frames",
|
||||
aspect_w = 16,
|
||||
aspect_h = 16,
|
||||
length = 3.0,
|
||||
},
|
||||
},
|
||||
},
|
||||
paramtype = "light",
|
||||
paramtype2 = (state == "flowing" and "flowingliquid" or nil),
|
||||
light_source = (state == "source" and 8 or 5),
|
||||
@ -432,6 +461,7 @@ minetest.register_node("technic:chernobylite_block", {
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
label = "Corium: boil-off water (sources)",
|
||||
nodenames = {"group:water"},
|
||||
neighbors = {"technic:corium_source"},
|
||||
interval = 1,
|
||||
@ -442,6 +472,7 @@ minetest.register_abm({
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
label = "Corium: boil-off water (flowing)",
|
||||
nodenames = {"technic:corium_flowing"},
|
||||
neighbors = {"group:water"},
|
||||
interval = 1,
|
||||
@ -452,6 +483,7 @@ minetest.register_abm({
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
label = "Corium: become chernobylite",
|
||||
nodenames = {"technic:corium_flowing"},
|
||||
interval = 5,
|
||||
chance = (griefing and 10 or 1),
|
||||
@ -462,6 +494,7 @@ minetest.register_abm({
|
||||
|
||||
if griefing then
|
||||
minetest.register_abm({
|
||||
label = "Corium: griefing",
|
||||
nodenames = {"technic:corium_source", "technic:corium_flowing"},
|
||||
interval = 4,
|
||||
chance = 4,
|
||||
|
Before Width: | Height: | Size: 576 B |
Before Width: | Height: | Size: 639 B |
Before Width: | Height: | Size: 587 B |
After Width: | Height: | Size: 299 B |
After Width: | Height: | Size: 436 B |
Before Width: | Height: | Size: 653 B After Width: | Height: | Size: 338 B |
After Width: | Height: | Size: 452 B |
Before Width: | Height: | Size: 777 B After Width: | Height: | Size: 475 B |
Before Width: | Height: | Size: 792 B After Width: | Height: | Size: 575 B |
Before Width: | Height: | Size: 738 B After Width: | Height: | Size: 591 B |
Before Width: | Height: | Size: 594 B After Width: | Height: | Size: 236 B |
Before Width: | Height: | Size: 337 B After Width: | Height: | Size: 197 B |
Before Width: | Height: | Size: 738 B After Width: | Height: | Size: 591 B |
After Width: | Height: | Size: 239 B |
Before Width: | Height: | Size: 587 B After Width: | Height: | Size: 159 B |
Before Width: | Height: | Size: 337 B After Width: | Height: | Size: 197 B |
After Width: | Height: | Size: 428 B |
After Width: | Height: | Size: 456 B |
BIN
mods/modpacks/technic/technic/textures/technic_stone_dust.png
Normal file
After Width: | Height: | Size: 417 B |
Before Width: | Height: | Size: 738 B |
After Width: | Height: | Size: 656 B |
Before Width: | Height: | Size: 738 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.3 KiB |
@ -71,12 +71,6 @@ local function drill_dig_it1 (player)
|
||||
end
|
||||
|
||||
local function drill_dig_it2 (pos,player)
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.z=pos.z+1
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.z=pos.z-2
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.z=pos.z+1
|
||||
pos.y=pos.y+1
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.z=pos.z+1
|
||||
@ -84,7 +78,14 @@ local function drill_dig_it2 (pos,player)
|
||||
pos.z=pos.z-2
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.z=pos.z+1
|
||||
pos.y=pos.y-2
|
||||
pos.y=pos.y-1
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.z=pos.z+1
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.z=pos.z-2
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.z=pos.z+1
|
||||
pos.y=pos.y-1
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.z=pos.z+1
|
||||
drill_dig_it0 (pos,player)
|
||||
@ -93,12 +94,6 @@ local function drill_dig_it2 (pos,player)
|
||||
end
|
||||
|
||||
local function drill_dig_it3 (pos,player)
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.x=pos.x+1
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.x=pos.x-2
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.x=pos.x+1
|
||||
pos.y=pos.y+1
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.x=pos.x+1
|
||||
@ -106,7 +101,14 @@ local function drill_dig_it3 (pos,player)
|
||||
pos.x=pos.x-2
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.x=pos.x+1
|
||||
pos.y=pos.y-2
|
||||
pos.y=pos.y-1
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.x=pos.x+1
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.x=pos.x-2
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.x=pos.x+1
|
||||
pos.y=pos.y-1
|
||||
drill_dig_it0 (pos,player)
|
||||
pos.x=pos.x+1
|
||||
drill_dig_it0 (pos,player)
|
||||
@ -252,10 +254,9 @@ local function mining_drill_mk2_setmode(user,itemstack)
|
||||
mode=mode+1
|
||||
if mode>=5 then mode=1 end
|
||||
minetest.chat_send_player(player_name, S("Mining Drill Mk%d Mode %d"):format(2, mode)..": "..mining_drill_mode_text[mode][1])
|
||||
item["name"]="technic:mining_drill_mk2_"..mode
|
||||
itemstack:set_name("technic:mining_drill_mk2_"..mode);
|
||||
meta["mode"]=mode
|
||||
item["metadata"]=minetest.serialize(meta)
|
||||
itemstack:replace(item)
|
||||
itemstack:set_metadata(minetest.serialize(meta))
|
||||
return itemstack
|
||||
end
|
||||
|
||||
@ -276,10 +277,9 @@ local function mining_drill_mk3_setmode(user,itemstack)
|
||||
mode=mode+1
|
||||
if mode>=6 then mode=1 end
|
||||
minetest.chat_send_player(player_name, S("Mining Drill Mk%d Mode %d"):format(3, mode)..": "..mining_drill_mode_text[mode][1])
|
||||
item["name"]="technic:mining_drill_mk3_"..mode
|
||||
itemstack:set_name("technic:mining_drill_mk3_"..mode);
|
||||
meta["mode"]=mode
|
||||
item["metadata"]=minetest.serialize(meta)
|
||||
itemstack:replace(item)
|
||||
itemstack:set_metadata(minetest.serialize(meta))
|
||||
return itemstack
|
||||
end
|
||||
|
||||
@ -296,7 +296,7 @@ local function mining_drill_mk2_handler(itemstack, user, pointed_thing)
|
||||
end
|
||||
local charge_to_take = cost_to_use(2, meta.mode)
|
||||
if meta.charge >= charge_to_take then
|
||||
local pos = minetest.get_pointed_thing_position(pointed_thing, above)
|
||||
local pos = minetest.get_pointed_thing_position(pointed_thing, false)
|
||||
drill_dig_it(pos, user, meta.mode)
|
||||
if not technic.creative_mode then
|
||||
meta.charge = meta.charge - charge_to_take
|
||||
@ -319,7 +319,7 @@ local function mining_drill_mk3_handler(itemstack, user, pointed_thing)
|
||||
end
|
||||
local charge_to_take = cost_to_use(3, meta.mode)
|
||||
if meta.charge >= charge_to_take then
|
||||
local pos = minetest.get_pointed_thing_position(pointed_thing, above)
|
||||
local pos = minetest.get_pointed_thing_position(pointed_thing, false)
|
||||
drill_dig_it(pos, user, meta.mode)
|
||||
if not technic.creative_mode then
|
||||
meta.charge = meta.charge - charge_to_take
|
||||
@ -348,7 +348,7 @@ minetest.register_tool("technic:mining_drill", {
|
||||
end
|
||||
local charge_to_take = cost_to_use(1, 1)
|
||||
if meta.charge >= charge_to_take then
|
||||
local pos = minetest.get_pointed_thing_position(pointed_thing, above)
|
||||
local pos = minetest.get_pointed_thing_position(pointed_thing, false)
|
||||
drill_dig_it(pos, user, 1)
|
||||
if not technic.creative_mode then
|
||||
meta.charge = meta.charge - charge_to_take
|
||||
|
@ -62,6 +62,7 @@ minetest.register_craftitem("technic:rubber", {
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
label = "Tools: tree tap",
|
||||
nodenames = {"moretrees:rubber_tree_trunk_empty"},
|
||||
interval = 60,
|
||||
chance = 15,
|
||||
|
@ -26,7 +26,7 @@ minetest.register_tool("technic:vacuum", {
|
||||
end
|
||||
local pos = user:getpos()
|
||||
local inv = user:get_inventory()
|
||||
for _, object in ipairs(minetest.env:get_objects_inside_radius(pos, vacuum_range)) do
|
||||
for _, object in ipairs(minetest.get_objects_inside_radius(pos, vacuum_range)) do
|
||||
local luaentity = object:get_luaentity()
|
||||
if not object:is_player() and luaentity and luaentity.name == "__builtin:item" and luaentity.itemstring ~= "" then
|
||||
if inv and inv:room_for_item("main", ItemStack(luaentity.itemstring)) then
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
technic.chests.groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
|
||||
tubedevice=1, tubedevice_receiver=1}
|
||||
technic.chests.groups_noinv = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
|
||||
@ -13,6 +12,9 @@ technic.chests.tube = {
|
||||
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("main",stack)
|
||||
end,
|
||||
input_inventory = "main",
|
||||
@ -26,12 +28,7 @@ technic.chests.can_dig = function(pos, player)
|
||||
end
|
||||
|
||||
local function inv_change(pos, count, player)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if not has_locked_chest_privilege(meta, player) then
|
||||
minetest.log("action", player:get_player_name()..
|
||||
" tried to access a locked chest belonging to "..
|
||||
meta:get_string("owner").." at "..
|
||||
minetest.pos_to_string(pos))
|
||||
if not default.can_interact_with_node(player, pos) then
|
||||
return 0
|
||||
end
|
||||
return count
|
||||
@ -54,18 +51,14 @@ function technic.chests.on_inv_move(pos, from_list, from_index, to_list, to_inde
|
||||
end
|
||||
|
||||
function technic.chests.on_inv_put(pos, listname, index, stack, player)
|
||||
minetest.log("action", player:get_player_name()..
|
||||
" puts stuff in to chest at "
|
||||
..minetest.pos_to_string(pos))
|
||||
minetest.log("action", player:get_player_name() ..
|
||||
" moves " .. stack:get_name() ..
|
||||
" to chest at " .. minetest.pos_to_string(pos))
|
||||
end
|
||||
|
||||
function technic.chests.on_inv_take(pos, listname, index, stack, player)
|
||||
minetest.log("action", player:get_player_name()..
|
||||
" takes stuff from chest at "
|
||||
..minetest.pos_to_string(pos))
|
||||
end
|
||||
|
||||
function has_locked_chest_privilege(meta, player)
|
||||
return player:get_player_name() == meta:get_string("owner")
|
||||
minetest.log("action", player:get_player_name() ..
|
||||
" takes " .. stack:get_name() ..
|
||||
" from chest at " .. minetest.pos_to_string(pos))
|
||||
end
|
||||
|
||||
|
@ -2,4 +2,3 @@ default
|
||||
moreores?
|
||||
pipeworks?
|
||||
intllib?
|
||||
craft_guide?
|
||||
|
39
mods/modpacks/technic/technic_chests/locale/es.txt
Normal file
@ -0,0 +1,39 @@
|
||||
# technic_chests translation template
|
||||
|
||||
%s Chest = Cofre de %s
|
||||
%s Locked Chest = Cofre de %s Bloqueado
|
||||
%s Locked Chest (owned by %s) = Cofre de %s Bloqueado (propiedad de %s)
|
||||
Color Filter: %s = Filtro por Color: %s
|
||||
Edit chest description: = Editar la descripción del cofre
|
||||
|
||||
# Colors
|
||||
Black = Negro
|
||||
Blue = Azul
|
||||
Brown = Café
|
||||
Cyan = Cian
|
||||
Dark Green = Verde Oscuro
|
||||
Dark Grey = Gris Oscuro
|
||||
Green = Verde
|
||||
Grey = Gris
|
||||
Magenta = Magenta
|
||||
Orange = Naranja
|
||||
Pink = Rosado
|
||||
Red = Rojo
|
||||
Violet = Violeta
|
||||
White = Blanco
|
||||
Yellow = Amarillo
|
||||
None = Ninguno
|
||||
|
||||
# Materials
|
||||
Copper = Cobre
|
||||
Gold = Oro
|
||||
Iron = Hierro
|
||||
Mithril = Mitrilo
|
||||
Silver = Plata
|
||||
Wooden = Madera
|
||||
|
||||
# Sorting
|
||||
Sort = Ordenar
|
||||
Auto-sort is %s = El orden Automático esta %s
|
||||
Off = Apagado
|
||||
On = Encendido
|
@ -1,9 +1,16 @@
|
||||
local S = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end
|
||||
|
||||
local pipeworks = rawget(_G, "pipeworks")
|
||||
local fs_helpers = rawget(_G, "fs_helpers")
|
||||
|
||||
local allow_label = ""
|
||||
local tube_entry = ""
|
||||
local shift_edit_field = 0
|
||||
|
||||
if not minetest.get_modpath("pipeworks") then
|
||||
-- Pipeworks is not installed. Simulate using a dummy table...
|
||||
pipeworks = {}
|
||||
fs_helpers = {}
|
||||
local pipeworks_meta = {}
|
||||
setmetatable(pipeworks, pipeworks_meta)
|
||||
local dummy = function()
|
||||
@ -15,6 +22,12 @@ if not minetest.get_modpath("pipeworks") then
|
||||
end
|
||||
pipeworks.after_place = dummy
|
||||
pipeworks.after_dig = dummy
|
||||
fs_helpers.cycling_button = function() return "" end
|
||||
else
|
||||
fs_helpers = pipeworks.fs_helpers
|
||||
allow_label = "label[0.9,0.36;Allow splitting incoming stacks from tubes]"
|
||||
shift_edit_field = 3
|
||||
tube_entry = "^pipeworks_tube_connection_metallic.png"
|
||||
end
|
||||
|
||||
local chest_mark_colors = {
|
||||
@ -72,6 +85,16 @@ local function set_formspec(pos, data, page)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local node = minetest.get_node(pos)
|
||||
local formspec = data.base_formspec
|
||||
formspec = formspec..fs_helpers.cycling_button(
|
||||
meta,
|
||||
"image_button[0,0.35;1,0.6",
|
||||
"splitstacks",
|
||||
{
|
||||
pipeworks.button_off,
|
||||
pipeworks.button_on
|
||||
}
|
||||
)..allow_label
|
||||
|
||||
if data.autosort then
|
||||
local status = meta:get_int("autosort")
|
||||
formspec = formspec.."button["..(data.hileft+2)..","..(data.height+1.1)..";3,0.8;autosort_to_"..(1-status)..";"..S("Auto-sort is %s"):format(status == 1 and S("On") or S("Off")).."]"
|
||||
@ -79,13 +102,13 @@ local function set_formspec(pos, data, page)
|
||||
if data.infotext then
|
||||
local formspec_infotext = minetest.formspec_escape(meta:get_string("infotext"))
|
||||
if page == "main" then
|
||||
formspec = formspec.."image_button["..(data.hileft+2.1)..",0.1;0.8,0.8;"
|
||||
formspec = formspec.."image_button["..(shift_edit_field+data.hileft+2.1)..",0.1;0.8,0.8;"
|
||||
.."technic_pencil_icon.png;edit_infotext;]"
|
||||
.."label["..(data.hileft+3)..",0;"..formspec_infotext.."]"
|
||||
.."label["..(shift_edit_field+data.hileft+3)..",0;"..formspec_infotext.."]"
|
||||
elseif page == "edit_infotext" then
|
||||
formspec = formspec.."image_button["..(data.hileft+2.1)..",0.1;0.8,0.8;"
|
||||
formspec = formspec.."image_button["..(shift_edit_field+data.hileft+2.1)..",0.1;0.8,0.8;"
|
||||
.."technic_checkmark_icon.png;save_infotext;]"
|
||||
.."field["..(data.hileft+3.3)..",0.2;4.8,1;"
|
||||
.."field["..(shift_edit_field+data.hileft+3.3)..",0.2;4.8,1;"
|
||||
.."infotext_box;"..S("Edit chest description:")..";"
|
||||
..formspec_infotext.."]"
|
||||
end
|
||||
@ -169,12 +192,17 @@ local function get_receive_fields(name, data)
|
||||
local nn = "technic:"..lname..(data.locked and "_locked" or "").."_chest"
|
||||
check_color_buttons(pos, meta, nn, fields)
|
||||
end
|
||||
if fields["fs_helpers_cycling:0:splitstacks"]
|
||||
or fields["fs_helpers_cycling:1:splitstacks"] then
|
||||
if not pipeworks.may_configure(pos, sender) then return end
|
||||
fs_helpers.on_receive_fields(pos, fields)
|
||||
end
|
||||
|
||||
meta:get_inventory():set_size("main", data.width * data.height)
|
||||
set_formspec(pos, data, page)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function technic.chests:definition(name, data)
|
||||
local lname = name:lower()
|
||||
name = S(name)
|
||||
@ -211,6 +239,7 @@ function technic.chests:definition(name, data)
|
||||
"background["..data.hileft..",1;"..data.width..","..data.height..";technic_"..lname.."_chest_inventory.png]"..
|
||||
"background["..data.loleft..","..data.lotop..";8,4;technic_main_inventory.png]"..
|
||||
"listring[]"
|
||||
|
||||
if data.sort then
|
||||
data.base_formspec = data.base_formspec.."button["..data.hileft..","..(data.height+1.1)..";1,0.8;sort;"..S("Sort").."]"
|
||||
end
|
||||
@ -239,11 +268,24 @@ function technic.chests:definition(name, data)
|
||||
desc = S("%s Chest"):format(name)
|
||||
end
|
||||
|
||||
local tentry = tube_entry
|
||||
if tube_entry ~= "" then
|
||||
if lname == "wooden" then
|
||||
tentry = "^pipeworks_tube_connection_wooden.png"
|
||||
elseif lname == "mithril" then
|
||||
tentry = "^pipeworks_tube_connection_stony.png"
|
||||
end
|
||||
end
|
||||
local def = {
|
||||
description = desc,
|
||||
tiles = {"technic_"..lname.."_chest_top.png", "technic_"..lname.."_chest_top.png",
|
||||
"technic_"..lname.."_chest_side.png", "technic_"..lname.."_chest_side.png",
|
||||
"technic_"..lname.."_chest_side.png", table.concat(front, "^")},
|
||||
tiles = {
|
||||
"technic_"..lname.."_chest_top.png"..tentry,
|
||||
"technic_"..lname.."_chest_top.png"..tentry,
|
||||
"technic_"..lname.."_chest_side.png"..tentry,
|
||||
"technic_"..lname.."_chest_side.png"..tentry,
|
||||
"technic_"..lname.."_chest_side.png"..tentry,
|
||||
table.concat(front, "^")
|
||||
},
|
||||
paramtype2 = "facedir",
|
||||
groups = self.groups,
|
||||
tube = self.tube,
|
||||
@ -263,12 +305,45 @@ function technic.chests:definition(name, data)
|
||||
on_receive_fields = get_receive_fields(name, data),
|
||||
on_metadata_inventory_move = self.on_inv_move,
|
||||
on_metadata_inventory_put = self.on_inv_put,
|
||||
on_metadata_inventory_take = self.on_inv_take,
|
||||
on_metadata_inventory_take = self.on_inv_take,
|
||||
on_blast = function(pos)
|
||||
local drops = {}
|
||||
default.get_inventory_drops(pos, "main", drops)
|
||||
drops[#drops+1] = "technic:"..name:lower()..(data.locked and "_locked" or "").."_chest"
|
||||
minetest.remove_node(pos)
|
||||
return drops
|
||||
end,
|
||||
}
|
||||
if data.locked then
|
||||
def.allow_metadata_inventory_move = self.inv_move
|
||||
def.allow_metadata_inventory_put = self.inv_put
|
||||
def.allow_metadata_inventory_take = self.inv_take
|
||||
def.on_blast = function() end
|
||||
def.can_dig = function(pos,player)
|
||||
local meta = minetest.get_meta(pos);
|
||||
local inv = meta:get_inventory()
|
||||
return inv:is_empty("main") and default.can_interact_with_node(player, pos)
|
||||
end
|
||||
def.on_skeleton_key_use = function(pos, player, newsecret)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local owner = meta:get_string("owner")
|
||||
local name = player:get_player_name()
|
||||
|
||||
-- verify placer is owner of lockable chest
|
||||
if owner ~= name then
|
||||
minetest.record_protection_violation(pos, name)
|
||||
minetest.chat_send_player(name, "You do not own this chest.")
|
||||
return nil
|
||||
end
|
||||
|
||||
local secret = meta:get_string("key_lock_secret")
|
||||
if secret == "" then
|
||||
secret = newsecret
|
||||
meta:set_string("key_lock_secret", secret)
|
||||
end
|
||||
|
||||
return secret, "a locked chest", owner
|
||||
end
|
||||
end
|
||||
return def
|
||||
end
|
||||
|
@ -1,4 +1,3 @@
|
||||
default
|
||||
intllib?
|
||||
mg?
|
||||
craft_guide?
|
||||
|
36
mods/modpacks/technic/technic_worldgen/locale/es.txt
Normal file
@ -0,0 +1,36 @@
|
||||
# technic_worldgen traducido por Carlos Barraza
|
||||
|
||||
###crafts.lua
|
||||
Uranium Lump = Pepita de Uranio
|
||||
Uranium Ingot = Lingote de Uranio
|
||||
Chromium Lump = Pepita de Cromo
|
||||
Chromium Ingot = Lingote de Cromo
|
||||
Zinc Lump = Pepita de Zinc
|
||||
Zinc Ingot = Lingote de Zinc
|
||||
Brass Ingot = Lingote de Latón
|
||||
Wrought Iron Ingot = Lingote de Hierro Forjado
|
||||
Cast Iron Ingot = Lingote de Hierro Fundido
|
||||
Carbon Steel Ingot = Lingote de Acero al Carbon
|
||||
Stainless Steel Ingot = Lingote de Acero inoxidable
|
||||
Iron = Lingote
|
||||
|
||||
###nodes.lua
|
||||
Uranium Ore = Mineral de Uranio
|
||||
Chromium Ore = Mineral de Cromo
|
||||
Zinc Ore = Mineral de Zinc
|
||||
Granite = Granito
|
||||
Marble = Mármol
|
||||
Marble Bricks = Ladrillos de Mármol
|
||||
Uranium Block = Bloque de Uranio
|
||||
Chromium Block = Bloque de Cromo
|
||||
Zinc Block = Bloque de Zinc
|
||||
Wrought Iron Block = Bloque de Hierro Forjado
|
||||
Cast Iron Block = Bloque de Hierro Fundido
|
||||
Carbon Steel Block = Bloque de Acero al Carbon
|
||||
Stainless Steel Block = Bloque de Acero Inoxidable
|
||||
Brass Block = Bloque de Latón
|
||||
Wrought Iron = Hierro Forjado
|
||||
|
||||
###rubber.lua
|
||||
Rubber Tree Sapling = Retoño de Árbol de Goma
|
||||
Rubber Tree = Árbol de Goma
|
@ -51,7 +51,7 @@ mg.register_ore({
|
||||
mg.register_ore({
|
||||
name = "technic:mineral_lead",
|
||||
wherein = "default:stone",
|
||||
seeddiff = 13,
|
||||
seeddiff = 14,
|
||||
maxvdistance = 10.5,
|
||||
maxheight = 16,
|
||||
seglenghtn = 15,
|
||||
|
@ -1,14 +1,14 @@
|
||||
local uranium_params = {offset = 0, scale = 1, spread = {x = 100, y = 100, z = 100}, seed = 420, octaves = 3, persist = 0.7}
|
||||
local uranium_threshhold = 0.55
|
||||
local uranium_threshold = 0.55
|
||||
|
||||
local chromium_params = {offset = 0, scale = 1, spread = {x = 100, y = 100, z = 100}, seed = 421, octaves = 3, persist = 0.7}
|
||||
local chromium_threshhold = 0.55
|
||||
local chromium_threshold = 0.55
|
||||
|
||||
local zinc_params = {offset = 0, scale = 1, spread = {x = 100, y = 100, z = 100}, seed = 422, octaves = 3, persist = 0.7}
|
||||
local zinc_threshhold = 0.5
|
||||
local zinc_threshold = 0.5
|
||||
|
||||
local lead_params = {offset = 0, scale = 1, spread = {x = 100, y = 100, z = 100}, seed = 423, octaves = 3, persist = 0.7}
|
||||
local lead_threshhold = 0.3
|
||||
local lead_threshold = 0.3
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
@ -20,7 +20,7 @@ minetest.register_ore({
|
||||
y_min = -300,
|
||||
y_max = -80,
|
||||
noise_params = uranium_params,
|
||||
noise_threshold = uranium_threshhold,
|
||||
noise_threshold = uranium_threshold,
|
||||
})
|
||||
|
||||
minetest.register_ore({
|
||||
@ -33,7 +33,7 @@ minetest.register_ore({
|
||||
y_min = -200,
|
||||
y_max = -100,
|
||||
noise_params = chromium_params,
|
||||
noise_threshold = chromium_threshhold,
|
||||
noise_threshold = chromium_threshold,
|
||||
})
|
||||
|
||||
minetest.register_ore({
|
||||
@ -47,7 +47,7 @@ minetest.register_ore({
|
||||
y_max = -200,
|
||||
flags = "absheight",
|
||||
noise_params = chromium_params,
|
||||
noise_threshold = chromium_threshhold,
|
||||
noise_threshold = chromium_threshold,
|
||||
})
|
||||
|
||||
minetest.register_ore({
|
||||
@ -55,12 +55,12 @@ minetest.register_ore({
|
||||
ore = "technic:mineral_zinc",
|
||||
wherein = "default:stone",
|
||||
clust_scarcity = 8*8*8,
|
||||
clust_num_ores = 4,
|
||||
clust_size = 3,
|
||||
clust_num_ores = 5,
|
||||
clust_size = 7,
|
||||
y_min = -32,
|
||||
y_max = 2,
|
||||
noise_params = zinc_params,
|
||||
noise_threshold = zinc_threshhold,
|
||||
noise_threshold = zinc_threshold,
|
||||
})
|
||||
|
||||
minetest.register_ore({
|
||||
@ -74,7 +74,7 @@ minetest.register_ore({
|
||||
y_max = -32,
|
||||
flags = "absheight",
|
||||
noise_params = zinc_params,
|
||||
noise_threshold = zinc_threshhold,
|
||||
noise_threshold = zinc_threshold,
|
||||
})
|
||||
|
||||
minetest.register_ore({
|
||||
@ -87,7 +87,7 @@ minetest.register_ore({
|
||||
y_min = -16,
|
||||
y_max = 16,
|
||||
noise_params = lead_params,
|
||||
noise_threshold = lead_threshhold,
|
||||
noise_threshold = lead_threshold,
|
||||
})
|
||||
|
||||
minetest.register_ore({
|
||||
@ -100,7 +100,7 @@ minetest.register_ore({
|
||||
y_min = -128,
|
||||
y_max = -16,
|
||||
noise_params = lead_params,
|
||||
noise_threshold = lead_threshhold,
|
||||
noise_threshold = lead_threshold,
|
||||
})
|
||||
|
||||
minetest.register_ore({
|
||||
@ -114,31 +114,34 @@ minetest.register_ore({
|
||||
y_max = -128,
|
||||
flags = "absheight",
|
||||
noise_params = lead_params,
|
||||
noise_threshold = lead_threshhold,
|
||||
noise_threshold = lead_threshold,
|
||||
})
|
||||
|
||||
-- Sulfur
|
||||
local sulfur_buf = {}
|
||||
local sulfur_noise= nil
|
||||
|
||||
minetest.register_on_generated(function(minp, maxp, seed)
|
||||
local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
|
||||
local a = VoxelArea:new{
|
||||
MinEdge = {x = emin.x, y = emin.y, z = emin.z},
|
||||
MaxEdge = {x = emax.x, y = emax.y, z = emax.z},
|
||||
}
|
||||
local data = vm:get_data()
|
||||
local data = vm:get_data(sulfur_buf)
|
||||
local pr = PseudoRandom(17 * minp.x + 42 * minp.y + 101 * minp.z)
|
||||
local noise = minetest.get_perlin(9876, 3, 0.5, 100)
|
||||
|
||||
sulfur_noise = sulfur_noise or minetest.get_perlin(9876, 3, 0.5, 100)
|
||||
|
||||
local c_lava = minetest.get_content_id("default:lava_source")
|
||||
local c_lava_flowing = minetest.get_content_id("default:lava_flowing")
|
||||
local c_stone = minetest.get_content_id("default:stone")
|
||||
local c_sulfur = minetest.get_content_id("technic:mineral_sulfur")
|
||||
|
||||
|
||||
local grid_size = 5
|
||||
for x = minp.x + math.floor(grid_size / 2), maxp.x, grid_size do
|
||||
for y = minp.y + math.floor(grid_size / 2), maxp.y, grid_size do
|
||||
for z = minp.z + math.floor(grid_size / 2), maxp.z, grid_size do
|
||||
local c = data[a:index(x, y, z)]
|
||||
if (c == c_lava or c == c_lava_flowing) and noise:get3d({x = x, y = z, z = z}) >= 0.4 then
|
||||
if (c == c_lava or c == c_lava_flowing) and sulfur_noise:get3d({x = x, y = z, z = z}) >= 0.4 then
|
||||
for xx = math.max(minp.x, x - grid_size), math.min(maxp.x, x + grid_size) do
|
||||
for yy = math.max(minp.y, y - grid_size), math.min(maxp.y, y + grid_size) do
|
||||
for zz = math.max(minp.z, z - grid_size), math.min(maxp.z, z + grid_size) do
|
||||
@ -153,7 +156,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
vm:set_data(data)
|
||||
vm:write_to_map(data)
|
||||
end)
|
||||
|
@ -10,7 +10,7 @@ minetest.register_node(":moretrees:rubber_tree_sapling", {
|
||||
wield_image = "technic_rubber_sapling.png",
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
groups = {dig_immediate=3, flammable=2},
|
||||
groups = {dig_immediate=3, flammable=2, sapling=1},
|
||||
sounds = default.node_sound_defaults(),
|
||||
})
|
||||
|
||||
@ -73,6 +73,7 @@ technic.rubber_tree_model={
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"moretrees:rubber_tree_sapling"},
|
||||
label = "Worldgen: grow rubber tree sapling",
|
||||
interval = 60,
|
||||
chance = 20,
|
||||
action = function(pos, node)
|
||||
@ -97,4 +98,3 @@ if technic.config:get_bool("enable_rubber_tree_generation") then
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
|
@ -39,9 +39,10 @@ local function restore(pos, placer, itemstack)
|
||||
local node = minetest.get_node(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local inv = meta:get_inventory()
|
||||
local data = minetest.deserialize(itemstack:get_metadata())
|
||||
local data = itemstack:get_meta():get_string("data")
|
||||
data = (data ~= "" and data) or itemstack:get_metadata()
|
||||
data = minetest.deserialize(data)
|
||||
minetest.set_node(pos, {name = data.name, param2 = node.param2})
|
||||
local lists = data.lists
|
||||
for name, value in pairs(data.metas) do
|
||||
local meta_type = get_meta_type(data.name, name)
|
||||
if meta_type == wrench.META_TYPE_INT then
|
||||
@ -52,6 +53,7 @@ local function restore(pos, placer, itemstack)
|
||||
meta:set_string(name, value)
|
||||
end
|
||||
end
|
||||
local lists = data.lists
|
||||
for listname, list in pairs(lists) do
|
||||
inv:set_list(listname, list)
|
||||
end
|
||||
@ -96,8 +98,9 @@ minetest.register_tool("wrench:wrench", {
|
||||
if not placer or not pos then
|
||||
return
|
||||
end
|
||||
if minetest.is_protected(pos, placer:get_player_name()) then
|
||||
minetest.record_protection_violation(pos, placer:get_player_name())
|
||||
local player_name = placer:get_player_name()
|
||||
if minetest.is_protected(pos, player_name) then
|
||||
minetest.record_protection_violation(pos, player_name)
|
||||
return
|
||||
end
|
||||
local name = minetest.get_node(pos).name
|
||||
@ -114,9 +117,9 @@ minetest.register_tool("wrench:wrench", {
|
||||
local meta = minetest.get_meta(pos)
|
||||
if def.owned then
|
||||
local owner = meta:get_string("owner")
|
||||
if owner and owner ~= placer:get_player_name() then
|
||||
minetest.log("action", placer:get_player_name()..
|
||||
" tried to pick up a owned node belonging to "..
|
||||
if owner and owner ~= player_name then
|
||||
minetest.log("action", player_name..
|
||||
" tried to pick up an owned node belonging to "..
|
||||
owner.." at "..
|
||||
minetest.pos_to_string(pos))
|
||||
return
|
||||
@ -130,9 +133,6 @@ minetest.register_tool("wrench:wrench", {
|
||||
local inv = meta:get_inventory()
|
||||
local lists = {}
|
||||
for _, listname in pairs(def.lists or {}) do
|
||||
if not inv:is_empty(listname) then
|
||||
empty = false
|
||||
end
|
||||
local list = inv:get_list(listname)
|
||||
for i, stack in pairs(list) do
|
||||
list[i] = stack:to_string()
|
||||
@ -140,20 +140,20 @@ minetest.register_tool("wrench:wrench", {
|
||||
lists[listname] = list
|
||||
end
|
||||
metadata.lists = lists
|
||||
|
||||
local metas = {}
|
||||
|
||||
local item_meta = stack:get_meta()
|
||||
metadata.metas = {}
|
||||
for name, meta_type in pairs(def.metas or {}) do
|
||||
if meta_type == wrench.META_TYPE_INT then
|
||||
metas[name] = meta:get_int(name)
|
||||
metadata.metas[name] = meta:get_int(name)
|
||||
elseif meta_type == wrench.META_TYPE_FLOAT then
|
||||
metas[name] = meta:get_float(name)
|
||||
metadata.metas[name] = meta:get_float(name)
|
||||
elseif meta_type == wrench.META_TYPE_STRING then
|
||||
metas[name] = meta:get_string(name)
|
||||
metadata.metas[name] = meta:get_string(name)
|
||||
end
|
||||
end
|
||||
metadata.metas = metas
|
||||
|
||||
stack:set_metadata(minetest.serialize(metadata))
|
||||
|
||||
item_meta:set_string("data", minetest.serialize(metadata))
|
||||
minetest.remove_node(pos)
|
||||
itemstack:add_wear(65535 / 20)
|
||||
player_inv:add_item("main", stack)
|
||||
|
5
mods/modpacks/technic/wrench/locale/es.txt
Normal file
@ -0,0 +1,5 @@
|
||||
# technic_wrench traducido por Carlos Barraza
|
||||
|
||||
Wrench = Llave Inglesa
|
||||
%s with items = %s con elementos
|
||||
|