[technic] Downgrad to Git commit cbe9743 & patch d3a58d8:

Fixes compatibility with 'pipeworks' downgrade.

Commit: https://github.com/minetest-mods/technic/tree/cbe9743
Patch: https://github.com/AntumDeluge/mtmod-technic/tree/d3a58d8
master
AntumDeluge 2017-05-15 17:34:53 -07:00
parent 8a59c05040
commit 564f2b2b44
70 changed files with 368 additions and 2036 deletions

View File

@ -202,7 +202,7 @@ The game includes the mods from the default [minetest_game](https://github.com/m
* mp_mydoors/ * mp_mydoors/
* my_*_doors * my_*_doors
* my_garage_door * my_garage_door
* [technic][] ([LGPL][lic.lgpl2.0]) -- version: [42efc7e Git][ver.technic] *2017-04-17* ([patched][patch.technic]) * [technic][] ([LGPL][lic.lgpl2.0]) -- version: [cbe9743 Git][ver.technic] *2017-02-25* ([patched][patch.technic])
* mp_technic/ * mp_technic/
@ -467,7 +467,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.spectator_mode]: https://github.com/minetest-mods/spectator_mode/tree/7d68bec
[ver.spidermob]: https://github.com/Darcidride/minetest-spidermob-v1/tree/c72d2ff [ver.spidermob]: https://github.com/Darcidride/minetest-spidermob-v1/tree/c72d2ff
[ver.stairsplus]: https://github.com/CasimirKaPazi/stairsplus/tree/311e1f0 [ver.stairsplus]: https://github.com/CasimirKaPazi/stairsplus/tree/311e1f0
[ver.technic]: https://github.com/minetest-mods/technic/tree/42efc7e [ver.technic]: https://github.com/minetest-mods/technic/tree/cbe9743
[ver.throwing]: https://github.com/Jeija/minetest-mod-throwing/tree/79ad788 [ver.throwing]: https://github.com/Jeija/minetest-mod-throwing/tree/79ad788
[ver.tnt]: https://github.com/PilzAdam/TNT/tree/d6a0b7d [ver.tnt]: https://github.com/PilzAdam/TNT/tree/d6a0b7d
[ver.tools_obsidian]: https://github.com/Dragonop/tools_obsidian/tree/f77fd79 [ver.tools_obsidian]: https://github.com/Dragonop/tools_obsidian/tree/f77fd79
@ -531,7 +531,7 @@ The game includes the mods from the default [minetest_game](https://github.com/m
[patch.signs_lib]: https://github.com/AntumDeluge/mtmod-signs_lib/tree/fe46611 [patch.signs_lib]: https://github.com/AntumDeluge/mtmod-signs_lib/tree/fe46611
[patch.spawneggs]: https://github.com/AntumDeluge/mtmod-spawneggs/tree/b47f49f [patch.spawneggs]: https://github.com/AntumDeluge/mtmod-spawneggs/tree/b47f49f
[patch.spidermob]: https://github.com/AntumDeluge/mtmod-spidermob/tree/00b6107 [patch.spidermob]: https://github.com/AntumDeluge/mtmod-spidermob/tree/00b6107
[patch.technic]: https://github.com/AntumDeluge/mtmod-technic/tree/0ddc6e6 [patch.technic]: https://github.com/AntumDeluge/mtmod-technic/tree/d3a58d8
[patch.torches]: https://github.com/AntumDeluge/mtmod-torches/tree/fb2b692 [patch.torches]: https://github.com/AntumDeluge/mtmod-torches/tree/fb2b692
[patch.trash_can]: https://github.com/AntumDeluge/mtmod-trash_can/tree/5a92bf4 [patch.trash_can]: https://github.com/AntumDeluge/mtmod-trash_can/tree/5a92bf4
[patch.unifieddyes]: https://github.com/AntumDeluge/mtmod-unifieddyes/tree/20947c3 [patch.unifieddyes]: https://github.com/AntumDeluge/mtmod-unifieddyes/tree/20947c3

View File

@ -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_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_post = {-0.15, -0.5, -0.15, 0.15, 0.5, 0.15}
local box_front = {-0.1, -0.3, -0.5, 0.1, 0.3, 0} local box_front = {-0.1, -0.3, 0, 0.1, 0.3, -0.5}
local box_back = {-0.1, -0.3, 0, 0.1, 0.3, 0.5} local box_back = {-0.1, -0.3, 0, 0.1, 0.3, 0.5}
local box_left = {-0.5, -0.3, -0.1, 0, 0.3, 0.1} local box_left = {0, -0.3, -0.1, -0.5, 0.3, 0.1}
local box_right = {0, -0.3, -0.1, 0.5, 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", { minetest.register_node(":technic:concrete_post_platform", {

View File

@ -1,7 +1,5 @@
default default
technic_worldgen technic_worldgen
concrete concrete
unifieddyes?
intllib? intllib?
moreblocks? moreblocks?
craft_guide?

View File

@ -101,87 +101,3 @@ if minetest.get_modpath("moreblocks") then
register_technic_stairs_alias("stairsplus", "marble_bricks", "technic", "marble_bricks") register_technic_stairs_alias("stairsplus", "marble_bricks", "technic", "marble_bricks")
end 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"},
}
})

View File

@ -1,173 +0,0 @@
# 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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 226 B

View File

@ -766,12 +766,14 @@ 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, and stone in 1.7 m. When a shield must be deliberately constructed,
the preferred materials are metals, the denser the better. Iron and 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. 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 (its in-game shielding value is 80). Gold halves radiation 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
in 0.53 m (factor of 3.7 per meter), but is a bit scarce to use for 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 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 meter), but is itself radioactive. The very best shielding in the game
is nyancat material (nyancats and their rainbow blocks), which halves is nyancat material (nyancats and their rainbow blocks), which halves
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. radiation in 0.22 m (factor of 24 per meter), but is extremely scarce.
If the theoretical radiation damage from a particular source is If the theoretical radiation damage from a particular source is
sufficiently small, due to distance and shielding, then no damage at all sufficiently small, due to distance and shielding, then no damage at all
@ -961,8 +963,7 @@ The primary purpose of battery boxes is to temporarily store electrical
energy to let an electrical network cope with mismatched supply and energy to let an electrical network cope with mismatched supply and
demand. They have a secondary purpose of charging and discharging demand. They have a secondary purpose of charging and discharging
powered tools. They are thus a mixture of electrical infrastructure, powered tools. They are thus a mixture of electrical infrastructure,
powered machine, and generator. Battery boxes connect to cables only powered machine, and generator.
from the bottom.
MV and HV battery boxes have upgrade slots. Energy upgrades increase 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. the capacity of a battery box, each by 10% of the un-upgraded capacity.
@ -977,10 +978,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. 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 MV and HV battery boxes work with pneumatic tubes. An item can be input
to the charging slot through the sides or back of the battery box, or to the charging slot through the bottom of the battery box, or to the
to the discharging slot through the top. With a tube upgrade, fully discharging slot through the top. Items are not accepted through the
charged/discharged tools (as appropriate for their slot) will be ejected front, back, or sides. With a tube upgrade, fully charged/discharged
through a side. tools (as appropriate for their slot) will be ejected through a side.
### processing machines ### ### processing machines ###
@ -1244,12 +1245,12 @@ with light sources such as meselamps.
### hydro generator ### ### hydro generator ###
The hydro generator is an LV power generator that generates a respectable The hydro generator is an LV power generator that generates a small amount
amount of power from the natural motion of water. To operate, the of power from the natural motion of water. To operate, the generator must
generator must be horizontally adjacent to flowing water. The power be horizontally adjacent to water. It doesn't matter whether the water
produced is dependent on how much flow there is across any or all four consists of source blocks or flowing blocks. Having water adjacent on
sides, the most flow of course coming from water that's flowing straight more than one side, up to the full four, increases the generator's output.
down. The water itself is unaffected by the generator.
### geothermal generator ### ### geothermal generator ###

View File

@ -25,11 +25,3 @@ RealBadAngel: (WTFPL)
* Everything else. * Everything else.
CC BY-SA 3.0: <http://creativecommons.org/licenses/by-sa/3.0/> 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/>

View File

@ -1,23 +1,6 @@
-- check if we have the necessary dependencies to allow actually using these materials in the crafts -- check if we have the necessary dependencies to allow actually using these materials in the crafts
local mesecons_materials = minetest.get_modpath("mesecons_materials") 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 -- tubes crafting recipes
minetest.register_craft({ minetest.register_craft({
@ -180,15 +163,31 @@ minetest.register_craft({
}, },
}) })
-- Remove some recipes
-- Bronze
minetest.register_craft({ minetest.register_craft({
output = "default:dirt 2",
type = "shapeless", type = "shapeless",
replacements = {{"bucket:bucket_water","bucket:bucket_empty"}}, output = "default:bronze_ingot 0",
recipe = {"default:copper_ingot", "default:steel_ingot"}
})
-- Accelerator tube
minetest.register_craft({
output = "pipeworks:accelerator_tube_1 0",
recipe = { recipe = {
"technic:stone_dust", { "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" },
"group:leaves", { "default:mese_crystal_fragment", "default:steel_ingot", "default:mese_crystal_fragment" },
"bucket:bucket_water", { "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" }
"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" }
},
})

View File

@ -2,9 +2,7 @@ default
pipeworks pipeworks
technic_worldgen technic_worldgen
bucket? bucket?
mesecons?
mesecons_mvps? mesecons_mvps?
digilines?
intllib? intllib?
unified_inventory? unified_inventory?
vector_extras? vector_extras?

View File

@ -5,7 +5,7 @@
local load_start = os.clock() local load_start = os.clock()
technic = rawget(_G, "technic") or {} technic = rawget(_G, "technic") or {}
technic.creative_mode = minetest.settings:get_bool("creative_mode") technic.creative_mode = minetest.setting_getbool("creative_mode")
local modpath = minetest.get_modpath("technic") local modpath = minetest.get_modpath("technic")
@ -47,7 +47,7 @@ dofile(modpath.."/tools/init.lua")
-- Aliases for legacy node/item names -- Aliases for legacy node/item names
dofile(modpath.."/legacy.lua") dofile(modpath.."/legacy.lua")
if minetest.settings:get_bool("log_mods") then if minetest.setting_getbool("log_mods") then
print(S("[Technic] Loaded in %f seconds"):format(os.clock() - load_start)) print(S("[Technic] Loaded in %f seconds"):format(os.clock() - load_start))
end end

View File

@ -26,8 +26,8 @@ Graphite = Lastra in graffite
Carbon Cloth = Fibra di carbonio Carbon Cloth = Fibra di carbonio
Raw Latex = Latex grezzo Raw Latex = Latex grezzo
Rubber Fiber = Fibra di gomma Rubber Fiber = Fibra di gomma
%.1f%%-Fissile Uranium Ingot = %.1f%%-Lingotto di uranio fissile %.1f%%-Fissile Uranium Ingot =
%.1f%%-Fissile Uranium Block = %.1f%%-Blocco di uranio fissile %.1f%%-Fissile Uranium Block =
## Machine misc ## Machine misc
Machine cannot be removed because it is not empty = La macchina non può essere rimossa perchè non è vuota 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) @1 Active (@2 EU) = @1 Attivo (@2 EU)
%s Active = %s Attivo %s Active = %s Attivo
%s Disabled = %s Disabilitato %s Disabled = %s Disabilitato
%s Enabled = %s Abilitato %s Enabled =
%s Idle = %s Inattivo %s Idle = %s Inattivo
%s Improperly Placed = %s Piazzato impropiamente %s Improperly Placed = %s Piazzato impropiamente
%s Unpowered = %s Non alimentato %s Unpowered = %s Non alimentato
@ -46,18 +46,18 @@ Inventory move disallowed due to protection = Impossibile muovere l'inventario a
%s Finished = %s Finito %s Finished = %s Finito
Enable/Disable = Abilita/Disabilita Enable/Disable = Abilita/Disabilita
Range = Raggio Range = Raggio
Upgrade Slots = Alloggi di aggiornamento Upgrade Slots =
In: = Ingresso: In: = Ingresso:
Out: = Uscita: Out: = Uscita:
Slot %d = Alloggio %d Slot %d =
Itemwise = Singolo elemento Itemwise = Singolo elemento
Stackwise = pila completa Stackwise = pila completa
Owner: = Proprietario: Owner: =
Unlocked = Non chiuso a chiave Unlocked =
Locked = Chiuso a chiave Locked =
Radius: = Raggio: Radius: =
Enabled = Abilitato Enabled =
Disabled = Disabilitato Disabled =
## Machine names ## Machine names
# $1: Tier # $1: Tier
@ -84,10 +84,10 @@ Self-Contained Injector = Ignettore
Constructor Mk%d = Costruttore Mk%d Constructor Mk%d = Costruttore Mk%d
Frame = Cornice Frame = Cornice
Frame Motor = Cornice del motore Frame Motor = Cornice del motore
Template = Sagoma Template =
Template (replacing) = Sagoma (di rimpiazzo) Template (replacing) = Template (rimpiazzato)
Template Motor = Motore per sagome Template Motor =
Template Tool = Strumento per sagome Template Tool =
Battery Box = Box batterie Battery Box = Box batterie
Supply Converter = Trasformatore Supply Converter = Trasformatore
Switching Station = Stazione di controllo Switching Station = Stazione di controllo
@ -96,7 +96,7 @@ Fuel-Fired Furnace = Fornace a carbone
Wind Mill Frame = Pala eolica Wind Mill Frame = Pala eolica
Forcefield = Campo di forza Forcefield = Campo di forza
Nuclear Reactor Rod Compartment = Compartimento combustibile nucleare Nuclear Reactor Rod Compartment = Compartimento combustibile nucleare
Administrative World Anchor = Ancora-mondo amministrativa Administrative World Anchor =
## Machine-specific ## Machine-specific
# $1: Pruduced EU # $1: Pruduced EU
@ -111,12 +111,12 @@ Production at %d%% = Produzione a %d%%
Choose Milling Program: = Scegliere un programma di Fresatura Choose Milling Program: = Scegliere un programma di Fresatura
Slim Elements half / normal height: = Metà elementi sottili / altezza normale: Slim Elements half / normal height: = Metà elementi sottili / altezza normale:
Current track %s = Traccia corrente %s Current track %s = Traccia corrente %s
Stopped = Fermato Stopped =
Keeping %d/%d map blocks loaded = Mantenimento di %d/%d blocchi mappa caricati Keeping %d/%d map blocks loaded =
Digging not started = Scavo non iniziato Digging not started =
Digging finished = Scavo finito Digging finished =
Digging %d m above machine = Scavo di %d m sopra la macchina Digging %d m above machine =
Digging %d m below machine = Scavo di %d m sotto la macchina Digging %d m below machine =
## CNC ## CNC
Cylinder = Cilindro Cylinder = Cilindro
@ -174,10 +174,10 @@ Talinite = Talinite
Tin = Stagno Tin = Stagno
Wrought Iron = Ferro Battuto Wrought Iron = Ferro Battuto
Zinc = Zinco Zinc = Zinco
%.1f%%-Fissile Uranium = %.1f%%-Uranio fissile %.1f%%-Fissile Uranium =
## Tools ## Tools
RE Battery = Batteria RE RE Battery =
Water Can = Serbatoio d'acqua Water Can = Serbatoio d'acqua
Lava Can = Serbatoio di lava Lava Can = Serbatoio di lava
Chainsaw = Motosega Chainsaw = Motosega

View File

@ -1,5 +1,4 @@
-- HV battery box -- HV battery box
minetest.register_craft({ minetest.register_craft({
output = 'technic:hv_battery_box0', output = 'technic:hv_battery_box0',
recipe = { recipe = {

View File

@ -6,14 +6,10 @@
-- How expensive is the generator? -- How expensive is the generator?
-- Leaves room for upgrades lowering the power drain? -- Leaves room for upgrades lowering the power drain?
local digilines_path = minetest.get_modpath("digilines")
local forcefield_power_drain = 10 local forcefield_power_drain = 10
local S = technic.getter local S = technic.getter
local cable_entry = "^technic_cable_connection_overlay.png"
minetest.register_craft({ minetest.register_craft({
output = "technic:forcefield_emitter_off", output = "technic:forcefield_emitter_off",
recipe = { recipe = {
@ -94,14 +90,7 @@ local function update_forcefield(pos, meta, active, first)
end end
local function set_forcefield_formspec(meta) local function set_forcefield_formspec(meta)
local formspec local formspec = "size[5,2.25]"..
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").."]" "field[0.3,0.5;2,1;range;"..S("Range")..";"..meta:get_int("range").."]"
-- The names for these toggle buttons are explicit about which -- The names for these toggle buttons are explicit about which
-- state they'll switch to, so that multiple presses (arising -- state they'll switch to, so that multiple presses (arising
@ -141,7 +130,6 @@ local forcefield_receive_fields = function(pos, formname, fields, sender)
update_forcefield(pos, meta, false) update_forcefield(pos, meta, false)
end end
if range then meta:set_int("range", range) end if range then meta:set_int("range", range) end
if fields.channel then meta:set_string("channel", fields.channel) end
if fields.shape0 then meta:set_int("shape", 0) end if fields.shape0 then meta:set_int("shape", 0) end
if fields.shape1 then meta:set_int("shape", 1) end if fields.shape1 then meta:set_int("shape", 1) end
if fields.enable then meta:set_int("enabled", 1) end if fields.enable then meta:set_int("enabled", 1) end
@ -162,60 +150,6 @@ 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
msg = msg:lower()
if msg == "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 == "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 = 1-onn -- Mirror onn with pivot 0.5, so switch between 1 and 0.
meta:set_int("enabled", onn)
elseif msg:sub(1, 5) == "range" then
local range = tonumber(msg:sub(7))
if not range then
return
end
range = math.max(range, 5)
range = math.min(range, 20)
update_forcefield(pos, meta, false)
meta:set_int("range", range)
elseif msg:sub(1, 5) == "shape" then
local shape = msg:sub(7):lower()
if shape == "sphere" then
shape = 0
elseif shape == "cube" then
shape = 1
end
shape = tonumber(shape)
if not shape then
return
end
update_forcefield(pos, meta, false)
meta:set_int("shape", shape)
else
return
end
set_forcefield_formspec(meta)
end
},
}
local function run(pos, node) local function run(pos, node)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local eu_input = meta:get_int("HV_EU_input") local eu_input = meta:get_int("HV_EU_input")
@ -260,14 +194,7 @@ end
minetest.register_node("technic:forcefield_emitter_off", { minetest.register_node("technic:forcefield_emitter_off", {
description = S("%s Forcefield Emitter"):format("HV"), description = S("%s Forcefield Emitter"):format("HV"),
tiles = { tiles = {"technic_forcefield_emitter_off.png"},
"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}, groups = {cracky = 1, technic_machine = 1, technic_hv = 1},
on_receive_fields = forcefield_receive_fields, on_receive_fields = forcefield_receive_fields,
on_construct = function(pos) on_construct = function(pos)
@ -278,27 +205,16 @@ minetest.register_node("technic:forcefield_emitter_off", {
meta:set_int("enabled", 0) meta:set_int("enabled", 0)
meta:set_int("mesecon_mode", 0) meta:set_int("mesecon_mode", 0)
meta:set_int("mesecon_effect", 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")) meta:set_string("infotext", S("%s Forcefield Emitter"):format("HV"))
set_forcefield_formspec(meta) set_forcefield_formspec(meta)
end, end,
mesecons = mesecons, mesecons = mesecons,
digiline = digiline_def,
technic_run = run, technic_run = run,
}) })
minetest.register_node("technic:forcefield_emitter_on", { minetest.register_node("technic:forcefield_emitter_on", {
description = S("%s Forcefield Emitter"):format("HV"), description = S("%s Forcefield Emitter"):format("HV"),
tiles = { tiles = {"technic_forcefield_emitter_on.png"},
"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, groups = {cracky = 1, technic_machine = 1, technic_hv = 1,
not_in_creative_inventory=1}, not_in_creative_inventory=1},
drop = "technic:forcefield_emitter_off", drop = "technic:forcefield_emitter_off",
@ -308,7 +224,6 @@ minetest.register_node("technic:forcefield_emitter_on", {
update_forcefield(pos, meta, false) update_forcefield(pos, meta, false)
end, end,
mesecons = mesecons, mesecons = mesecons,
digiline = digiline_def,
technic_run = run, technic_run = run,
technic_on_disable = function (pos, node) technic_on_disable = function (pos, node)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)

View File

@ -15,8 +15,8 @@ local fuel_type = "technic:uranium_fuel" -- The reactor burns this
local S = technic.getter 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? -- FIXME: Recipe should make more sense like a rod recepticle, steam chamber, HV generator?
minetest.register_craft({ minetest.register_craft({
@ -35,6 +35,26 @@ local reactor_formspec =
"list[current_player;main;0,5;8,4;]".. "list[current_player;main;0,5;8,4;]"..
"listring[]" "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},
}
local SS_OFF = 0 local SS_OFF = 0
local SS_DANGER = 1 local SS_DANGER = 1
local SS_CLEAR = 2 local SS_CLEAR = 2
@ -201,7 +221,6 @@ end
minetest.register_abm({ minetest.register_abm({
label = "Machines: reactor melt-down check",
nodenames = {"technic:hv_nuclear_reactor_core_active"}, nodenames = {"technic:hv_nuclear_reactor_core_active"},
interval = 4, interval = 4,
chance = 1, chance = 1,
@ -270,18 +289,17 @@ end
minetest.register_node("technic:hv_nuclear_reactor_core", { minetest.register_node("technic:hv_nuclear_reactor_core", {
description = reactor_desc, description = reactor_desc,
tiles = { tiles = {"technic_hv_nuclear_reactor_core.png"},
"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}, groups = {cracky=1, technic_machine=1, technic_hv=1},
legacy_facedir_simple = true, legacy_facedir_simple = true,
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
drawtype = "nodebox",
paramtype = "light", paramtype = "light",
paramtype2 = "facedir",
stack_max = 1, stack_max = 1,
node_box = {
type = "fixed",
fixed = node_box
},
on_construct = function(pos) on_construct = function(pos)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
meta:set_string("infotext", reactor_desc) meta:set_string("infotext", reactor_desc)
@ -298,20 +316,19 @@ minetest.register_node("technic:hv_nuclear_reactor_core", {
}) })
minetest.register_node("technic:hv_nuclear_reactor_core_active", { minetest.register_node("technic:hv_nuclear_reactor_core_active", {
tiles = { tiles = {"technic_hv_nuclear_reactor_core.png"},
"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, groups = {cracky=1, technic_machine=1, technic_hv=1,
radioactive=4, not_in_creative_inventory=1}, radioactive=4, not_in_creative_inventory=1},
legacy_facedir_simple = true, legacy_facedir_simple = true,
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
drop = "technic:hv_nuclear_reactor_core", drop = "technic:hv_nuclear_reactor_core",
drawtype = "nodebox",
light_source = 14, light_source = 14,
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", node_box = {
type = "fixed",
fixed = node_box
},
can_dig = technic.machine_can_dig, can_dig = technic.machine_can_dig,
after_dig_node = melt_down_reactor, after_dig_node = melt_down_reactor,
on_destruct = function(pos) siren_set_state(pos, SS_OFF) end, on_destruct = function(pos) siren_set_state(pos, SS_OFF) end,

View File

@ -1,9 +1,6 @@
local S = technic.getter local S = technic.getter
local tube_entry = "^pipeworks_tube_connection_metallic.png"
local cable_entry = "^technic_cable_connection_overlay.png"
minetest.register_craft({ minetest.register_craft({
recipe = { recipe = {
{"technic:carbon_plate", "pipeworks:filter", "technic:composite_plate"}, {"technic:carbon_plate", "pipeworks:filter", "technic:composite_plate"},
@ -15,7 +12,6 @@ minetest.register_craft({
local quarry_dig_above_nodes = 3 -- How far above the quarry we will dig nodes local quarry_dig_above_nodes = 3 -- How far above the quarry we will dig nodes
local quarry_max_depth = 100 local quarry_max_depth = 100
local quarry_demand = 10000 local quarry_demand = 10000
local quarry_eject_dir = vector.new(0, 1, 0)
local function set_quarry_formspec(meta) local function set_quarry_formspec(meta)
local radius = meta:get_int("size") local radius = meta:get_int("size")
@ -87,7 +83,7 @@ local function quarry_handle_purge(pos)
if stack then if stack then
local item = stack:to_table() local item = stack:to_table()
if item then if item then
technic.tube_inject_item(pos, pos, quarry_eject_dir, item) technic.tube_inject_item(pos, pos, vector.new(0, 1, 0), item)
stack:clear() stack:clear()
inv:set_stack("cache", i, stack) inv:set_stack("cache", i, stack)
break break
@ -210,29 +206,17 @@ end
minetest.register_node("technic:quarry", { minetest.register_node("technic:quarry", {
description = S("%s Quarry"):format("HV"), description = S("%s Quarry"):format("HV"),
tiles = { tiles = {"technic_carbon_steel_block.png", "technic_carbon_steel_block.png",
"technic_carbon_steel_block.png"..tube_entry, "technic_carbon_steel_block.png", "technic_carbon_steel_block.png",
"technic_carbon_steel_block.png"..cable_entry, "technic_carbon_steel_block.png^default_tool_mesepick.png", "technic_carbon_steel_block.png"},
"technic_carbon_steel_block.png"..cable_entry, inventory_image = minetest.inventorycube("technic_carbon_steel_block.png",
"technic_carbon_steel_block.png"..cable_entry,
"technic_carbon_steel_block.png^default_tool_mesepick.png", "technic_carbon_steel_block.png^default_tool_mesepick.png",
"technic_carbon_steel_block.png"..cable_entry "technic_carbon_steel_block.png"),
},
paramtype2 = "facedir", paramtype2 = "facedir",
groups = {cracky=2, tubedevice=1, technic_machine=1, technic_hv=1}, groups = {cracky=2, tubedevice=1, technic_machine=1, technic_hv=1},
connect_sides = {"bottom", "front", "left", "right"}, connect_sides = {"bottom", "front", "left", "right"},
tube = { tube = {
connect_sides = {top = 1}, 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) on_construct = function(pos)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)

View File

@ -1,4 +1,3 @@
-- LV Battery box
minetest.register_craft({ minetest.register_craft({
output = 'technic:lv_battery_box0', output = 'technic:lv_battery_box0',

View File

@ -4,8 +4,6 @@
local S = technic.getter local S = technic.getter
local cable_entry = "^technic_cable_connection_overlay.png"
minetest.register_alias("water_mill", "technic:water_mill") minetest.register_alias("water_mill", "technic:water_mill")
minetest.register_craft({ minetest.register_craft({
@ -32,7 +30,7 @@ local run = function(pos, node)
local lava_nodes = 0 local lava_nodes = 0
local production_level = 0 local production_level = 0
local eu_supply = 0 local eu_supply = 0
local max_output = 35 * 45 -- four param2's at 15 makes 60, cap it lower for "overload protection" local max_output = 50 * 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) -- (plus we want the gen to report 100% if three sides have full flow)
local positions = { local positions = {
@ -49,10 +47,12 @@ local run = function(pos, node)
end end
end end
eu_supply = math.min(35 * water_flow, max_output) eu_supply = 50 * water_flow
production_level = math.floor(100 * eu_supply / max_output) production_level = math.floor(100 * eu_supply / max_output)
if production_level > 0 then
meta:set_int("LV_EU_supply", eu_supply) meta:set_int("LV_EU_supply", eu_supply)
end
meta:set_string("infotext", meta:set_string("infotext",
S("Hydro %s Generator"):format("LV").." ("..production_level.."%)") S("Hydro %s Generator"):format("LV").." ("..production_level.."%)")
@ -70,14 +70,9 @@ end
minetest.register_node("technic:water_mill", { minetest.register_node("technic:water_mill", {
description = S("Hydro %s Generator"):format("LV"), description = S("Hydro %s Generator"):format("LV"),
tiles = { tiles = {"technic_water_mill_top.png", "technic_machine_bottom.png",
"technic_water_mill_top.png", "technic_water_mill_side.png", "technic_water_mill_side.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",
"technic_water_mill_side.png",
"technic_water_mill_side.png"
},
paramtype2 = "facedir", paramtype2 = "facedir",
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
technic_machine=1, technic_lv=1}, technic_machine=1, technic_lv=1},

View File

@ -146,7 +146,6 @@ minetest.register_node("technic:power_radiator", {
}) })
minetest.register_abm({ minetest.register_abm({
label = "Machines: run power radiator",
nodenames = {"technic:power_radiator"}, nodenames = {"technic:power_radiator"},
interval = 1, interval = 1,
chance = 1, chance = 1,

View File

@ -5,8 +5,6 @@ minetest.register_alias("tool_workshop", "technic:tool_workshop")
local S = technic.getter local S = technic.getter
local tube_entry = "^pipeworks_tube_connection_wooden.png"
minetest.register_craft({ minetest.register_craft({
output = 'technic:tool_workshop', output = 'technic:tool_workshop',
recipe = { recipe = {
@ -85,14 +83,8 @@ end
minetest.register_node("technic:tool_workshop", { minetest.register_node("technic:tool_workshop", {
description = S("%s Tool Workshop"):format("MV"), description = S("%s Tool Workshop"):format("MV"),
paramtype2 = "facedir", paramtype2 = "facedir",
tiles = { tiles = {"technic_workshop_top.png", "technic_machine_bottom.png", "technic_workshop_side.png",
"technic_workshop_top.png"..tube_entry, "technic_workshop_side.png", "technic_workshop_side.png", "technic_workshop_side.png"},
"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, groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
technic_machine=1, technic_mv=1, tubedevice=1, tubedevice_receiver=1}, technic_machine=1, technic_mv=1, tubedevice=1, tubedevice_receiver=1},
connect_sides = {"bottom", "back", "left", "right"}, connect_sides = {"bottom", "back", "left", "right"},

View File

@ -8,7 +8,6 @@ dofile(path.."/MV/init.lua")
dofile(path.."/HV/init.lua") dofile(path.."/HV/init.lua")
dofile(path.."/switching_station.lua") dofile(path.."/switching_station.lua")
dofile(path.."/power_monitor.lua")
dofile(path.."/supply_converter.lua") dofile(path.."/supply_converter.lua")
dofile(path.."/other/init.lua") dofile(path.."/other/init.lua")

View File

@ -70,7 +70,6 @@ minetest.register_node("technic:coal_alloy_furnace_active", {
}) })
minetest.register_abm({ minetest.register_abm({
label = "Machines: run coal alloy furnace",
nodenames = {"technic:coal_alloy_furnace", "technic:coal_alloy_furnace_active"}, nodenames = {"technic:coal_alloy_furnace", "technic:coal_alloy_furnace_active"},
interval = 1, interval = 1,
chance = 1, chance = 1,

View File

@ -2,7 +2,6 @@
local S = technic.getter local S = technic.getter
local function deploy_node(inv, slot_name, pos, node, machine_node) 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 ~= "air" then
if node.name == "ignore" or if node.name == "ignore" or
node.name == "default:lava_source" or node.name == "default:lava_source" or
@ -22,7 +21,7 @@ local function deploy_node(inv, slot_name, pos, node, machine_node)
end end
if remove_to then if remove_to then
for i = 1, remove_to do for i = 1, remove_to do
inv:remove_item(slot_name, drops[i]) inv:remove_item(drops[i])
end end
else else
minetest.remove_node(pos) minetest.remove_node(pos)
@ -163,7 +162,6 @@ local function make_constructor(mark, length)
allow_metadata_inventory_put = technic.machine_inventory_put, allow_metadata_inventory_put = technic.machine_inventory_put,
allow_metadata_inventory_take = technic.machine_inventory_take, allow_metadata_inventory_take = technic.machine_inventory_take,
allow_metadata_inventory_move = technic.machine_inventory_move, allow_metadata_inventory_move = technic.machine_inventory_move,
on_rotate = screwdriver.rotate_simple
}) })
minetest.register_node("technic:constructor_mk"..mark.."_on", { minetest.register_node("technic:constructor_mk"..mark.."_on", {
@ -182,7 +180,6 @@ local function make_constructor(mark, length)
allow_metadata_inventory_put = technic.machine_inventory_put, allow_metadata_inventory_put = technic.machine_inventory_put,
allow_metadata_inventory_take = technic.machine_inventory_take, allow_metadata_inventory_take = technic.machine_inventory_take,
allow_metadata_inventory_move = technic.machine_inventory_move, allow_metadata_inventory_move = technic.machine_inventory_move,
on_rotate = false
}) })
end end

View File

@ -3,7 +3,7 @@ local S = technic.getter
frames = {} frames = {}
local infinite_stacks = minetest.settings:get_bool("creative_mode") and minetest.get_modpath("unified_inventory") == nil local infinite_stacks = minetest.setting_getbool("creative_mode") and minetest.get_modpath("unified_inventory") == nil
local frames_pos = {} local frames_pos = {}

View File

@ -1,10 +1,6 @@
local S = technic.getter local S = technic.getter
local fs_helpers = pipeworks.fs_helpers
local tube_entry = "^pipeworks_tube_connection_metallic.png"
local function inject_items (pos) local function inject_items (pos)
local meta=minetest.get_meta(pos) local meta=minetest.get_meta(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()
@ -63,51 +59,29 @@ local function set_injector_formspec(meta)
"button[0,1;2,1;mode_stack;"..S("Itemwise").."]").. "button[0,1;2,1;mode_stack;"..S("Itemwise").."]")..
"list[current_name;main;0,2;8,2;]".. "list[current_name;main;0,2;8,2;]"..
"list[current_player;main;0,5;8,4;]".. "list[current_player;main;0,5;8,4;]"..
"listring[]".. "listring[]")
fs_helpers.cycling_button(
meta,
pipeworks.button_base,
"splitstacks",
{
pipeworks.button_off,
pipeworks.button_on
}
)..pipeworks.button_label
)
end end
minetest.register_node("technic:injector", { minetest.register_node("technic:injector", {
description = S("Self-Contained Injector"), description = S("Self-Contained Injector"),
tiles = { tiles = {"technic_injector_top.png", "technic_injector_bottom.png", "technic_injector_side.png",
"technic_injector_top.png"..tube_entry, "technic_injector_side.png", "technic_injector_side.png", "technic_injector_side.png"},
"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}, groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, tubedevice=1, tubedevice_receiver=1},
tube = { tube = {
can_insert = function(pos, node, stack, direction) can_insert = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos) return minetest.get_meta(pos):get_inventory():room_for_item("main",stack)
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, end,
insert_object = function(pos, node, stack, direction) 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, end,
connect_sides = {left=1, right=1, back=1, top=1, bottom=1}, connect_sides = {left=1, right=1, front=1, back=1, top=1, bottom=1},
}, },
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
on_construct = function(pos) on_construct = function(pos)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
meta:set_string("infotext", S("Self-Contained Injector")) meta:set_string("infotext", S("Self-Contained Injector"))
local inv = meta:get_inventory() local inv = meta:get_inventory()
inv:set_size("main", 8*2) inv:set_size("main", 8*4)
meta:set_string("mode","single items") meta:set_string("mode","single items")
set_injector_formspec(meta) set_injector_formspec(meta)
end, end,
@ -120,12 +94,6 @@ minetest.register_node("technic:injector", {
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
if fields.mode_item then meta:set_string("mode", "single items") end 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.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) set_injector_formspec(meta)
end, end,
allow_metadata_inventory_put = technic.machine_inventory_put, allow_metadata_inventory_put = technic.machine_inventory_put,
@ -136,7 +104,6 @@ minetest.register_node("technic:injector", {
}) })
minetest.register_abm({ minetest.register_abm({
label = "Machines: run injector",
nodenames = {"technic:injector"}, nodenames = {"technic:injector"},
interval = 1, interval = 1,
chance = 1, chance = 1,

View File

@ -1,69 +0,0 @@
-- 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

View File

@ -1,11 +1,5 @@
local digilines_path = minetest.get_modpath("digilines")
local S = technic.getter 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:battery", 10000)
technic.register_power_tool("technic:red_energy_crystal", 50000) technic.register_power_tool("technic:red_energy_crystal", 50000)
@ -35,124 +29,67 @@ minetest.register_tool("technic:battery", {
} }
}) })
-- x+2 + (z+2)*2
local dirtab = {
[4] = 2,
[5] = 3,
[7] = 1,
[8] = 0
}
local tube = { local tube = {
insert_object = function(pos, node, stack, direction) insert_object = function(pos, node, stack, direction)
print(minetest.pos_to_string(direction), dirtab[direction.x+2+(direction.z+2)*2], node.param2) if direction.y == 0 then
if direction.y == 1
or (direction.y == 0 and dirtab[direction.x+2+(direction.z+2)*2] == node.param2) then
return stack return stack
end end
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()
if direction.y == 0 then if direction.y > 0 then
return inv:add_item("src", stack) return inv:add_item("src", stack)
else else
return inv:add_item("dst", stack) return inv:add_item("dst", stack)
end end
end, end,
can_insert = function(pos, node, stack, direction) can_insert = function(pos, node, stack, direction)
print(minetest.pos_to_string(direction), dirtab[direction.x+2+(direction.z+2)*2], node.param2) if direction.y == 0 then
if direction.y == 1
or (direction.y == 0 and dirtab[direction.x+2+(direction.z+2)*2] == node.param2) then
return false return false
end end
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() 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) return inv:room_for_item("src", stack)
else else
if meta:get_int("split_dst_stacks") == 1 then
stack = stack:peek_item(1)
end
return inv:room_for_item("dst", stack) return inv:room_for_item("dst", stack)
end end
end, end,
connect_sides = {left=1, right=1, back=1, top=1}, connect_sides = {left=1, right=1, back=1, top=1, bottom=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) function technic.register_battery_box(data)
local tier = data.tier local tier = data.tier
local ltier = string.lower(tier) local ltier = string.lower(tier)
local formspec = local formspec =
"size[8,9]".. "invsize[8,9;]"..
"image[1,1;1,2;technic_power_meter_bg.png]".. "image[1,1;1,2;technic_power_meter_bg.png]"..
"list[context;src;3,1;1,1;]".. "list[current_name;src;3,1;1,1;]"..
"image[4,1;1,1;technic_battery_reload.png]".. "image[4,1;1,1;technic_battery_reload.png]"..
"list[context;dst;5,1;1,1;]".. "list[current_name;dst;5,1;1,1;]"..
"label[0,0;"..S("%s Battery Box"):format(tier).."]".. "label[0,0;"..S("%s Battery Box"):format(tier).."]"..
"label[3,0;"..S("Charge").."]".. "label[3,0;"..S("Charge").."]"..
"label[5,0;"..S("Discharge").."]".. "label[5,0;"..S("Discharge").."]"..
"label[1,3;"..S("Power level").."]".. "label[1,3;"..S("Power level").."]"..
"list[current_player;main;0,5;8,4;]".. "list[current_player;main;0,5;8,4;]"..
"listring[context;dst]".. "listring[current_name;dst]"..
"listring[current_player;main]".. "listring[current_player;main]"..
"listring[context;src]".. "listring[current_name;src]"..
"listring[current_player;main]" "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 if data.upgrade then
formspec = formspec.. formspec = formspec..
"list[context;upgrade1;3.5,3;1,1;]".. "list[current_name;upgrade1;3.5,3;1,1;]"..
"list[context;upgrade2;4.5,3;1,1;]".. "list[current_name;upgrade2;4.5,3;1,1;]"..
"label[3.5,4;"..S("Upgrade Slots").."]".. "label[3.5,4;"..S("Upgrade Slots").."]"..
"listring[context;upgrade1]".. "listring[current_name;upgrade1]"..
"listring[current_player;main]".. "listring[current_player;main]"..
"listring[context;upgrade2]".. "listring[current_name;upgrade2]"..
"listring[current_player;main]" "listring[current_player;main]"
end end
local run = function(pos, node) 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) 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 eu_input = meta:get_int(tier.."_EU_input")
local current_charge = meta:get_int("internal_EU_charge") local current_charge = meta:get_int("internal_EU_charge")
@ -207,7 +144,12 @@ function technic.register_battery_box(data)
end end
local charge_percent = math.floor(current_charge / max_charge * 100) local charge_percent = math.floor(current_charge / max_charge * 100)
meta:set_string("formspec", formspec..add_on_off_buttons(meta, ltier, charge_percent)) meta:set_string("formspec",
formspec..
"image[1,1;1,2;technic_power_meter_bg.png"
.."^[lowpart:"..charge_percent
..":technic_power_meter_fg.png]")
local infotext = S("@1 Battery Box: @2/@3", tier, local infotext = S("@1 Battery Box: @2/@3", tier,
technic.pretty_num(current_charge), technic.pretty_num(max_charge)) technic.pretty_num(current_charge), technic.pretty_num(max_charge))
if eu_input == 0 then if eu_input == 0 then
@ -228,26 +170,14 @@ function technic.register_battery_box(data)
groups.tubedevice_receiver = 1 groups.tubedevice_receiver = 1
end 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, { minetest.register_node("technic:"..ltier.."_battery_box"..i, {
description = S("%s Battery Box"):format(tier), description = S("%s Battery Box"):format(tier),
tiles = { tiles = {"technic_"..ltier.."_battery_box_top.png",
top_tex, "technic_"..ltier.."_battery_box_bottom.png",
bottom_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",
side_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"},
front_tex},
groups = groups, groups = groups,
connect_sides = {"bottom"}, connect_sides = {"bottom"},
tube = data.tube and tube or nil, tube = data.tube and tube or nil,
@ -256,18 +186,11 @@ function technic.register_battery_box(data)
drop = "technic:"..ltier.."_battery_box0", drop = "technic:"..ltier.."_battery_box0",
on_construct = function(pos) on_construct = function(pos)
local meta = minetest.get_meta(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 inv = meta:get_inventory()
local node = minetest.get_node(pos) local node = minetest.get_node(pos)
meta:set_string("infotext", S("%s Battery Box"):format(tier)) meta:set_string("infotext", S("%s Battery Box"):format(tier))
meta:set_string("formspec", formspec..add_on_off_buttons(meta, ltier, cpercent)) meta:set_string("formspec", formspec)
meta:set_string("channel", ltier.."_battery_box"..minetest.pos_to_string(pos))
meta:set_int(tier.."_EU_demand", 0) meta:set_int(tier.."_EU_demand", 0)
meta:set_int(tier.."_EU_supply", 0) meta:set_int(tier.."_EU_supply", 0)
meta:set_int(tier.."_EU_input", 0) meta:set_int(tier.."_EU_input", 0)
@ -282,59 +205,8 @@ function technic.register_battery_box(data)
allow_metadata_inventory_take = technic.machine_inventory_take, allow_metadata_inventory_take = technic.machine_inventory_take,
allow_metadata_inventory_move = technic.machine_inventory_move, allow_metadata_inventory_move = technic.machine_inventory_move,
technic_run = run, technic_run = run,
on_rotate = screwdriver.rotate_simple,
after_place_node = data.tube and pipeworks.after_place, 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 end
@ -346,22 +218,6 @@ function technic.register_battery_box(data)
end -- End registration 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) function technic.charge_tools(meta, batt_charge, charge_step)
local inv = meta:get_inventory() local inv = meta:get_inventory()

View File

@ -11,118 +11,15 @@ function technic.get_cable_tier(name)
return cable_tier[name] return cable_tier[name]
end end
local function check_connections(pos) local function clear_networks()
-- Build a table of all machines technic.networks = {}
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 end
function technic.register_cable(tier, size) function technic.register_cable(tier, size)
local ltier = string.lower(tier) local ltier = string.lower(tier)
cable_tier["technic:"..ltier.."_cable"] = 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 = { local node_box = {
type = "connected", type = "connected",
@ -147,104 +44,18 @@ function technic.register_cable(tier, size)
sunlight_propagates = true, sunlight_propagates = true,
drawtype = "nodebox", drawtype = "nodebox",
node_box = node_box, node_box = node_box,
connects_to = {"group:technic_"..ltier.."_cable", connects_to = {"technic:"..ltier.."_cable",
"group:technic_"..ltier, "group:technic_all_tiers"}, "group:technic_"..ltier, "group:technic_all_tiers"},
on_construct = clear_networks, on_construct = clear_networks,
on_destruct = 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
for k, v in pairs(pointed_thing_diff) do
if v ~= 0 then
num = xyz[s(tostring(v):sub(-2, -2)..k)]
break
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
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 end
local function clear_nets_if_machine(pos, node) local function clear_nets_if_machine(pos, node)
for tier, machine_list in pairs(technic.machines) do for tier, machine_list in pairs(technic.machines) do
if machine_list[node.name] ~= nil then if machine_list[node.name] ~= nil then
return clear_networks(pos) return clear_networks()
end end
end end
end end

View File

@ -14,8 +14,6 @@ local recipes = {
{ "technic:bronze_dust 4", "technic:copper_dust 3", "technic:tin_dust" }, { "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:stainless_steel_dust 4", "technic:wrought_iron_dust 3", "technic:chromium_dust" },
{ "technic:brass_dust 3", "technic:copper_dust 2", "technic:zinc_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) local function uranium_dust(p)
@ -36,5 +34,5 @@ if minetest.get_modpath("farming") then
end end
for _, data in pairs(recipes) do for _, data in pairs(recipes) do
technic.register_separating_recipe({ input = { data[1] }, output = { data[2], data[3], data[4] } }) technic.register_separating_recipe({ input = { data[1] }, output = { data[2], data[3] } })
end end

View File

@ -20,8 +20,8 @@ local recipes = {
} }
-- defuse the default sandstone recipe, since we have the compressor to take over in a more realistic manner -- defuse the default sandstone recipe, since we have the compressor to take over in a more realistic manner
minetest.clear_craft({ minetest.register_craft({
output = "default:sandstone", output = "default:sand 0",
recipe = { recipe = {
{'group:sand', 'group:sand'}, {'group:sand', 'group:sand'},
{'group:sand', 'group:sand'} {'group:sand', 'group:sand'}

View File

@ -1,8 +1,5 @@
local S = technic.getter local S = technic.getter
local fs_helpers = pipeworks.fs_helpers
local tube_entry = "^pipeworks_tube_connection_metallic.png"
local tube = { local tube = {
insert_object = function(pos, node, stack, direction) insert_object = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
@ -12,16 +9,12 @@ local tube = {
can_insert = function(pos, node, stack, direction) can_insert = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() 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) return inv:room_for_item("src", 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, bottom=1},
} }
function technic.register_generator(data) function technic.register_generator(data)
local tier = data.tier local tier = data.tier
local ltier = string.lower(tier) local ltier = string.lower(tier)
@ -83,19 +76,6 @@ function technic.register_generator(data)
if burn_totaltime == 0 then burn_totaltime = 1 end if burn_totaltime == 0 then burn_totaltime = 1 end
local percent = math.floor((burn_time / burn_totaltime) * 100) local percent = math.floor((burn_time / burn_totaltime) * 100)
meta:set_string("infotext", desc.." ("..percent.."%)") meta:set_string("infotext", desc.." ("..percent.."%)")
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", meta:set_string("formspec",
"size[8, 9]".. "size[8, 9]"..
"label[0, 0;"..minetest.formspec_escape(desc).."]".. "label[0, 0;"..minetest.formspec_escape(desc).."]"..
@ -103,24 +83,14 @@ function technic.register_generator(data)
"image[4, 1;1, 1;default_furnace_fire_bg.png^[lowpart:".. "image[4, 1;1, 1;default_furnace_fire_bg.png^[lowpart:"..
(percent)..":default_furnace_fire_fg.png]".. (percent)..":default_furnace_fire_fg.png]"..
"list[current_player;main;0, 5;8, 4;]".. "list[current_player;main;0, 5;8, 4;]"..
"listring[]".. "listring[]")
form_buttons
)
end end
local tentry = tube_entry
if ltier == "lv" then tentry = "" end
minetest.register_node("technic:"..ltier.."_generator", { minetest.register_node("technic:"..ltier.."_generator", {
description = desc, description = desc,
tiles = { tiles = {"technic_"..ltier.."_generator_top.png", "technic_machine_bottom.png",
"technic_"..ltier.."_generator_top.png"..tentry, "technic_"..ltier.."_generator_side.png", "technic_"..ltier.."_generator_side.png",
"technic_machine_bottom.png"..tentry, "technic_"..ltier.."_generator_side.png", "technic_"..ltier.."_generator_front.png"},
"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", paramtype2 = "facedir",
groups = groups, groups = groups,
connect_sides = {"bottom", "back", "left", "right"}, connect_sides = {"bottom", "back", "left", "right"},
@ -129,24 +99,11 @@ function technic.register_generator(data)
tube = data.tube and tube or nil, tube = data.tube and tube or nil,
on_construct = function(pos) on_construct = function(pos)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local node = minetest.get_node(pos)
meta:set_string("infotext", desc) meta:set_string("infotext", desc)
meta:set_int(data.tier.."_EU_supply", 0) meta:set_int(data.tier.."_EU_supply", 0)
meta:set_int("burn_time", 0) meta:set_int("burn_time", 0)
meta:set_int("tube_time", 0) meta:set_int("tube_time", 0)
local form_buttons = "" meta:set_string("formspec", generator_formspec)
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() local inv = meta:get_inventory()
inv:set_size("src", 1) inv:set_size("src", 1)
end, end,
@ -156,39 +113,14 @@ function technic.register_generator(data)
allow_metadata_inventory_move = technic.machine_inventory_move, allow_metadata_inventory_move = technic.machine_inventory_move,
technic_run = run, technic_run = run,
after_place_node = data.tube and pipeworks.after_place, 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", { minetest.register_node("technic:"..ltier.."_generator_active", {
description = desc, description = desc,
tiles = { tiles = {"technic_"..ltier.."_generator_top.png", "technic_machine_bottom.png",
"technic_"..ltier.."_generator_top.png"..tube_entry, "technic_"..ltier.."_generator_side.png", "technic_"..ltier.."_generator_side.png",
"technic_machine_bottom.png"..tube_entry, "technic_"..ltier.."_generator_side.png", "technic_"..ltier.."_generator_front_active.png"},
"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", paramtype2 = "facedir",
groups = active_groups, groups = active_groups,
connect_sides = {"bottom"}, connect_sides = {"bottom"},
@ -197,7 +129,6 @@ function technic.register_generator(data)
tube = data.tube and tube or nil, tube = data.tube and tube or nil,
drop = "technic:"..ltier.."_generator", drop = "technic:"..ltier.."_generator",
can_dig = technic.machine_can_dig, 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_put = technic.machine_inventory_put,
allow_metadata_inventory_take = technic.machine_inventory_take, allow_metadata_inventory_take = technic.machine_inventory_take,
allow_metadata_inventory_move = technic.machine_inventory_move, allow_metadata_inventory_move = technic.machine_inventory_move,
@ -208,7 +139,6 @@ function technic.register_generator(data)
end, end,
on_timer = function(pos, node) on_timer = function(pos, node)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local node = minetest.get_node(pos)
-- Connected back? -- Connected back?
if meta:get_int(tier.."_EU_timeout") > 0 then return false end if meta:get_int(tier.."_EU_timeout") > 0 then return false end
@ -227,19 +157,6 @@ function technic.register_generator(data)
burn_time = burn_time - 1 burn_time = burn_time - 1
meta:set_int("burn_time", burn_time) meta:set_int("burn_time", burn_time)
local percent = math.floor(burn_time / burn_totaltime * 100) 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", meta:set_string("formspec",
"size[8, 9]".. "size[8, 9]"..
"label[0, 0;"..minetest.formspec_escape(desc).."]".. "label[0, 0;"..minetest.formspec_escape(desc).."]"..
@ -247,44 +164,9 @@ function technic.register_generator(data)
"image[4, 1;1, 1;default_furnace_fire_bg.png^[lowpart:".. "image[4, 1;1, 1;default_furnace_fire_bg.png^[lowpart:"..
(percent)..":default_furnace_fire_fg.png]".. (percent)..":default_furnace_fire_fg.png]"..
"list[current_player;main;0, 5;8, 4;]".. "list[current_player;main;0, 5;8, 4;]"..
"listring[]".. "listring[]")
form_buttons
)
return true return true
end, 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) technic.register_machine(tier, "technic:"..ltier.."_generator", technic.producer)

View File

@ -20,17 +20,17 @@ local recipes = {
{"technic:zinc_lump", "technic:zinc_dust 2"}, {"technic:zinc_lump", "technic:zinc_dust 2"},
{"technic:lead_lump", "technic:lead_dust 2"}, {"technic:lead_lump", "technic:lead_dust 2"},
{"technic:sulfur_lump", "technic:sulfur_dust 2"}, {"technic:sulfur_lump", "technic:sulfur_dust 2"},
{"default:stone", "technic:stone_dust"},
{"default:sand", "technic:stone_dust"},
-- Other -- Other
{"default:cobble", "default:gravel"}, {"default:cobble", "default:gravel"},
{"default:gravel", "default:sand"}, {"default:gravel", "default:dirt"},
{"default:stone", "default:sand"},
{"default:sandstone", "default:sand 2"}, -- reverse recipe can be found in the compressor {"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) -- defuse the sandstone -> 4 sand recipe to avoid infinite sand bugs (also consult the inverse compressor recipe)
minetest.clear_craft({ minetest.register_craft({
output = "default:sandstone 0",
recipe = { recipe = {
{'default:sandstone'} {'default:sandstone'}
}, },
@ -62,6 +62,12 @@ for _, data in pairs(recipes) do
technic.register_grinder_recipe({input = {data[1]}, output = data[2]}) technic.register_grinder_recipe({input = {data[1]}, output = data[2]})
end 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 -- dusts
local function register_dust(name, ingot) local function register_dust(name, ingot)
local lname = string.lower(name) local lname = string.lower(name)
@ -85,7 +91,6 @@ register_dust("Brass", "technic:brass_ingot")
register_dust("Bronze", "default:bronze_ingot") register_dust("Bronze", "default:bronze_ingot")
register_dust("Carbon Steel", "technic:carbon_steel_ingot") register_dust("Carbon Steel", "technic:carbon_steel_ingot")
register_dust("Cast Iron", "technic:cast_iron_ingot") register_dust("Cast Iron", "technic:cast_iron_ingot")
register_dust("Chernobylite", "technic:chernobylite_block")
register_dust("Chromium", "technic:chromium_ingot") register_dust("Chromium", "technic:chromium_ingot")
register_dust("Coal", nil) register_dust("Coal", nil)
register_dust("Copper", "default:copper_ingot") register_dust("Copper", "default:copper_ingot")
@ -94,7 +99,6 @@ register_dust("Gold", "default:gold_ingot")
register_dust("Mithril", "moreores:mithril_ingot") register_dust("Mithril", "moreores:mithril_ingot")
register_dust("Silver", "moreores:silver_ingot") register_dust("Silver", "moreores:silver_ingot")
register_dust("Stainless Steel", "technic:stainless_steel_ingot") register_dust("Stainless Steel", "technic:stainless_steel_ingot")
register_dust("Stone", "default:stone")
register_dust("Sulfur", nil) register_dust("Sulfur", nil)
register_dust("Tin", "moreores:tin_ingot") register_dust("Tin", "moreores:tin_ingot")
register_dust("Wrought Iron", "technic:wrought_iron_ingot") register_dust("Wrought Iron", "technic:wrought_iron_ingot")

View File

@ -1,9 +1,6 @@
local S = technic.getter local S = technic.getter
local fs_helpers = pipeworks.fs_helpers
local tube_entry = "^pipeworks_tube_connection_metallic.png"
local tube = { local tube = {
insert_object = function(pos, node, stack, direction) insert_object = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
@ -13,9 +10,6 @@ local tube = {
can_insert = function(pos, node, stack, direction) can_insert = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() 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) return inv:room_for_item("src", 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, bottom = 1},
@ -140,20 +134,14 @@ function technic.register_base_machine(data)
end end
end end
local tentry = tube_entry
if ltier == "lv" then
tentry = ""
end
minetest.register_node("technic:"..ltier.."_"..machine_name, { minetest.register_node("technic:"..ltier.."_"..machine_name, {
description = machine_desc:format(tier), description = machine_desc:format(tier),
tiles = { tiles = {"technic_"..ltier.."_"..machine_name.."_top.png",
"technic_"..ltier.."_"..machine_name.."_top.png"..tentry, "technic_"..ltier.."_"..machine_name.."_bottom.png",
"technic_"..ltier.."_"..machine_name.."_bottom.png"..tentry, "technic_"..ltier.."_"..machine_name.."_side.png",
"technic_"..ltier.."_"..machine_name.."_side.png"..tentry, "technic_"..ltier.."_"..machine_name.."_side.png",
"technic_"..ltier.."_"..machine_name.."_side.png"..tentry, "technic_"..ltier.."_"..machine_name.."_side.png",
"technic_"..ltier.."_"..machine_name.."_side.png"..tentry, "technic_"..ltier.."_"..machine_name.."_front.png"},
"technic_"..ltier.."_"..machine_name.."_front.png"
},
paramtype2 = "facedir", paramtype2 = "facedir",
groups = groups, groups = groups,
tube = data.tube and tube or nil, tube = data.tube and tube or nil,
@ -163,23 +151,9 @@ function technic.register_base_machine(data)
on_construct = function(pos) on_construct = function(pos)
local node = minetest.get_node(pos) local node = minetest.get_node(pos)
local meta = minetest.get_meta(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_string("infotext", machine_desc:format(tier))
meta:set_int("tube_time", 0) meta:set_int("tube_time", 0)
meta:set_string("formspec", formspec..form_buttons) meta:set_string("formspec", formspec)
local inv = meta:get_inventory() local inv = meta:get_inventory()
inv:set_size("src", input_size) inv:set_size("src", input_size)
inv:set_size("dst", 4) inv:set_size("dst", 4)
@ -192,38 +166,17 @@ function technic.register_base_machine(data)
allow_metadata_inventory_move = technic.machine_inventory_move, allow_metadata_inventory_move = technic.machine_inventory_move,
technic_run = run, technic_run = run,
after_place_node = data.tube and pipeworks.after_place, 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",{ minetest.register_node("technic:"..ltier.."_"..machine_name.."_active",{
description = machine_desc:format(tier), description = machine_desc:format(tier),
tiles = { tiles = {"technic_"..ltier.."_"..machine_name.."_top.png",
"technic_"..ltier.."_"..machine_name.."_top.png"..tentry, "technic_"..ltier.."_"..machine_name.."_bottom.png",
"technic_"..ltier.."_"..machine_name.."_bottom.png"..tentry, "technic_"..ltier.."_"..machine_name.."_side.png",
"technic_"..ltier.."_"..machine_name.."_side.png"..tentry, "technic_"..ltier.."_"..machine_name.."_side.png",
"technic_"..ltier.."_"..machine_name.."_side.png"..tentry, "technic_"..ltier.."_"..machine_name.."_side.png",
"technic_"..ltier.."_"..machine_name.."_side.png"..tentry, "technic_"..ltier.."_"..machine_name.."_front_active.png"},
"technic_"..ltier.."_"..machine_name.."_front_active.png"
},
paramtype2 = "facedir", paramtype2 = "facedir",
drop = "technic:"..ltier.."_"..machine_name, drop = "technic:"..ltier.."_"..machine_name,
groups = active_groups, groups = active_groups,
@ -237,25 +190,6 @@ function technic.register_base_machine(data)
allow_metadata_inventory_move = technic.machine_inventory_move, allow_metadata_inventory_move = technic.machine_inventory_move,
technic_run = run, technic_run = run,
technic_disabled_machine_name = "technic:"..ltier.."_"..machine_name, 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) technic.register_machine(tier, "technic:"..ltier.."_"..machine_name, technic.receiver)

View File

@ -6,15 +6,13 @@ function technic.register_recipe_type(typename, origdata)
for k, v in pairs(origdata) do data[k] = v end for k, v in pairs(origdata) do data[k] = v end
data.input_size = data.input_size or 1 data.input_size = data.input_size or 1
data.output_size = data.output_size or 1 data.output_size = data.output_size or 1
if have_ui then if have_ui and unified_inventory.register_craft_type and data.output_size == 1 then
if unified_inventory.register_craft_type and data.output_size == 1 then
unified_inventory.register_craft_type(typename, { unified_inventory.register_craft_type(typename, {
description = data.description, description = data.description,
width = data.input_size, width = data.input_size,
height = 1, height = 1,
}) })
end end
end
data.recipes = {} data.recipes = {}
technic.recipes[typename] = data technic.recipes[typename] = data
end end
@ -53,8 +51,7 @@ local function register_recipe(typename, data)
end end
technic.recipes[typename].recipes[index] = recipe technic.recipes[typename].recipes[index] = recipe
if have_ui then if have_ui and technic.recipes[typename].output_size == 1 then
if unified_inventory and technic.recipes[typename].output_size == 1 then
unified_inventory.register_craft({ unified_inventory.register_craft({
type = typename, type = typename,
output = data.output, output = data.output,
@ -63,7 +60,6 @@ local function register_recipe(typename, data)
}) })
end end
end end
end
function technic.register_recipe(typename, data) function technic.register_recipe(typename, data)
minetest.after(0.01, register_recipe, typename, data) -- Handle aliases minetest.after(0.01, register_recipe, typename, data) -- Handle aliases

View File

@ -7,128 +7,14 @@
-- Once the receiver side is powered it will deliver power to the other side. -- Once the receiver side is powered it will deliver power to the other side.
-- Unused power is wasted just like any other producer! -- Unused power is wasted just like any other producer!
local digilines_path = minetest.get_modpath("digilines")
local S = technic.getter local S = technic.getter
local cable_entry = "^technic_cable_connection_overlay.png" local run = function(pos, node)
local demand = 10000
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 local remain = 0.9
-- Machine information -- Machine information
local machine_name = S("Supply Converter") local machine_name = S("Supply Converter")
local meta = minetest.get_meta(pos) 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_up = {x=pos.x, y=pos.y+1, z=pos.z}
local pos_down = {x=pos.x, y=pos.y-1, z=pos.z} local pos_down = {x=pos.x, y=pos.y-1, z=pos.z}
@ -160,35 +46,19 @@ end
minetest.register_node("technic:supply_converter", { minetest.register_node("technic:supply_converter", {
description = S("Supply Converter"), description = S("Supply Converter"),
tiles = { tiles = {"technic_supply_converter_top.png", "technic_supply_converter_bottom.png",
"technic_supply_converter_tb.png"..cable_entry, "technic_supply_converter_side.png", "technic_supply_converter_side.png",
"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",
"technic_supply_converter_side.png",
"technic_supply_converter_side.png"
},
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
technic_machine=1, technic_all_tiers=1}, technic_machine=1, technic_all_tiers=1},
connect_sides = {"top", "bottom"}, connect_sides = {"top", "bottom"},
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
on_receive_fields = supply_converter_receive_fields,
on_construct = function(pos) on_construct = function(pos)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
meta:set_string("infotext", S("Supply Converter")) meta:set_string("infotext", S("Supply Converter"))
if digilines_path then meta:set_float("active", false)
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, end,
mesecons = mesecons,
digiline = digiline_def,
technic_run = run, technic_run = run,
technic_on_disable = run,
}) })
minetest.register_craft({ minetest.register_craft({

View File

@ -32,15 +32,9 @@
-- This way the supplies are separated per network. -- This way the supplies are separated per network.
technic.networks = {} technic.networks = {}
technic.cables = {}
local mesecons_path = minetest.get_modpath("mesecons")
local digilines_path = minetest.get_modpath("digilines")
local S = technic.getter local S = technic.getter
local cable_entry = "^technic_cable_connection_overlay.png"
minetest.register_craft({ minetest.register_craft({
output = "technic:switching_station", output = "technic:switching_station",
recipe = { recipe = {
@ -50,22 +44,11 @@ minetest.register_craft({
} }
}) })
local mesecon_def
if mesecons_path then
mesecon_def = {effector = {
rules = mesecon.rules.default,
}}
end
minetest.register_node("technic:switching_station",{ minetest.register_node("technic:switching_station",{
description = S("Switching Station"), description = S("Switching Station"),
tiles = { 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"..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",
"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}, groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_all_tiers=1},
connect_sides = {"bottom"}, connect_sides = {"bottom"},
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
@ -73,45 +56,7 @@ minetest.register_node("technic:switching_station",{
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
meta:set_string("infotext", S("Switching Station")) meta:set_string("infotext", S("Switching Station"))
meta:set_string("active", 1) 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, 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
},
},
}) })
-------------------------------------------------- --------------------------------------------------
@ -119,8 +64,7 @@ minetest.register_node("technic:switching_station",{
-------------------------------------------------- --------------------------------------------------
-- Add a wire node to the LV/MV/HV network -- Add a wire node to the LV/MV/HV network
local add_new_cable_node = function(nodes, pos, network_id) local add_new_cable_node = function(nodes, pos)
technic.cables[minetest.hash_node_position(pos)] = network_id
-- Ignore if the node has already been added -- Ignore if the node has already been added
for i = 1, #nodes do for i = 1, #nodes do
if pos.x == nodes[i].x and if pos.x == nodes[i].x and
@ -134,31 +78,31 @@ local add_new_cable_node = function(nodes, pos, network_id)
end end
-- Generic function to add found connected nodes to the right classification array -- 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, network_id) local check_node_subp = function(PR_nodes, RE_nodes, BA_nodes, SP_nodes, all_nodes, pos, machines, tier, sw_pos, from_below)
technic.get_or_load_node(pos) technic.get_or_load_node(pos)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local name = minetest.get_node(pos).name local name = minetest.get_node(pos).name
if technic.is_tier_cable(name, tier) then if technic.is_tier_cable(name, tier) then
add_new_cable_node(all_nodes, pos,network_id) add_new_cable_node(all_nodes, pos)
elseif machines[name] then elseif machines[name] then
--dprint(name.." is a "..machines[name]) --dprint(name.." is a "..machines[name])
meta:set_string(tier.."_network",minetest.pos_to_string(sw_pos))
if machines[name] == technic.producer then if machines[name] == technic.producer then
add_new_cable_node(PR_nodes, pos, network_id) add_new_cable_node(PR_nodes, pos)
elseif machines[name] == technic.receiver then elseif machines[name] == technic.receiver then
add_new_cable_node(RE_nodes, pos, network_id) add_new_cable_node(RE_nodes, pos)
elseif machines[name] == technic.producer_receiver then elseif machines[name] == technic.producer_receiver then
add_new_cable_node(PR_nodes, pos, network_id) add_new_cable_node(PR_nodes, pos)
add_new_cable_node(RE_nodes, pos, network_id) add_new_cable_node(RE_nodes, pos)
elseif machines[name] == "SPECIAL" and elseif machines[name] == "SPECIAL" and
(pos.x ~= sw_pos.x or pos.y ~= sw_pos.y or pos.z ~= sw_pos.z) and (pos.x ~= sw_pos.x or pos.y ~= sw_pos.y or pos.z ~= sw_pos.z) and
from_below then from_below then
-- Another switching station -> disable it -- Another switching station -> disable it
add_new_cable_node(SP_nodes, pos, network_id) add_new_cable_node(SP_nodes, pos)
meta:set_int("active", 0) meta:set_int("active", 0)
meta:set_string("active_pos", minetest.serialize(sw_pos))
elseif machines[name] == technic.battery then elseif machines[name] == technic.battery then
add_new_cable_node(BA_nodes, pos, network_id) add_new_cable_node(BA_nodes, pos)
end end
meta:set_int(tier.."_EU_timeout", 2) -- Touch node meta:set_int(tier.."_EU_timeout", 2) -- Touch node
@ -166,7 +110,7 @@ local check_node_subp = function(PR_nodes, RE_nodes, BA_nodes, SP_nodes, all_nod
end end
-- Traverse a network given a list of machines and a cable type name -- 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, network_id) local traverse_network = function(PR_nodes, RE_nodes, BA_nodes, SP_nodes, all_nodes, i, machines, tier, sw_pos)
local pos = all_nodes[i] local pos = all_nodes[i]
local positions = { local positions = {
{x=pos.x+1, y=pos.y, z=pos.z}, {x=pos.x+1, y=pos.y, z=pos.z},
@ -177,7 +121,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}} {x=pos.x, y=pos.y, z=pos.z-1}}
--print("ON") --print("ON")
for i, cur_pos in pairs(positions) do 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, network_id) check_node_subp(PR_nodes, RE_nodes, BA_nodes, SP_nodes, all_nodes, cur_pos, machines, tier, sw_pos, i == 3)
end end
end end
@ -209,11 +153,11 @@ local get_network = function(sw_pos, pos1, tier)
local all_nodes = {pos1} local all_nodes = {pos1}
repeat repeat
traverse_network(PR_nodes, RE_nodes, BA_nodes, SP_nodes, all_nodes, traverse_network(PR_nodes, RE_nodes, BA_nodes, SP_nodes, all_nodes,
i, technic.machines[tier], tier, sw_pos, minetest.hash_node_position(pos1)) i, technic.machines[tier], tier, sw_pos)
i = i + 1 i = i + 1
until all_nodes[i] == nil until all_nodes[i] == nil
technic.networks[minetest.hash_node_position(pos1)] = {tier = tier, PR_nodes = PR_nodes, 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, all_nodes = all_nodes} RE_nodes = RE_nodes, BA_nodes = BA_nodes, SP_nodes = SP_nodes}
return PR_nodes, BA_nodes, RE_nodes return PR_nodes, BA_nodes, RE_nodes
end end
@ -240,34 +184,31 @@ minetest.register_abm({
local RE_nodes local RE_nodes
local machine_name = S("Switching Station") local machine_name = S("Switching Station")
-- 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 if meta:get_int("active") ~= 1 then
minetest.forceload_free_block(pos) meta:set_int("active", 1)
minetest.forceload_free_block(pos1) local active_pos = minetest.deserialize(meta:get_string("active_pos"))
meta:set_string("infotext",S("%s Already Present"):format(machine_name)) 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 return
end end
-- Which kind of network are we on:
pos1 = {x=pos.x, y=pos.y-1, z=pos.z}
local name = minetest.get_node(pos1).name local name = minetest.get_node(pos1).name
local tier = technic.get_cable_tier(name) local tier = technic.get_cable_tier(name)
if tier then 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) PR_nodes, BA_nodes, RE_nodes = get_network(pos, pos1, tier)
else else
--dprint("Not connected to a network") --dprint("Not connected to a network")
meta:set_string("infotext", S("%s Has No Network"):format(machine_name)) meta:set_string("infotext", S("%s Has No Network"):format(machine_name))
minetest.forceload_free_block(pos)
minetest.forceload_free_block(pos1)
return return
end end
-- Run all the nodes -- Run all the nodes
local function run_nodes(list, run_stage) local function run_nodes(list)
for _, pos2 in ipairs(list) do for _, pos2 in ipairs(list) do
technic.get_or_load_node(pos2) technic.get_or_load_node(pos2)
local node2 = minetest.get_node(pos2) local node2 = minetest.get_node(pos2)
@ -276,14 +217,14 @@ minetest.register_abm({
nodedef = minetest.registered_nodes[node2.name] nodedef = minetest.registered_nodes[node2.name]
end end
if nodedef and nodedef.technic_run then if nodedef and nodedef.technic_run then
nodedef.technic_run(pos2, node2, run_stage) nodedef.technic_run(pos2, node2)
end end
end end
end end
run_nodes(PR_nodes, technic.producer) run_nodes(PR_nodes)
run_nodes(RE_nodes, technic.receiver) run_nodes(RE_nodes)
run_nodes(BA_nodes, technic.battery) run_nodes(BA_nodes)
-- Strings for the meta data -- Strings for the meta data
local eu_demand_str = tier.."_EU_demand" local eu_demand_str = tier.."_EU_demand"
@ -350,23 +291,6 @@ minetest.register_abm({
S("@1. Supply: @2 Demand: @3", S("@1. Supply: @2 Demand: @3",
machine_name, technic.pretty_num(PR_eu_supply), technic.pretty_num(RE_eu_demand))) 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 the PR supply is enough for the RE demand supply them all
if PR_eu_supply >= RE_eu_demand then if PR_eu_supply >= RE_eu_demand then
--dprint("PR_eu_supply"..PR_eu_supply.." >= RE_eu_demand"..RE_eu_demand) --dprint("PR_eu_supply"..PR_eu_supply.." >= RE_eu_demand"..RE_eu_demand)
@ -428,7 +352,6 @@ minetest.register_abm({
meta1 = minetest.get_meta(pos1) meta1 = minetest.get_meta(pos1)
meta1:set_int(eu_input_str, 0) meta1:set_int(eu_input_str, 0)
end end
end, end,
}) })
@ -447,12 +370,10 @@ local function switching_station_timeout_count(pos, tier)
end end
end end
minetest.register_abm({ minetest.register_abm({
label = "Machines: timeout check",
nodenames = {"group:technic_machine"}, nodenames = {"group:technic_machine"},
interval = 1, interval = 1,
chance = 1, chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider) 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 for tier, machines in pairs(technic.machines) do
if machines[node.name] and switching_station_timeout_count(pos, tier) then if machines[node.name] and switching_station_timeout_count(pos, tier) then
local nodedef = minetest.registered_nodes[node.name] local nodedef = minetest.registered_nodes[node.name]
@ -471,24 +392,6 @@ minetest.register_abm({
end, 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 for tier, machines in pairs(technic.machines) do
-- SPECIAL will not be traversed -- SPECIAL will not be traversed
technic.register_machine(tier, "technic:switching_station", "SPECIAL") technic.register_machine(tier, "technic:switching_station", "SPECIAL")

View File

@ -1,362 +0,0 @@
# 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

View File

@ -54,14 +54,8 @@ local rad_resistance_node = {
["default:lava_source"] = 17, ["default:lava_source"] = 17,
["default:mese"] = 21, ["default:mese"] = 21,
["default:mossycobble"] = 15, ["default:mossycobble"] = 15,
["pbj_pup:pbj_pup"] = 10000, ["default:nyancat"] = 1000,
["pbj_pup:pbj_pup_candies"] = 10000, ["default:nyancat_rainbow"] = 1000,
["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"] = 18,
["default:obsidian_glass"] = 18, ["default:obsidian_glass"] = 18,
["default:sand"] = 10, ["default:sand"] = 10,
@ -344,9 +338,8 @@ local function dmg_abm(pos, node)
end end
end end
if minetest.settings:get_bool("enable_damage") then if minetest.setting_getbool("enable_damage") then
minetest.register_abm({ minetest.register_abm({
label = "Radiation damage",
nodenames = {"group:radioactive"}, nodenames = {"group:radioactive"},
interval = 1, interval = 1,
chance = 1, chance = 1,
@ -439,7 +432,6 @@ minetest.register_node("technic:chernobylite_block", {
}) })
minetest.register_abm({ minetest.register_abm({
label = "Corium: boil-off water (sources)",
nodenames = {"group:water"}, nodenames = {"group:water"},
neighbors = {"technic:corium_source"}, neighbors = {"technic:corium_source"},
interval = 1, interval = 1,
@ -450,7 +442,6 @@ minetest.register_abm({
}) })
minetest.register_abm({ minetest.register_abm({
label = "Corium: boil-off water (flowing)",
nodenames = {"technic:corium_flowing"}, nodenames = {"technic:corium_flowing"},
neighbors = {"group:water"}, neighbors = {"group:water"},
interval = 1, interval = 1,
@ -461,7 +452,6 @@ minetest.register_abm({
}) })
minetest.register_abm({ minetest.register_abm({
label = "Corium: become chernobylite",
nodenames = {"technic:corium_flowing"}, nodenames = {"technic:corium_flowing"},
interval = 5, interval = 5,
chance = (griefing and 10 or 1), chance = (griefing and 10 or 1),
@ -472,7 +462,6 @@ minetest.register_abm({
if griefing then if griefing then
minetest.register_abm({ minetest.register_abm({
label = "Corium: griefing",
nodenames = {"technic:corium_source", "technic:corium_flowing"}, nodenames = {"technic:corium_source", "technic:corium_flowing"},
interval = 4, interval = 4,
chance = 4, chance = 4,

Binary file not shown.

After

Width:  |  Height:  |  Size: 576 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 639 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 587 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 299 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 436 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 338 B

After

Width:  |  Height:  |  Size: 653 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 452 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 475 B

After

Width:  |  Height:  |  Size: 777 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 575 B

After

Width:  |  Height:  |  Size: 792 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 591 B

After

Width:  |  Height:  |  Size: 738 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 236 B

After

Width:  |  Height:  |  Size: 594 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 197 B

After

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 591 B

After

Width:  |  Height:  |  Size: 738 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 239 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 159 B

After

Width:  |  Height:  |  Size: 587 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 197 B

After

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 428 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 456 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 417 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 738 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 656 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 738 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -71,6 +71,12 @@ local function drill_dig_it1 (player)
end end
local function drill_dig_it2 (pos,player) 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 pos.y=pos.y+1
drill_dig_it0 (pos,player) drill_dig_it0 (pos,player)
pos.z=pos.z+1 pos.z=pos.z+1
@ -78,14 +84,7 @@ local function drill_dig_it2 (pos,player)
pos.z=pos.z-2 pos.z=pos.z-2
drill_dig_it0 (pos,player) drill_dig_it0 (pos,player)
pos.z=pos.z+1 pos.z=pos.z+1
pos.y=pos.y-1 pos.y=pos.y-2
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) drill_dig_it0 (pos,player)
pos.z=pos.z+1 pos.z=pos.z+1
drill_dig_it0 (pos,player) drill_dig_it0 (pos,player)
@ -94,6 +93,12 @@ local function drill_dig_it2 (pos,player)
end end
local function drill_dig_it3 (pos,player) 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 pos.y=pos.y+1
drill_dig_it0 (pos,player) drill_dig_it0 (pos,player)
pos.x=pos.x+1 pos.x=pos.x+1
@ -101,14 +106,7 @@ local function drill_dig_it3 (pos,player)
pos.x=pos.x-2 pos.x=pos.x-2
drill_dig_it0 (pos,player) drill_dig_it0 (pos,player)
pos.x=pos.x+1 pos.x=pos.x+1
pos.y=pos.y-1 pos.y=pos.y-2
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) drill_dig_it0 (pos,player)
pos.x=pos.x+1 pos.x=pos.x+1
drill_dig_it0 (pos,player) drill_dig_it0 (pos,player)
@ -254,9 +252,10 @@ local function mining_drill_mk2_setmode(user,itemstack)
mode=mode+1 mode=mode+1
if mode>=5 then mode=1 end 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]) minetest.chat_send_player(player_name, S("Mining Drill Mk%d Mode %d"):format(2, mode)..": "..mining_drill_mode_text[mode][1])
itemstack:set_name("technic:mining_drill_mk2_"..mode); item["name"]="technic:mining_drill_mk2_"..mode
meta["mode"]=mode meta["mode"]=mode
itemstack:set_metadata(minetest.serialize(meta)) item["metadata"]=minetest.serialize(meta)
itemstack:replace(item)
return itemstack return itemstack
end end
@ -277,9 +276,10 @@ local function mining_drill_mk3_setmode(user,itemstack)
mode=mode+1 mode=mode+1
if mode>=6 then mode=1 end 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]) minetest.chat_send_player(player_name, S("Mining Drill Mk%d Mode %d"):format(3, mode)..": "..mining_drill_mode_text[mode][1])
itemstack:set_name("technic:mining_drill_mk3_"..mode); item["name"]="technic:mining_drill_mk3_"..mode
meta["mode"]=mode meta["mode"]=mode
itemstack:set_metadata(minetest.serialize(meta)) item["metadata"]=minetest.serialize(meta)
itemstack:replace(item)
return itemstack return itemstack
end end
@ -296,7 +296,7 @@ local function mining_drill_mk2_handler(itemstack, user, pointed_thing)
end end
local charge_to_take = cost_to_use(2, meta.mode) local charge_to_take = cost_to_use(2, meta.mode)
if meta.charge >= charge_to_take then if meta.charge >= charge_to_take then
local pos = minetest.get_pointed_thing_position(pointed_thing, false) local pos = minetest.get_pointed_thing_position(pointed_thing, above)
drill_dig_it(pos, user, meta.mode) drill_dig_it(pos, user, meta.mode)
if not technic.creative_mode then if not technic.creative_mode then
meta.charge = meta.charge - charge_to_take meta.charge = meta.charge - charge_to_take
@ -319,7 +319,7 @@ local function mining_drill_mk3_handler(itemstack, user, pointed_thing)
end end
local charge_to_take = cost_to_use(3, meta.mode) local charge_to_take = cost_to_use(3, meta.mode)
if meta.charge >= charge_to_take then if meta.charge >= charge_to_take then
local pos = minetest.get_pointed_thing_position(pointed_thing, false) local pos = minetest.get_pointed_thing_position(pointed_thing, above)
drill_dig_it(pos, user, meta.mode) drill_dig_it(pos, user, meta.mode)
if not technic.creative_mode then if not technic.creative_mode then
meta.charge = meta.charge - charge_to_take meta.charge = meta.charge - charge_to_take
@ -348,7 +348,7 @@ minetest.register_tool("technic:mining_drill", {
end end
local charge_to_take = cost_to_use(1, 1) local charge_to_take = cost_to_use(1, 1)
if meta.charge >= charge_to_take then if meta.charge >= charge_to_take then
local pos = minetest.get_pointed_thing_position(pointed_thing, false) local pos = minetest.get_pointed_thing_position(pointed_thing, above)
drill_dig_it(pos, user, 1) drill_dig_it(pos, user, 1)
if not technic.creative_mode then if not technic.creative_mode then
meta.charge = meta.charge - charge_to_take meta.charge = meta.charge - charge_to_take

View File

@ -62,7 +62,6 @@ minetest.register_craftitem("technic:rubber", {
}) })
minetest.register_abm({ minetest.register_abm({
label = "Tools: tree tap",
nodenames = {"moretrees:rubber_tree_trunk_empty"}, nodenames = {"moretrees:rubber_tree_trunk_empty"},
interval = 60, interval = 60,
chance = 15, chance = 15,

View File

@ -1,3 +1,4 @@
technic.chests.groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic.chests.groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
tubedevice=1, tubedevice_receiver=1} tubedevice=1, tubedevice_receiver=1}
technic.chests.groups_noinv = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic.chests.groups_noinv = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
@ -12,9 +13,6 @@ technic.chests.tube = {
can_insert = function(pos, node, stack, direction) can_insert = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() 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) return inv:room_for_item("main",stack)
end, end,
input_inventory = "main", input_inventory = "main",
@ -28,7 +26,12 @@ technic.chests.can_dig = function(pos, player)
end end
local function inv_change(pos, count, player) local function inv_change(pos, count, player)
if not default.can_interact_with_node(player, pos) then 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))
return 0 return 0
end end
return count return count
@ -52,13 +55,17 @@ end
function technic.chests.on_inv_put(pos, listname, index, stack, player) function technic.chests.on_inv_put(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name().. minetest.log("action", player:get_player_name()..
" moves " .. stack:get_name() .. " puts stuff in to chest at "
" to chest at " .. minetest.pos_to_string(pos)) ..minetest.pos_to_string(pos))
end end
function technic.chests.on_inv_take(pos, listname, index, stack, player) function technic.chests.on_inv_take(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name().. minetest.log("action", player:get_player_name()..
" takes " .. stack:get_name() .. " takes stuff from chest at "
" from chest at " .. minetest.pos_to_string(pos)) ..minetest.pos_to_string(pos))
end
function has_locked_chest_privilege(meta, player)
return player:get_player_name() == meta:get_string("owner")
end end

View File

@ -1,16 +1,9 @@
local S = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end local S = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end
local pipeworks = rawget(_G, "pipeworks") 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 if not minetest.get_modpath("pipeworks") then
-- Pipeworks is not installed. Simulate using a dummy table... -- Pipeworks is not installed. Simulate using a dummy table...
pipeworks = {} pipeworks = {}
fs_helpers = {}
local pipeworks_meta = {} local pipeworks_meta = {}
setmetatable(pipeworks, pipeworks_meta) setmetatable(pipeworks, pipeworks_meta)
local dummy = function() local dummy = function()
@ -22,12 +15,6 @@ if not minetest.get_modpath("pipeworks") then
end end
pipeworks.after_place = dummy pipeworks.after_place = dummy
pipeworks.after_dig = 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 end
local chest_mark_colors = { local chest_mark_colors = {
@ -85,16 +72,6 @@ local function set_formspec(pos, data, page)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local node = minetest.get_node(pos) local node = minetest.get_node(pos)
local formspec = data.base_formspec 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 if data.autosort then
local status = meta:get_int("autosort") 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")).."]" 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")).."]"
@ -102,13 +79,13 @@ local function set_formspec(pos, data, page)
if data.infotext then if data.infotext then
local formspec_infotext = minetest.formspec_escape(meta:get_string("infotext")) local formspec_infotext = minetest.formspec_escape(meta:get_string("infotext"))
if page == "main" then if page == "main" then
formspec = formspec.."image_button["..(shift_edit_field+data.hileft+2.1)..",0.1;0.8,0.8;" formspec = formspec.."image_button["..(data.hileft+2.1)..",0.1;0.8,0.8;"
.."technic_pencil_icon.png;edit_infotext;]" .."technic_pencil_icon.png;edit_infotext;]"
.."label["..(shift_edit_field+data.hileft+3)..",0;"..formspec_infotext.."]" .."label["..(data.hileft+3)..",0;"..formspec_infotext.."]"
elseif page == "edit_infotext" then elseif page == "edit_infotext" then
formspec = formspec.."image_button["..(shift_edit_field+data.hileft+2.1)..",0.1;0.8,0.8;" formspec = formspec.."image_button["..(data.hileft+2.1)..",0.1;0.8,0.8;"
.."technic_checkmark_icon.png;save_infotext;]" .."technic_checkmark_icon.png;save_infotext;]"
.."field["..(shift_edit_field+data.hileft+3.3)..",0.2;4.8,1;" .."field["..(data.hileft+3.3)..",0.2;4.8,1;"
.."infotext_box;"..S("Edit chest description:")..";" .."infotext_box;"..S("Edit chest description:")..";"
..formspec_infotext.."]" ..formspec_infotext.."]"
end end
@ -192,17 +169,12 @@ local function get_receive_fields(name, data)
local nn = "technic:"..lname..(data.locked and "_locked" or "").."_chest" local nn = "technic:"..lname..(data.locked and "_locked" or "").."_chest"
check_color_buttons(pos, meta, nn, fields) check_color_buttons(pos, meta, nn, fields)
end 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) meta:get_inventory():set_size("main", data.width * data.height)
set_formspec(pos, data, page) set_formspec(pos, data, page)
end end
end end
function technic.chests:definition(name, data) function technic.chests:definition(name, data)
local lname = name:lower() local lname = name:lower()
name = S(name) name = S(name)
@ -239,7 +211,6 @@ function technic.chests:definition(name, data)
"background["..data.hileft..",1;"..data.width..","..data.height..";technic_"..lname.."_chest_inventory.png]".. "background["..data.hileft..",1;"..data.width..","..data.height..";technic_"..lname.."_chest_inventory.png]"..
"background["..data.loleft..","..data.lotop..";8,4;technic_main_inventory.png]".. "background["..data.loleft..","..data.lotop..";8,4;technic_main_inventory.png]"..
"listring[]" "listring[]"
if data.sort then if data.sort then
data.base_formspec = data.base_formspec.."button["..data.hileft..","..(data.height+1.1)..";1,0.8;sort;"..S("Sort").."]" data.base_formspec = data.base_formspec.."button["..data.hileft..","..(data.height+1.1)..";1,0.8;sort;"..S("Sort").."]"
end end
@ -268,24 +239,11 @@ function technic.chests:definition(name, data)
desc = S("%s Chest"):format(name) desc = S("%s Chest"):format(name)
end 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 = { local def = {
description = desc, description = desc,
tiles = { tiles = {"technic_"..lname.."_chest_top.png", "technic_"..lname.."_chest_top.png",
"technic_"..lname.."_chest_top.png"..tentry, "technic_"..lname.."_chest_side.png", "technic_"..lname.."_chest_side.png",
"technic_"..lname.."_chest_top.png"..tentry, "technic_"..lname.."_chest_side.png", table.concat(front, "^")},
"technic_"..lname.."_chest_side.png"..tentry,
"technic_"..lname.."_chest_side.png"..tentry,
"technic_"..lname.."_chest_side.png"..tentry,
table.concat(front, "^")
},
paramtype2 = "facedir", paramtype2 = "facedir",
groups = self.groups, groups = self.groups,
tube = self.tube, tube = self.tube,
@ -306,44 +264,11 @@ function technic.chests:definition(name, data)
on_metadata_inventory_move = self.on_inv_move, on_metadata_inventory_move = self.on_inv_move,
on_metadata_inventory_put = self.on_inv_put, 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 if data.locked then
def.allow_metadata_inventory_move = self.inv_move def.allow_metadata_inventory_move = self.inv_move
def.allow_metadata_inventory_put = self.inv_put def.allow_metadata_inventory_put = self.inv_put
def.allow_metadata_inventory_take = self.inv_take 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 end
return def return def
end end

View File

@ -51,7 +51,7 @@ mg.register_ore({
mg.register_ore({ mg.register_ore({
name = "technic:mineral_lead", name = "technic:mineral_lead",
wherein = "default:stone", wherein = "default:stone",
seeddiff = 14, seeddiff = 13,
maxvdistance = 10.5, maxvdistance = 10.5,
maxheight = 16, maxheight = 16,
seglenghtn = 15, seglenghtn = 15,

View File

@ -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_params = {offset = 0, scale = 1, spread = {x = 100, y = 100, z = 100}, seed = 420, octaves = 3, persist = 0.7}
local uranium_threshold = 0.55 local uranium_threshhold = 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_params = {offset = 0, scale = 1, spread = {x = 100, y = 100, z = 100}, seed = 421, octaves = 3, persist = 0.7}
local chromium_threshold = 0.55 local chromium_threshhold = 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_params = {offset = 0, scale = 1, spread = {x = 100, y = 100, z = 100}, seed = 422, octaves = 3, persist = 0.7}
local zinc_threshold = 0.5 local zinc_threshhold = 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_params = {offset = 0, scale = 1, spread = {x = 100, y = 100, z = 100}, seed = 423, octaves = 3, persist = 0.7}
local lead_threshold = 0.3 local lead_threshhold = 0.3
minetest.register_ore({ minetest.register_ore({
ore_type = "scatter", ore_type = "scatter",
@ -20,7 +20,7 @@ minetest.register_ore({
y_min = -300, y_min = -300,
y_max = -80, y_max = -80,
noise_params = uranium_params, noise_params = uranium_params,
noise_threshold = uranium_threshold, noise_threshhold = uranium_threshhold,
}) })
minetest.register_ore({ minetest.register_ore({
@ -33,7 +33,7 @@ minetest.register_ore({
y_min = -200, y_min = -200,
y_max = -100, y_max = -100,
noise_params = chromium_params, noise_params = chromium_params,
noise_threshold = chromium_threshold, noise_threshhold = chromium_threshhold,
}) })
minetest.register_ore({ minetest.register_ore({
@ -47,7 +47,7 @@ minetest.register_ore({
y_max = -200, y_max = -200,
flags = "absheight", flags = "absheight",
noise_params = chromium_params, noise_params = chromium_params,
noise_threshold = chromium_threshold, noise_threshhold = chromium_threshhold,
}) })
minetest.register_ore({ minetest.register_ore({
@ -55,12 +55,12 @@ minetest.register_ore({
ore = "technic:mineral_zinc", ore = "technic:mineral_zinc",
wherein = "default:stone", wherein = "default:stone",
clust_scarcity = 8*8*8, clust_scarcity = 8*8*8,
clust_num_ores = 5, clust_num_ores = 4,
clust_size = 7, clust_size = 3,
y_min = -32, y_min = -32,
y_max = 2, y_max = 2,
noise_params = zinc_params, noise_params = zinc_params,
noise_threshold = zinc_threshold, noise_threshhold = zinc_threshhold,
}) })
minetest.register_ore({ minetest.register_ore({
@ -74,7 +74,7 @@ minetest.register_ore({
y_max = -32, y_max = -32,
flags = "absheight", flags = "absheight",
noise_params = zinc_params, noise_params = zinc_params,
noise_threshold = zinc_threshold, noise_threshhold = zinc_threshhold,
}) })
minetest.register_ore({ minetest.register_ore({
@ -87,7 +87,7 @@ minetest.register_ore({
y_min = -16, y_min = -16,
y_max = 16, y_max = 16,
noise_params = lead_params, noise_params = lead_params,
noise_threshold = lead_threshold, noise_threshhold = lead_threshhold,
}) })
minetest.register_ore({ minetest.register_ore({
@ -100,7 +100,7 @@ minetest.register_ore({
y_min = -128, y_min = -128,
y_max = -16, y_max = -16,
noise_params = lead_params, noise_params = lead_params,
noise_threshold = lead_threshold, noise_threshhold = lead_threshhold,
}) })
minetest.register_ore({ minetest.register_ore({
@ -114,22 +114,19 @@ minetest.register_ore({
y_max = -128, y_max = -128,
flags = "absheight", flags = "absheight",
noise_params = lead_params, noise_params = lead_params,
noise_threshold = lead_threshold, noise_threshhold = lead_threshhold,
}) })
-- Sulfur -- Sulfur
local sulfur_buf = nil
local sulfur_noise= nil
minetest.register_on_generated(function(minp, maxp, seed) minetest.register_on_generated(function(minp, maxp, seed)
local vm, emin, emax = minetest.get_mapgen_object("voxelmanip") local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
local a = VoxelArea:new{ local a = VoxelArea:new{
MinEdge = {x = emin.x, y = emin.y, z = emin.z}, MinEdge = {x = emin.x, y = emin.y, z = emin.z},
MaxEdge = {x = emax.x, y = emax.y, z = emax.z}, MaxEdge = {x = emax.x, y = emax.y, z = emax.z},
} }
local data = vm:get_data(sulfur_buf) local data = vm:get_data()
local pr = PseudoRandom(17 * minp.x + 42 * minp.y + 101 * minp.z) local pr = PseudoRandom(17 * minp.x + 42 * minp.y + 101 * minp.z)
sulfur_noise = sulfur_noise or minetest.get_perlin(9876, 3, 0.5, 100) local noise = minetest.get_perlin(9876, 3, 0.5, 100)
local c_lava = minetest.get_content_id("default:lava_source") local c_lava = minetest.get_content_id("default:lava_source")
local c_lava_flowing = minetest.get_content_id("default:lava_flowing") local c_lava_flowing = minetest.get_content_id("default:lava_flowing")
@ -141,7 +138,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
for y = minp.y + math.floor(grid_size / 2), maxp.y, 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 for z = minp.z + math.floor(grid_size / 2), maxp.z, grid_size do
local c = data[a:index(x, y, z)] local c = data[a:index(x, y, z)]
if (c == c_lava or c == c_lava_flowing) and sulfur_noise:get3d({x = x, y = z, z = z}) >= 0.4 then if (c == c_lava or c == c_lava_flowing) and 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 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 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 for zz = math.max(minp.z, z - grid_size), math.min(maxp.z, z + grid_size) do
@ -172,7 +169,7 @@ minetest.register_ore({
clust_size = 3, clust_size = 3,
y_min = -31000, y_min = -31000,
y_max = -50, y_max = -50,
noise_threshold = 0.4, noise_threshhold = 0.4,
noise_params = {offset=0, scale=15, spread={x=150, y=150, z=150}, seed=23, octaves=3, persist=0.70} noise_params = {offset=0, scale=15, spread={x=150, y=150, z=150}, seed=23, octaves=3, persist=0.70}
}) })
end end
@ -187,7 +184,7 @@ minetest.register_ore({
clust_size = 4, clust_size = 4,
y_min = -31000, y_min = -31000,
y_max = -150, y_max = -150,
noise_threshold = 0.4, noise_threshhold = 0.4,
noise_params = {offset=0, scale=15, spread={x=130, y=130, z=130}, seed=24, octaves=3, persist=0.70} noise_params = {offset=0, scale=15, spread={x=130, y=130, z=130}, seed=24, octaves=3, persist=0.70}
}) })
end end

View File

@ -73,7 +73,6 @@ technic.rubber_tree_model={
minetest.register_abm({ minetest.register_abm({
nodenames = {"moretrees:rubber_tree_sapling"}, nodenames = {"moretrees:rubber_tree_sapling"},
label = "Worldgen: grow rubber tree sapling",
interval = 60, interval = 60,
chance = 20, chance = 20,
action = function(pos, node) action = function(pos, node)