Compare commits
	
		
			9 Commits
		
	
	
		
			bce5306abe
			...
			recipes_re
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					9004ab3322 | ||
| 
						 | 
					01b475c7cc | ||
| 
						 | 
					63ab5ef5d4 | ||
| 
						 | 
					74d54eb0b4 | ||
| 
						 | 
					d9fc156960 | ||
| 
						 | 
					c26f45c962 | ||
| 
						 | 
					775cb9d132 | ||
| 
						 | 
					fb15df52e2 | ||
| 
						 | 
					43295b5b7f | 
							
								
								
									
										20
									
								
								.github/ISSUE_TEMPLATE/bug_report.md
									
									
									
									
										vendored
									
									
								
							
							
						
						@@ -1,20 +0,0 @@
 | 
				
			|||||||
---
 | 
					 | 
				
			||||||
name: Bug report
 | 
					 | 
				
			||||||
about: Report a problem within technic
 | 
					 | 
				
			||||||
title: ''
 | 
					 | 
				
			||||||
labels: Bug
 | 
					 | 
				
			||||||
assignees: ''
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
---
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Technic has no main developer and largely depends on
 | 
					 | 
				
			||||||
user-provided Pull Requests. It will take a while until
 | 
					 | 
				
			||||||
even important issues are noticed.
 | 
					 | 
				
			||||||
Please consider proposing a PR directly.
 | 
					 | 
				
			||||||
_______________________________________________
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
**Bug description**
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
**Steps to reproduce this issue**
 | 
					 | 
				
			||||||
							
								
								
									
										11
									
								
								.github/workflows/check-release.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						@@ -1,11 +0,0 @@
 | 
				
			|||||||
on: [push, pull_request]
 | 
					 | 
				
			||||||
name: Check & Release
 | 
					 | 
				
			||||||
jobs:
 | 
					 | 
				
			||||||
  lint:
 | 
					 | 
				
			||||||
    runs-on: ubuntu-latest
 | 
					 | 
				
			||||||
    steps:
 | 
					 | 
				
			||||||
      - uses: actions/checkout@master
 | 
					 | 
				
			||||||
      - name: lint
 | 
					 | 
				
			||||||
        uses: Roang-zero1/factorio-mod-luacheck@master
 | 
					 | 
				
			||||||
        with:
 | 
					 | 
				
			||||||
          luacheckrc_url: ""
 | 
					 | 
				
			||||||
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						@@ -48,6 +48,7 @@ local.properties
 | 
				
			|||||||
*_p.c
 | 
					*_p.c
 | 
				
			||||||
*.ilk
 | 
					*.ilk
 | 
				
			||||||
*.meta
 | 
					*.meta
 | 
				
			||||||
 | 
					*.obj
 | 
				
			||||||
*.pch
 | 
					*.pch
 | 
				
			||||||
*.pdb
 | 
					*.pdb
 | 
				
			||||||
*.pgc
 | 
					*.pgc
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										40
									
								
								.luacheckrc
									
									
									
									
									
								
							
							
						
						@@ -1,40 +0,0 @@
 | 
				
			|||||||
unused_args = false
 | 
					 | 
				
			||||||
allow_defined_top = true
 | 
					 | 
				
			||||||
max_line_length = 150
 | 
					 | 
				
			||||||
-- Allow shadowed variables (callbacks in callbacks)
 | 
					 | 
				
			||||||
redefined = false
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
globals = {
 | 
					 | 
				
			||||||
    "technic", "minetest",
 | 
					 | 
				
			||||||
    "srcstack",
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
read_globals = {
 | 
					 | 
				
			||||||
    string = {fields = {"split", "trim"}},
 | 
					 | 
				
			||||||
    table = {fields = {"copy", "getn"}},
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    "intllib", "VoxelArea",
 | 
					 | 
				
			||||||
    "default", "stairsplus",
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    "PseudoRandom", "ItemStack",
 | 
					 | 
				
			||||||
    "mg", "tubelib", "vector",
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    "moretrees", "bucket",
 | 
					 | 
				
			||||||
    "unified_inventory", "digilines",
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    "pipeworks", "screwdriver",
 | 
					 | 
				
			||||||
    "VoxelManip", "unifieddyes",
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    "Settings", "mesecon",
 | 
					 | 
				
			||||||
    "digiline_remote",
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    "protector", "isprotect",
 | 
					 | 
				
			||||||
    "homedecor_expect_infinite_stacks",
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    "craftguide", "i3"
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- Loop warning
 | 
					 | 
				
			||||||
files["technic/machines/other/frames.lua"].ignore = { "" }
 | 
					 | 
				
			||||||
-- Long lines
 | 
					 | 
				
			||||||
files["technic_cnc/cnc_api.lua"].ignore = { "" }
 | 
					 | 
				
			||||||
							
								
								
									
										4
									
								
								.mailmap
									
									
									
									
									
								
							
							
						
						@@ -1,4 +0,0 @@
 | 
				
			|||||||
RealBadAngel <maciej.kasatkin@o2.pl> <mk@realbadangel.pl>
 | 
					 | 
				
			||||||
Vanessa Ezekowitz <vanessaezekowitz@gmail.com>
 | 
					 | 
				
			||||||
Vanessa Ezekowitz <vanessaezekowitz@gmail.com> <vanessa@rainbird.(none)>
 | 
					 | 
				
			||||||
kaeza <kaeza@users.sf.net> Diego Martínez <kaeza@users.sf.net>
 | 
					 | 
				
			||||||
							
								
								
									
										16
									
								
								LICENSE.txt
									
									
									
									
									
								
							
							
						
						@@ -1,16 +0,0 @@
 | 
				
			|||||||
Minetest Mod: technic
 | 
					 | 
				
			||||||
Copyright (C) 2012-2022  RealBadAngel and contributors
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
This library is free software; you can redistribute it and/or
 | 
					 | 
				
			||||||
modify it under the terms of the GNU Lesser General Public
 | 
					 | 
				
			||||||
License as published by the Free Software Foundation; either
 | 
					 | 
				
			||||||
version 2.1 of the License, or (at your option) any later version.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
This library is distributed in the hope that it will be useful,
 | 
					 | 
				
			||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
					 | 
				
			||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 | 
					 | 
				
			||||||
Lesser General Public License for more details.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
You should have received a copy of the GNU Lesser General Public
 | 
					 | 
				
			||||||
License along with this library; if not, write to the Free Software
 | 
					 | 
				
			||||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 | 
					 | 
				
			||||||
							
								
								
									
										65
									
								
								README.md
									
									
									
									
									
								
							
							
						
						@@ -1,55 +1,22 @@
 | 
				
			|||||||
# Technic
 | 
					Technic
 | 
				
			||||||
 | 
					=======
 | 
				
			||||||
[](https://github.com/minetest-mods/technic/actions)
 | 
					 | 
				
			||||||
[](https://www.gnu.org/licenses/old-licenses/lgpl-2.0.en.html)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
This Minetest modpack adds machinery and automation procedure content to your
 | 
					 | 
				
			||||||
world. A few notable features:
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  * Electric circuits
 | 
					 | 
				
			||||||
  * Automated material processing (ores, wood, ...)
 | 
					 | 
				
			||||||
  * Extended chest functionalities
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Dependencies
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  * Minetest 5.0.0 or newer
 | 
					 | 
				
			||||||
  * [Minetest Game](https://github.com/minetest/minetest_game/)
 | 
					 | 
				
			||||||
  * [mesecons](https://github.com/minetest-mods/mesecons) -> signalling events
 | 
					 | 
				
			||||||
  * [pipeworks](https://gitlab.com/VanessaE/pipeworks/) -> automation of item transport
 | 
					 | 
				
			||||||
  * [moreores](https://github.com/minetest-mods/moreores/) -> additional ores
 | 
					 | 
				
			||||||
  * [basic_materials](https://gitlab.com/VanessaE/basic_materials) -> basic craft items
 | 
					 | 
				
			||||||
  * Supports [moretrees](https://gitlab.com/VanessaE/moretrees) -> rubber trees
 | 
					 | 
				
			||||||
  * Consult `depends.txt` or `mod.conf` of each mod for further dependency information.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## FAQ
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
The modpack is explained in the **[Manual](manual.md)** included in this repository.
 | 
					 | 
				
			||||||
Machine and tool descriptions can be found on the **[GitHub Wiki](https://github.com/minetest-mods/technic/wiki)**.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
1. My technic circuit doesn't work. No power is distributed.
 | 
					 | 
				
			||||||
    * Make sure you have a switching station connected.
 | 
					 | 
				
			||||||
2. My wires do not connect to the machines.
 | 
					 | 
				
			||||||
    * Each machine type requires its own cable type. If you do not have a
 | 
					 | 
				
			||||||
      matching circuit, consider using a "Supply Converter" for simplicity.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
For modders: **[Technic Lua API](technic/doc/api.md)**
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## License
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Unless otherwise stated, all components of this modpack are licensed under the
 | 
					 | 
				
			||||||
[LGPLv2 or later](LICENSE.txt). See also the individual mod folders for their
 | 
					 | 
				
			||||||
secondary/alternate licenses, if any.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
### Credits
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Contributors in alphabetical order:
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Credits for contributing to the project (in alphabetical order):
 | 
				
			||||||
  * kpoppel
 | 
					  * kpoppel
 | 
				
			||||||
  * Nekogloop
 | 
					  * Nekogloop
 | 
				
			||||||
  * Nore/Ekdohibs
 | 
					  * Nore/Novatux
 | 
				
			||||||
  * ShadowNinja
 | 
					  * ShadowNinja
 | 
				
			||||||
  * VanessaE
 | 
					  * VanessaE
 | 
				
			||||||
  * And many others...
 | 
					  * And many others...
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					FAQ
 | 
				
			||||||
 | 
					---
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					1. My technic circuit doesn't work.  No power is distrubuted.
 | 
				
			||||||
 | 
					  * A: Make sure you have a switching station connected.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					License
 | 
				
			||||||
 | 
					-------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See mod folders for their licences
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										3
									
								
								concrete/depends.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,3 @@
 | 
				
			|||||||
 | 
					default
 | 
				
			||||||
 | 
					intllib?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1,34 +1,61 @@
 | 
				
			|||||||
--Minetest 0.4.7 mod: concrete 
 | 
					--Minetest 0.4.7 mod: concrete 
 | 
				
			||||||
--(c) 2013 by RealBadAngel <mk@realbadangel.pl>
 | 
					--(c) 2013 by RealBadAngel <mk@realbadangel.pl>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local technic = rawget(_G, "technic") or {}
 | 
					local technic = technic or {}
 | 
				
			||||||
technic.concrete_posts = {}
 | 
					technic.concrete_posts = {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- Boilerplate to support localized strings if intllib mod is installed.
 | 
					-- Boilerplate to support localized strings if intllib mod is installed.
 | 
				
			||||||
local S = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end
 | 
					local S
 | 
				
			||||||
 | 
					if intllib then
 | 
				
			||||||
for i = 0, 31 do
 | 
						S = intllib.Getter()
 | 
				
			||||||
	minetest.register_alias("technic:concrete_post"..i,
 | 
					else
 | 
				
			||||||
			"technic:concrete_post")
 | 
						S = function(s) return s end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
for i = 32, 63 do
 | 
					
 | 
				
			||||||
	minetest.register_alias("technic:concrete_post"..i,
 | 
					minetest.register_alias("technic:concrete_post",   "technic:concrete_post0")
 | 
				
			||||||
			"technic:concrete_post_with_platform")
 | 
					minetest.register_alias("technic:concrete_post32", "technic:concrete_post12")
 | 
				
			||||||
 | 
					minetest.register_alias("technic:concrete_post33", "technic:concrete_post3")
 | 
				
			||||||
 | 
					minetest.register_alias("technic:concrete_post34", "technic:concrete_post28")
 | 
				
			||||||
 | 
					minetest.register_alias("technic:concrete_post35", "technic:concrete_post19")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local steel_ingot
 | 
				
			||||||
 | 
					if minetest.get_modpath("technic_worldgen") then
 | 
				
			||||||
 | 
						steel_ingot = "technic:carbon_steel_ingot"
 | 
				
			||||||
 | 
					else
 | 
				
			||||||
 | 
						steel_ingot = "default:steel_ingot"
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
minetest.register_craft({
 | 
					minetest.register_craft({
 | 
				
			||||||
	output = 'technic:concrete_post_platform 6',
 | 
						output = 'technic:rebar 6',
 | 
				
			||||||
	recipe = {
 | 
						recipe = {
 | 
				
			||||||
		{'technic:concrete','technic:concrete_post','technic:concrete'},
 | 
							{'','', steel_ingot},
 | 
				
			||||||
 | 
							{'',steel_ingot,''},
 | 
				
			||||||
 | 
							{steel_ingot, '', ''},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
minetest.register_craft({
 | 
					minetest.register_craft({
 | 
				
			||||||
	output = 'technic:concrete_post 12',
 | 
						output = 'technic:concrete 5',
 | 
				
			||||||
	recipe = {
 | 
						recipe = {
 | 
				
			||||||
		{'default:stone','basic_materials:steel_bar','default:stone'},
 | 
							{'default:stone','technic:rebar','default:stone'},
 | 
				
			||||||
		{'default:stone','basic_materials:steel_bar','default:stone'},
 | 
							{'technic:rebar','default:stone','technic:rebar'},
 | 
				
			||||||
		{'default:stone','basic_materials:steel_bar','default:stone'},
 | 
							{'default:stone','technic:rebar','default:stone'},
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					minetest.register_craft({
 | 
				
			||||||
 | 
						output = 'technic:concrete_post_platform 6',
 | 
				
			||||||
 | 
						recipe = {
 | 
				
			||||||
 | 
							{'technic:concrete','technic:concrete_post0','technic:concrete'},
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					minetest.register_craft({
 | 
				
			||||||
 | 
						output = 'technic:concrete_post0 12',
 | 
				
			||||||
 | 
						recipe = {
 | 
				
			||||||
 | 
							{'default:stone','technic:rebar','default:stone'},
 | 
				
			||||||
 | 
							{'default:stone','technic:rebar','default:stone'},
 | 
				
			||||||
 | 
							{'default:stone','technic:rebar','default:stone'},
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -41,44 +68,47 @@ minetest.register_craft({
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local box_platform = {-0.5,  0.3,  -0.5,  0.5,  0.5, 0.5}
 | 
				
			||||||
 | 
					local box_center   = {-0.15, -0.5, -0.15, 0.15, 0.5, 0.15}
 | 
				
			||||||
 | 
					local box_x1       = {0,     -0.3, -0.1,  0.5,  0.3, 0.1}
 | 
				
			||||||
 | 
					local box_z1       = {-0.1,  -0.3, 0,     0.1,  0.3, 0.5}
 | 
				
			||||||
 | 
					local box_x2       = {0,     -0.3, -0.1,  -0.5, 0.3, 0.1}
 | 
				
			||||||
 | 
					local box_z2       = {-0.1,  -0.3, 0,     0.1,  0.3, -0.5}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					minetest.register_craftitem(":technic:rebar", {
 | 
				
			||||||
 | 
						description = S("Rebar"),
 | 
				
			||||||
 | 
						inventory_image = "technic_rebar.png",
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					minetest.register_node(":technic:concrete", {
 | 
				
			||||||
 | 
						description = S("Concrete Block"),
 | 
				
			||||||
 | 
						tile_images = {"technic_concrete_block.png",},
 | 
				
			||||||
 | 
						groups = {cracky=1, level=2, concrete=1},
 | 
				
			||||||
 | 
						sounds = default.node_sound_stone_defaults(),
 | 
				
			||||||
 | 
						after_place_node = function(pos, placer, itemstack)
 | 
				
			||||||
 | 
							technic.update_posts(pos, false)
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
						after_dig_node = function (pos, oldnode, oldmetadata, digger)
 | 
				
			||||||
 | 
							technic.update_posts(pos, false)
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
minetest.register_node(":technic:blast_resistant_concrete", {
 | 
					minetest.register_node(":technic:blast_resistant_concrete", {
 | 
				
			||||||
	description = S("Blast-resistant Concrete Block"),
 | 
						description = S("Blast-resistant Concrete Block"),
 | 
				
			||||||
	tiles = {"technic_blast_resistant_concrete_block.png",},
 | 
						tile_images = {"technic_blast_resistant_concrete_block.png",},
 | 
				
			||||||
	groups={cracky=1, level=3, concrete=1},
 | 
						groups={cracky=1, level=3, concrete=1},
 | 
				
			||||||
	sounds = default.node_sound_stone_defaults(),
 | 
						sounds = default.node_sound_stone_defaults(),
 | 
				
			||||||
	on_blast = function(pos, intensity)
 | 
						after_place_node = function(pos, player, itemstack)
 | 
				
			||||||
		if intensity > 9 then
 | 
							technic.update_posts(pos, false)
 | 
				
			||||||
			minetest.remove_node(pos)
 | 
						end,
 | 
				
			||||||
			return {"technic:blast_resistant_concrete"}
 | 
						after_dig_node = function (pos, oldnode, oldmetadata, digger)
 | 
				
			||||||
		end
 | 
							technic.update_posts(pos, false)
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if minetest.get_modpath("moreblocks") then
 | 
					 | 
				
			||||||
	stairsplus:register_all("technic","blast_resistant_concrete","technic:blast_resistant_concrete",{
 | 
					 | 
				
			||||||
		description = "Blast-resistant Concrete",
 | 
					 | 
				
			||||||
		tiles = {"technic_blast_resistant_concrete_block.png",},
 | 
					 | 
				
			||||||
		groups = {cracky=1, level=3, concrete=1},
 | 
					 | 
				
			||||||
		sounds = default.node_sound_stone_defaults(),
 | 
					 | 
				
			||||||
		on_blast = function(pos, intensity)
 | 
					 | 
				
			||||||
			if intensity > 1 then
 | 
					 | 
				
			||||||
				minetest.remove_node(pos)
 | 
					 | 
				
			||||||
				minetest.add_item(pos, "technic:blast_resistant_concrete")
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		end,
 | 
					 | 
				
			||||||
	})
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
local box_platform = {-0.5,  0.3,  -0.5,  0.5,  0.5, 0.5}
 | 
					 | 
				
			||||||
local box_post     = {-0.15, -0.5, -0.15, 0.15, 0.5, 0.15}
 | 
					 | 
				
			||||||
local box_front    = {-0.1,  -0.3, -0.5,  0.1,  0.3, 0}
 | 
					 | 
				
			||||||
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_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", {
 | 
				
			||||||
	description = S("Concrete Post Platform"),
 | 
						description = S("Concrete Post Platform"),
 | 
				
			||||||
	tiles = {"basic_materials_concrete_block.png",},
 | 
						tile_images = {"technic_concrete_block.png",},
 | 
				
			||||||
	groups={cracky=1, level=2},
 | 
						groups={cracky=1, level=2},
 | 
				
			||||||
	sounds = default.node_sound_stone_defaults(),
 | 
						sounds = default.node_sound_stone_defaults(),
 | 
				
			||||||
	paramtype = "light",
 | 
						paramtype = "light",
 | 
				
			||||||
@@ -89,45 +119,144 @@ minetest.register_node(":technic:concrete_post_platform", {
 | 
				
			|||||||
	},
 | 
						},
 | 
				
			||||||
	on_place = function (itemstack, placer, pointed_thing)
 | 
						on_place = function (itemstack, placer, pointed_thing)
 | 
				
			||||||
		local node = minetest.get_node(pointed_thing.under)
 | 
							local node = minetest.get_node(pointed_thing.under)
 | 
				
			||||||
		if node.name ~= "technic:concrete_post" then
 | 
							if not technic.concrete_posts[node.name] then 
 | 
				
			||||||
			return minetest.item_place_node(itemstack, placer, pointed_thing) 
 | 
								return minetest.item_place_node(itemstack, placer, pointed_thing) 
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
		minetest.set_node(pointed_thing.under, {name="technic:concrete_post_with_platform"})
 | 
							local links = technic.concrete_posts[node.name]
 | 
				
			||||||
 | 
							if links[5] ~= 0 then -- The post already has a platform
 | 
				
			||||||
 | 
								return minetest.item_place_node(itemstack, placer, pointed_thing) 
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							local id = technic.get_post_id({links[1], links[2], links[3], links[4], 1})
 | 
				
			||||||
 | 
							minetest.set_node(pointed_thing.under, {name="technic:concrete_post"..id})
 | 
				
			||||||
		itemstack:take_item()
 | 
							itemstack:take_item()
 | 
				
			||||||
		placer:set_wielded_item(itemstack)
 | 
							placer:set_wielded_item(itemstack)
 | 
				
			||||||
		return itemstack
 | 
							return itemstack
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
for platform = 0, 1 do
 | 
					local function gen_post_nodebox(x1, x2, z1, z2, platform)
 | 
				
			||||||
	local after_dig_node = nil
 | 
						local box = {box_center}
 | 
				
			||||||
	if platform == 1 then
 | 
						if x1 ~= 0 then
 | 
				
			||||||
		after_dig_node = function(pos, old_node)
 | 
							table.insert(box, box_x1)
 | 
				
			||||||
			old_node.name = "technic:concrete_post"
 | 
						end
 | 
				
			||||||
			minetest.set_node(pos, old_node)
 | 
						if x2 ~= 0 then
 | 
				
			||||||
 | 
							table.insert(box, box_x2)
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if z1 ~= 0 then
 | 
				
			||||||
 | 
							table.insert(box, box_z1)
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if z2 ~= 0 then
 | 
				
			||||||
 | 
							table.insert(box, box_z2)
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if platform ~= 0 then
 | 
				
			||||||
 | 
							table.insert(box, box_platform)
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						return box
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local function dig_post_with_platform(pos, oldnode, oldmetadata)
 | 
				
			||||||
 | 
						oldnode.name = "technic:concrete_post0"
 | 
				
			||||||
 | 
						minetest.set_node(pos, oldnode)
 | 
				
			||||||
 | 
						technic.update_posts(pos, true)
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function technic.posts_should_connect(pos)
 | 
				
			||||||
 | 
						local node = minetest.get_node(pos)
 | 
				
			||||||
 | 
						if technic.concrete_posts[node.name] then
 | 
				
			||||||
 | 
							return "post"
 | 
				
			||||||
 | 
						elseif minetest.get_item_group(node.name, "concrete") ~= 0 then
 | 
				
			||||||
 | 
							return "block"
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	minetest.register_node(":technic:concrete_post"..(platform == 1 and "_with_platform" or ""), {
 | 
					function technic.get_post_id(links)
 | 
				
			||||||
 | 
						return (links[4] * 1) + (links[3] * 2)
 | 
				
			||||||
 | 
							+ (links[2] * 4) + (links[1] * 8)
 | 
				
			||||||
 | 
							+ (links[5] * 16)
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function technic.update_posts(pos, set, secondrun)
 | 
				
			||||||
 | 
						local node = minetest.get_node(pos)
 | 
				
			||||||
 | 
						local link_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,   z=pos.z+1},
 | 
				
			||||||
 | 
							{x=pos.x,   y=pos.y,   z=pos.z-1},
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						local links = {0, 0, 0, 0, 0}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						for i, link_pos in pairs(link_positions) do
 | 
				
			||||||
 | 
							local connecttype = technic.posts_should_connect(link_pos)
 | 
				
			||||||
 | 
							if connecttype then
 | 
				
			||||||
 | 
								links[i] = 1
 | 
				
			||||||
 | 
								-- Have posts next to us update theirselves,
 | 
				
			||||||
 | 
								-- but only once. (We don't want to start an
 | 
				
			||||||
 | 
								-- infinite loop of updates)
 | 
				
			||||||
 | 
								if not secondrun and connecttype == "post" then
 | 
				
			||||||
 | 
									technic.update_posts(link_pos, true, true)
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						-- We don't want to set ourselves if we have been removed or we are
 | 
				
			||||||
 | 
						-- updating a concrete node
 | 
				
			||||||
 | 
						if set then
 | 
				
			||||||
 | 
							-- Preserve platform
 | 
				
			||||||
 | 
							local oldlinks = technic.concrete_posts[node.name]
 | 
				
			||||||
 | 
							if oldlinks then
 | 
				
			||||||
 | 
								links[5] = oldlinks[5]
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							minetest.set_node(pos, {name="technic:concrete_post"
 | 
				
			||||||
 | 
									..technic.get_post_id(links)})
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					for x1 = 0, 1 do
 | 
				
			||||||
 | 
					for x2 = 0, 1 do
 | 
				
			||||||
 | 
					for z1 = 0, 1 do
 | 
				
			||||||
 | 
					for z2 = 0, 1 do
 | 
				
			||||||
 | 
					for platform = 0, 1 do
 | 
				
			||||||
 | 
						local links = {x1, x2, z1, z2, platform}
 | 
				
			||||||
 | 
						local id = technic.get_post_id(links)
 | 
				
			||||||
 | 
						technic.concrete_posts["technic:concrete_post"..id] = links
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						local groups = {cracky=1, level=2, concrete_post=1}
 | 
				
			||||||
 | 
						if id ~= 0 then
 | 
				
			||||||
 | 
							groups.not_in_creative_inventory = 1
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						local drop = "technic:concrete_post0"
 | 
				
			||||||
 | 
						local after_dig_node = function(pos, oldnode, oldmetadata, digger)
 | 
				
			||||||
 | 
							technic.update_posts(pos, false)
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if platform ~= 0 then
 | 
				
			||||||
 | 
							drop = "technic:concrete_post_platform"
 | 
				
			||||||
 | 
							after_dig_node = function(pos, oldnode, oldmetadata, digger)
 | 
				
			||||||
 | 
								dig_post_with_platform(pos, oldnode, oldmetadata)
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						minetest.register_node(":technic:concrete_post"..id, {
 | 
				
			||||||
		description = S("Concrete Post"),
 | 
							description = S("Concrete Post"),
 | 
				
			||||||
		tiles = {"basic_materials_concrete_block.png"},
 | 
							tiles = {"technic_concrete_block.png"},
 | 
				
			||||||
		groups = {cracky=1, level=2, concrete_post=1, not_in_creative_inventory=platform},
 | 
							groups = groups,
 | 
				
			||||||
		sounds = default.node_sound_stone_defaults(),
 | 
							sounds = default.node_sound_stone_defaults(),
 | 
				
			||||||
		drop = (platform == 1 and "technic:concrete_post_platform" or
 | 
							drop = drop,
 | 
				
			||||||
				"technic:concrete_post"),
 | 
					 | 
				
			||||||
		paramtype = "light",
 | 
							paramtype = "light",
 | 
				
			||||||
		sunlight_propagates = true,
 | 
							sunlight_propagates = true,
 | 
				
			||||||
		drawtype = "nodebox", 
 | 
							drawtype = "nodebox", 
 | 
				
			||||||
		connects_to = {"group:concrete", "group:concrete_post"},
 | 
					 | 
				
			||||||
		node_box = {
 | 
							node_box = {
 | 
				
			||||||
			type = "connected",
 | 
								type = "fixed",
 | 
				
			||||||
			fixed = {box_post, (platform == 1 and box_platform or nil)},
 | 
								fixed = gen_post_nodebox(x1, x2, z1, z2, platform),
 | 
				
			||||||
			connect_front = box_front,
 | 
					 | 
				
			||||||
			connect_back  = box_back,
 | 
					 | 
				
			||||||
			connect_left  = box_left,
 | 
					 | 
				
			||||||
			connect_right = box_right,
 | 
					 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
 | 
							after_place_node = function(pos, placer, itemstack)
 | 
				
			||||||
 | 
								technic.update_posts(pos, true)
 | 
				
			||||||
 | 
							end,
 | 
				
			||||||
		after_dig_node = after_dig_node,
 | 
							after_dig_node = after_dig_node,
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,8 +0,0 @@
 | 
				
			|||||||
# technic_concrete traducido por Carlos Barraza
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Rebar = Barra de refuerzo
 | 
					 | 
				
			||||||
Concrete Block = Bloque de concreto
 | 
					 | 
				
			||||||
Blast-resistant Concrete Block = Bloque de concreto resistente a explosiones
 | 
					 | 
				
			||||||
Concrete Post Platform = Plataforma de concreto
 | 
					 | 
				
			||||||
Concrete Post = Postes de concreto
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@@ -1,7 +0,0 @@
 | 
				
			|||||||
# technic_concrete translation template
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Rebar                           = Armature
 | 
					 | 
				
			||||||
Concrete Block                  = Bloc de béton
 | 
					 | 
				
			||||||
Blast-resistant Concrete Block  = Bloc de béton anti explosions
 | 
					 | 
				
			||||||
Concrete Post Platform          = Plateforme en béton
 | 
					 | 
				
			||||||
Concrete Post                   = Pilier en béton
 | 
					 | 
				
			||||||
@@ -1,10 +0,0 @@
 | 
				
			|||||||
# Polish Translation for technic_concrete
 | 
					 | 
				
			||||||
# Polskie tłumaczenie technic_concrete
 | 
					 | 
				
			||||||
# by mat9117
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Rebar = Pręt zbrojeniowy
 | 
					 | 
				
			||||||
Concrete Block = Blok betonu
 | 
					 | 
				
			||||||
Blast-resistant Concrete Block = Przeciwwybuchowy blok betonu
 | 
					 | 
				
			||||||
Concrete Post Platform = Betonowa platforma
 | 
					 | 
				
			||||||
Concrete Post = Betonowy słup
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@@ -1,10 +0,0 @@
 | 
				
			|||||||
# Braziliam portuguese translation for technic_concrete
 | 
					 | 
				
			||||||
# Tradução portuguesa brasileira para technic_concrete
 | 
					 | 
				
			||||||
# By Sires
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Rebar = Vergalhão
 | 
					 | 
				
			||||||
Concrete Block = Bloco de Concreto
 | 
					 | 
				
			||||||
Blast-resistant Concrete Block = Bloco de Concreto resistente-a-explosões
 | 
					 | 
				
			||||||
Concrete Post Platform = Plataforma para Poste de Concreto
 | 
					 | 
				
			||||||
Concrete Post = Poste de Concreto
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@@ -1,7 +0,0 @@
 | 
				
			|||||||
# turkish translation by mahmutelmas06
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Rebar = Beton demiri
 | 
					 | 
				
			||||||
Concrete Block = Beton blok
 | 
					 | 
				
			||||||
Blast-resistant Concrete Block = Patlamaya dayanıklı beton blok
 | 
					 | 
				
			||||||
Concrete Post Platform = Beton direk platformu
 | 
					 | 
				
			||||||
Concrete Post = Beton direk
 | 
					 | 
				
			||||||
@@ -1,3 +0,0 @@
 | 
				
			|||||||
name = concrete
 | 
					 | 
				
			||||||
depends = default
 | 
					 | 
				
			||||||
optional_depends = basic_materials, intllib, moreblocks
 | 
					 | 
				
			||||||
| 
		 Before Width: | Height: | Size: 214 B After Width: | Height: | Size: 311 B  | 
							
								
								
									
										
											BIN
										
									
								
								concrete/textures/technic_concrete_block.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 500 B  | 
							
								
								
									
										
											BIN
										
									
								
								concrete/textures/technic_rebar.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 813 B  | 
| 
		 Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 2.3 KiB  | 
| 
		 Before Width: | Height: | Size: 583 B After Width: | Height: | Size: 813 B  | 
							
								
								
									
										6
									
								
								extranodes/depends.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,6 @@
 | 
				
			|||||||
 | 
					default
 | 
				
			||||||
 | 
					moreblocks
 | 
				
			||||||
 | 
					technic_worldgen
 | 
				
			||||||
 | 
					concrete
 | 
				
			||||||
 | 
					intllib?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1,320 +1,86 @@
 | 
				
			|||||||
-- Minetest 0.4.6 mod: extranodes
 | 
					-- Minetest 0.4.6 mod: extranodes
 | 
				
			||||||
-- namespace: technic
 | 
					-- namespace: technic
 | 
				
			||||||
-- Boilerplate to support localized strings if intllib mod is installed.
 | 
					-- Boilerplate to support localized strings if intllib mod is installed.
 | 
				
			||||||
local S = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end
 | 
					local S
 | 
				
			||||||
 | 
					if intllib then
 | 
				
			||||||
 | 
						S = intllib.Getter()
 | 
				
			||||||
 | 
					else
 | 
				
			||||||
 | 
						S = function(s) return s end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					--register stairslike nodes 
 | 
				
			||||||
 | 
					register_stair_slab_panel_micro("technic", "marble", "technic:marble",
 | 
				
			||||||
 | 
						{cracky=2, not_in_creative_inventory=1},
 | 
				
			||||||
 | 
						{"technic_marble.png"},
 | 
				
			||||||
 | 
						S("Marble"),
 | 
				
			||||||
 | 
						"marble",
 | 
				
			||||||
 | 
						"facedir",
 | 
				
			||||||
 | 
						0)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if minetest.get_modpath("moreblocks") then
 | 
					register_stair_slab_panel_micro("technic", "marble_bricks", "technic:marble_bricks",
 | 
				
			||||||
 | 
						{cracky=2, not_in_creative_inventory=1},
 | 
				
			||||||
 | 
						{"technic_marble_bricks.png"},
 | 
				
			||||||
 | 
						S("Marble Bricks"),
 | 
				
			||||||
 | 
						"marble_bricks",
 | 
				
			||||||
 | 
						"facedir",
 | 
				
			||||||
 | 
						0)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	-- register stairsplus/circular_saw nodes
 | 
					register_stair_slab_panel_micro("technic", "granite", "technic:granite",
 | 
				
			||||||
	-- we skip blast resistant concrete and uranium intentionally
 | 
						{cracky=3, not_in_creative_inventory=1},
 | 
				
			||||||
	-- chrome seems to be too hard of a metal to be actually sawable
 | 
						{"technic_granite.png"},
 | 
				
			||||||
 | 
						S("Granite"),
 | 
				
			||||||
 | 
						"granite",
 | 
				
			||||||
 | 
						"facedir",
 | 
				
			||||||
 | 
						0)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	stairsplus:register_all("technic", "marble", "technic:marble", {
 | 
					register_stair_slab_panel_micro("technic", "concrete", "technic:concrete",
 | 
				
			||||||
		description=S("Marble"),
 | 
						{cracky=3, not_in_creative_inventory=1},
 | 
				
			||||||
		groups={cracky=3, not_in_creative_inventory=1},
 | 
						{"technic_concrete_block.png"},
 | 
				
			||||||
		tiles={"technic_marble.png"},
 | 
						S("Concrete"),
 | 
				
			||||||
	})
 | 
						"concrete",
 | 
				
			||||||
 | 
						"facedir",
 | 
				
			||||||
 | 
						0)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	stairsplus:register_all("technic", "marble_bricks", "technic:marble_bricks", {
 | 
					--register nodes in circular saw if aviable
 | 
				
			||||||
		description=S("Marble Bricks"),
 | 
					if circular_saw then 
 | 
				
			||||||
		groups={cracky=3, not_in_creative_inventory=1},
 | 
						for i,v in ipairs({"concrete",  "marble",  "marble_bricks",  "granite",  "default:obsidian"}) do
 | 
				
			||||||
		tiles={"technic_marble_bricks.png"},
 | 
							table.insert(circular_saw.known_stairs, "technic:" ..v);
 | 
				
			||||||
	})
 | 
						end
 | 
				
			||||||
 | 
					 | 
				
			||||||
	stairsplus:register_all("technic", "granite", "technic:granite", {
 | 
					 | 
				
			||||||
		description=S("Granite"),
 | 
					 | 
				
			||||||
		groups={cracky=1, not_in_creative_inventory=1},
 | 
					 | 
				
			||||||
		tiles={"technic_granite.png"},
 | 
					 | 
				
			||||||
	})
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	stairsplus:register_all("technic", "concrete", "technic:concrete", {
 | 
					 | 
				
			||||||
		description=S("Concrete"),
 | 
					 | 
				
			||||||
		groups={cracky=3, not_in_creative_inventory=1},
 | 
					 | 
				
			||||||
		tiles={"basic_materials_concrete_block.png"},
 | 
					 | 
				
			||||||
	})
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	stairsplus:register_all("technic", "zinc_block", "technic:zinc_block", {
 | 
					 | 
				
			||||||
		description=S("Zinc Block"),
 | 
					 | 
				
			||||||
		groups={cracky=1, not_in_creative_inventory=1},
 | 
					 | 
				
			||||||
		tiles={"technic_zinc_block.png"},
 | 
					 | 
				
			||||||
	})
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	stairsplus:register_all("technic", "cast_iron_block", "technic:cast_iron_block", {
 | 
					 | 
				
			||||||
		description=S("Cast Iron Block"),
 | 
					 | 
				
			||||||
		groups={cracky=1, not_in_creative_inventory=1},
 | 
					 | 
				
			||||||
		tiles={"technic_cast_iron_block.png"},
 | 
					 | 
				
			||||||
	})
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	stairsplus:register_all("technic", "carbon_steel_block", "technic:carbon_steel_block", {
 | 
					 | 
				
			||||||
		description=S("Carbon Steel Block"),
 | 
					 | 
				
			||||||
		groups={cracky=1, not_in_creative_inventory=1},
 | 
					 | 
				
			||||||
		tiles={"technic_carbon_steel_block.png"},
 | 
					 | 
				
			||||||
	})
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	stairsplus:register_all("technic", "stainless_steel_block", "technic:stainless_steel_block", {
 | 
					 | 
				
			||||||
		description=S("Stainless Steel Block"),
 | 
					 | 
				
			||||||
		groups={cracky=1, not_in_creative_inventory=1},
 | 
					 | 
				
			||||||
		tiles={"technic_stainless_steel_block.png"},
 | 
					 | 
				
			||||||
	})
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	function register_technic_stairs_alias(origmod, origname, newmod, newname)
 | 
					 | 
				
			||||||
		local func = minetest.register_alias
 | 
					 | 
				
			||||||
		local function remap(kind, suffix)
 | 
					 | 
				
			||||||
			-- Old: stairsplus:slab_concrete_wall
 | 
					 | 
				
			||||||
			-- New:    technic:slab_concrete_wall
 | 
					 | 
				
			||||||
			func(("%s:%s_%s%s"):format(origmod, kind, origname, suffix),
 | 
					 | 
				
			||||||
				("%s:%s_%s%s"):format(newmod, kind, newname, suffix))
 | 
					 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		-- Slabs
 | 
					 | 
				
			||||||
		remap("slab", "")
 | 
					 | 
				
			||||||
		remap("slab", "_inverted")
 | 
					 | 
				
			||||||
		remap("slab", "_wall")
 | 
					 | 
				
			||||||
		remap("slab", "_quarter")
 | 
					 | 
				
			||||||
		remap("slab", "_quarter_inverted")
 | 
					 | 
				
			||||||
		remap("slab", "_quarter_wall")
 | 
					 | 
				
			||||||
		remap("slab", "_three_quarter")
 | 
					 | 
				
			||||||
		remap("slab", "_three_quarter_inverted")
 | 
					 | 
				
			||||||
		remap("slab", "_three_quarter_wall")
 | 
					 | 
				
			||||||
 
 | 
					 
 | 
				
			||||||
		-- Stairs
 | 
					function register_technic_stairs_alias(modname, origname, newmod, newname)
 | 
				
			||||||
		remap("stair", "")
 | 
						minetest.register_alias(modname .. ":slab_" .. origname, newmod..":slab_" .. newname)
 | 
				
			||||||
		remap("stair", "_inverted")
 | 
						minetest.register_alias(modname .. ":slab_" .. origname .. "_inverted", newmod..":slab_" .. newname .. "_inverted")
 | 
				
			||||||
		remap("stair", "_wall")
 | 
						minetest.register_alias(modname .. ":slab_" .. origname .. "_wall", newmod..":slab_" .. newname .. "_wall")
 | 
				
			||||||
		remap("stair", "_wall_half")
 | 
						minetest.register_alias(modname .. ":slab_" .. origname .. "_quarter", newmod..":slab_" .. newname .. "_quarter")
 | 
				
			||||||
		remap("stair", "_wall_half_inverted")
 | 
						minetest.register_alias(modname .. ":slab_" .. origname .. "_quarter_inverted", newmod..":slab_" .. newname .. "_quarter_inverted")
 | 
				
			||||||
		remap("stair", "_half")
 | 
						minetest.register_alias(modname .. ":slab_" .. origname .. "_quarter_wall", newmod..":slab_" .. newname .. "_quarter_wall")
 | 
				
			||||||
		remap("stair", "_half_inverted")
 | 
						minetest.register_alias(modname .. ":slab_" .. origname .. "_three_quarter", newmod..":slab_" .. newname .. "_three_quarter")
 | 
				
			||||||
		remap("stair", "_right_half")
 | 
						minetest.register_alias(modname .. ":slab_" .. origname .. "_three_quarter_inverted", newmod..":slab_" .. newname .. "_three_quarter_inverted")
 | 
				
			||||||
		remap("stair", "_right_half_inverted")
 | 
						minetest.register_alias(modname .. ":slab_" .. origname .. "_three_quarter_wall", newmod..":slab_" .. newname .. "_three_quarter_wall")
 | 
				
			||||||
		remap("stair", "_inner")
 | 
						minetest.register_alias(modname .. ":stair_" .. origname, newmod..":stair_" .. newname)
 | 
				
			||||||
		remap("stair", "_inner_inverted")
 | 
						minetest.register_alias(modname .. ":stair_" .. origname .. "_inverted", newmod..":stair_" .. newname .. "_inverted")
 | 
				
			||||||
		remap("stair", "_outer")
 | 
						minetest.register_alias(modname .. ":stair_" .. origname .. "_wall", newmod..":stair_" .. newname .. "_wall")
 | 
				
			||||||
		remap("stair", "_outer_inverted")
 | 
						minetest.register_alias(modname .. ":stair_" .. origname .. "_wall_half", newmod..":stair_" .. newname .. "_wall_half")
 | 
				
			||||||
 | 
						minetest.register_alias(modname .. ":stair_" .. origname .. "_wall_half_inverted", newmod..":stair_" .. newname .. "_wall_half_inverted")
 | 
				
			||||||
		-- Other
 | 
						minetest.register_alias(modname .. ":stair_" .. origname .. "_half", newmod..":stair_" .. newname .. "_half")
 | 
				
			||||||
		remap("panel", "_bottom")
 | 
						minetest.register_alias(modname .. ":stair_" .. origname .. "_half_inverted", newmod..":stair_" .. newname .. "_half_inverted")
 | 
				
			||||||
		remap("panel", "_top")
 | 
						minetest.register_alias(modname .. ":stair_" .. origname .. "_right_half", newmod..":stair_" .. newname .. "_right_half")
 | 
				
			||||||
		remap("panel", "_vertical")
 | 
						minetest.register_alias(modname .. ":stair_" .. origname .. "_right_half_inverted", newmod..":stair_" .. newname .. "_right_half_inverted")
 | 
				
			||||||
		remap("micro", "_bottom")
 | 
						minetest.register_alias(modname .. ":stair_" .. origname .. "_wall_half", newmod..":stair_" .. newname .. "_wall_half")
 | 
				
			||||||
		remap("micro", "_top")
 | 
						minetest.register_alias(modname .. ":stair_" .. origname .. "_wall_half_inverted", newmod..":stair_" .. newname .. "_wall_half_inverted")
 | 
				
			||||||
 | 
						minetest.register_alias(modname .. ":stair_" .. origname .. "_inner", newmod..":stair_" .. newname .. "_inner")
 | 
				
			||||||
 | 
						minetest.register_alias(modname .. ":stair_" .. origname .. "_inner_inverted", newmod..":stair_" .. newname .. "_inner_inverted")
 | 
				
			||||||
 | 
						minetest.register_alias(modname .. ":stair_" .. origname .. "_outer", newmod..":stair_" .. newname .. "_outer")
 | 
				
			||||||
 | 
						minetest.register_alias(modname .. ":stair_" .. origname .. "_outer_inverted", newmod..":stair_" .. newname .. "_outer_inverted")
 | 
				
			||||||
 | 
						minetest.register_alias(modname .. ":panel_" .. origname .. "_bottom", newmod..":panel_" .. newname .. "_bottom")
 | 
				
			||||||
 | 
						minetest.register_alias(modname .. ":panel_" .. origname .. "_top", newmod..":panel_" .. newname .. "_top")
 | 
				
			||||||
 | 
						minetest.register_alias(modname .. ":panel_" .. origname .. "_vertical", newmod..":panel_" .. newname .. "_vertical")
 | 
				
			||||||
 | 
						minetest.register_alias(modname .. ":micro_" .. origname .. "_bottom", newmod..":micro_" .. newname .. "_bottom")
 | 
				
			||||||
 | 
						minetest.register_alias(modname .. ":micro_" .. origname .. "_top", newmod..":micro_" .. newname .. "_top")
 | 
				
			||||||
end 
 | 
					end 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
register_technic_stairs_alias("stairsplus", "concrete", "technic", "concrete")
 | 
					register_technic_stairs_alias("stairsplus", "concrete", "technic", "concrete")
 | 
				
			||||||
register_technic_stairs_alias("stairsplus", "marble", "technic", "marble")
 | 
					register_technic_stairs_alias("stairsplus", "marble", "technic", "marble")
 | 
				
			||||||
register_technic_stairs_alias("stairsplus", "granite", "technic", "granite")
 | 
					register_technic_stairs_alias("stairsplus", "granite", "technic", "granite")
 | 
				
			||||||
register_technic_stairs_alias("stairsplus", "marble_bricks", "technic", "marble_bricks")
 | 
					register_technic_stairs_alias("stairsplus", "marble_bricks", "technic", "marble_bricks")
 | 
				
			||||||
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
local iclip_def = {
 | 
					 | 
				
			||||||
	description = S("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 = S("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(),
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
local sclip_tex = {
 | 
					 | 
				
			||||||
	"technic_insulator_clip.png",
 | 
					 | 
				
			||||||
	{ name = "strut.png^technic_steel_strut_overlay.png", color = "white" },
 | 
					 | 
				
			||||||
	{ name = "strut.png", color = "white" }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
local streetsmod = minetest.get_modpath("streets") or minetest.get_modpath ("steelsupport")
 | 
					 | 
				
			||||||
-- cheapie's fork breaks it into several individual mods, with differernt names for the same content.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
if streetsmod then
 | 
					 | 
				
			||||||
	sclip_tex = {
 | 
					 | 
				
			||||||
		"technic_insulator_clip.png",
 | 
					 | 
				
			||||||
		{ name = "streets_support.png^technic_steel_strut_overlay.png", color = "white" },
 | 
					 | 
				
			||||||
		{ name = "streets_support.png", color = "white" }
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
local sclip_def = {
 | 
					 | 
				
			||||||
	description = S("Steel strut with insulator/cable clip"),
 | 
					 | 
				
			||||||
	drawtype = "mesh",
 | 
					 | 
				
			||||||
	mesh = "technic_steel_strut_with_insulator_clip.obj",
 | 
					 | 
				
			||||||
	tiles = sclip_tex,
 | 
					 | 
				
			||||||
	paramtype = "light",
 | 
					 | 
				
			||||||
	paramtype2 = "wallmounted",
 | 
					 | 
				
			||||||
	is_ground_content = false,
 | 
					 | 
				
			||||||
	sounds = default.node_sound_stone_defaults(),
 | 
					 | 
				
			||||||
	groups = { choppy=1, cracky=1 },
 | 
					 | 
				
			||||||
	backface_culling = false
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
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)
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	iclip_def.groups = {choppy=1, snappy=1, oddly_breakable_by_hand=1, ud_param2_colorable = 1}
 | 
					 | 
				
			||||||
	iclip_def.on_dig = unifieddyes.on_dig
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	iclipfence_def.paramtype2 = "color"
 | 
					 | 
				
			||||||
	iclipfence_def.palette = "unifieddyes_palette_extended.png"
 | 
					 | 
				
			||||||
	iclipfence_def.on_construct = unifieddyes.on_construct
 | 
					 | 
				
			||||||
	iclipfence_def.groups = {fence=1, choppy=1, snappy=1, oddly_breakable_by_hand=1, ud_param2_colorable = 1}
 | 
					 | 
				
			||||||
	iclipfence_def.on_dig = unifieddyes.on_dig
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	sclip_def.paramtype2 = "colorwallmounted"
 | 
					 | 
				
			||||||
	sclip_def.palette = "unifieddyes_palette_colorwallmounted.png"
 | 
					 | 
				
			||||||
	sclip_def.after_place_node = function(pos, placer, itemstack, pointed_thing)
 | 
					 | 
				
			||||||
		unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing)
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	sclip_def.on_dig = unifieddyes.on_dig
 | 
					 | 
				
			||||||
	sclip_def.groups = {choppy=1, cracky=1, ud_param2_colorable = 1}
 | 
					 | 
				
			||||||
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"},
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
})
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
local steelmod = minetest.get_modpath("steel")
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
if streetsmod or steelmod then
 | 
					 | 
				
			||||||
	minetest.register_node(":technic:steel_strut_with_insulator_clip", sclip_def)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if steelmod then
 | 
					 | 
				
			||||||
		minetest.register_craft({
 | 
					 | 
				
			||||||
			output = "technic:steel_strut_with_insulator_clip",
 | 
					 | 
				
			||||||
			recipe = {
 | 
					 | 
				
			||||||
				{"technic:insulator_clip_fencepost"},
 | 
					 | 
				
			||||||
				{"steel:strut_mount"}
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		})
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		minetest.register_craft({
 | 
					 | 
				
			||||||
			output = "technic:steel_strut_with_insulator_clip",
 | 
					 | 
				
			||||||
			recipe = {
 | 
					 | 
				
			||||||
				{"technic:insulator_clip_fencepost", ""                    },
 | 
					 | 
				
			||||||
				{"steel:strut",                      "default:steel_ingot" },
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		})
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	elseif streetsmod then
 | 
					 | 
				
			||||||
		minetest.register_craft({
 | 
					 | 
				
			||||||
			output = "technic:steel_strut_with_insulator_clip",
 | 
					 | 
				
			||||||
			recipe = {
 | 
					 | 
				
			||||||
				{"technic:insulator_clip_fencepost", ""                   },
 | 
					 | 
				
			||||||
				{"streets:steel_support",           "default:steel_ingot" },
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		})
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
if minetest.get_modpath("unifieddyes") then
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	unifieddyes.register_color_craft({
 | 
					 | 
				
			||||||
		output = "technic:insulator_clip_fencepost",
 | 
					 | 
				
			||||||
		palette = "extended",
 | 
					 | 
				
			||||||
		type = "shapeless",
 | 
					 | 
				
			||||||
		neutral_node = "technic:insulator_clip_fencepost",
 | 
					 | 
				
			||||||
		recipe = {
 | 
					 | 
				
			||||||
			"NEUTRAL_NODE",
 | 
					 | 
				
			||||||
			"MAIN_DYE"
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	})
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	unifieddyes.register_color_craft({
 | 
					 | 
				
			||||||
		output = "technic:insulator_clip",
 | 
					 | 
				
			||||||
		palette = "wallmounted",
 | 
					 | 
				
			||||||
		type = "shapeless",
 | 
					 | 
				
			||||||
		neutral_node = "technic:insulator_clip",
 | 
					 | 
				
			||||||
		recipe = {
 | 
					 | 
				
			||||||
			"NEUTRAL_NODE",
 | 
					 | 
				
			||||||
			"MAIN_DYE"
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	})
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	unifieddyes.register_color_craft({
 | 
					 | 
				
			||||||
		output = "technic:steel_strut_with_insulator_clip",
 | 
					 | 
				
			||||||
		palette = "wallmounted",
 | 
					 | 
				
			||||||
		type = "shapeless",
 | 
					 | 
				
			||||||
		neutral_node = "",
 | 
					 | 
				
			||||||
		recipe = {
 | 
					 | 
				
			||||||
			"technic:steel_strut_with_insulator_clip",
 | 
					 | 
				
			||||||
			"MAIN_DYE"
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	})
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if steelmod then
 | 
					 | 
				
			||||||
		unifieddyes.register_color_craft({
 | 
					 | 
				
			||||||
			output = "technic:steel_strut_with_insulator_clip",
 | 
					 | 
				
			||||||
			palette = "wallmounted",
 | 
					 | 
				
			||||||
			neutral_node = "",
 | 
					 | 
				
			||||||
			recipe = {
 | 
					 | 
				
			||||||
				{ "technic:insulator_clip_fencepost", "MAIN_DYE" },
 | 
					 | 
				
			||||||
				{ "steel:strut_mount",                ""         },
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		})
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if streetsmod then
 | 
					 | 
				
			||||||
		unifieddyes.register_color_craft({
 | 
					 | 
				
			||||||
			output = "technic:steel_strut_with_insulator_clip",
 | 
					 | 
				
			||||||
			palette = "wallmounted",
 | 
					 | 
				
			||||||
			neutral_node = "technic:steel_strut_with_insulator_clip",
 | 
					 | 
				
			||||||
			recipe = {
 | 
					 | 
				
			||||||
				{ "technic:insulator_clip_fencepost", "MAIN_DYE"            },
 | 
					 | 
				
			||||||
				{ "streets:steel_support",            "default:steel_ingot" },
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		})
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +0,0 @@
 | 
				
			|||||||
# technic_extranodes traducido por Carlos Barraza
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Marble = Mármol
 | 
					 | 
				
			||||||
Marble Bricks = Ladrillos de mármol
 | 
					 | 
				
			||||||
Granite = Granito
 | 
					 | 
				
			||||||
Concrete = Concreto
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@@ -1,7 +0,0 @@
 | 
				
			|||||||
# technic_extranodes translation template
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Marble          = Marbre
 | 
					 | 
				
			||||||
Marble Bricks   = Briques en marbre
 | 
					 | 
				
			||||||
Granite         = Granite
 | 
					 | 
				
			||||||
Concrete        = Béton
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@@ -1,9 +0,0 @@
 | 
				
			|||||||
# Polish Translation for technic_extranodes
 | 
					 | 
				
			||||||
# Polskie tłumaczenie technic_extranodes
 | 
					 | 
				
			||||||
# by mat9117
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Marble = Marmur
 | 
					 | 
				
			||||||
Marble Bricks = Marmurowe cegły
 | 
					 | 
				
			||||||
Granite = Granit
 | 
					 | 
				
			||||||
Concrete = Beton
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@@ -1,9 +0,0 @@
 | 
				
			|||||||
# Braziliam portuguese translation for technic_extranodes
 | 
					 | 
				
			||||||
# Tradução portuguesa brasileira para technic_extranodes
 | 
					 | 
				
			||||||
# By Sires
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Marble = Mármore
 | 
					 | 
				
			||||||
Marble Bricks = Tijolos de Mármore
 | 
					 | 
				
			||||||
Granite = Granito
 | 
					 | 
				
			||||||
Concrete = Concreto
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@@ -1,6 +0,0 @@
 | 
				
			|||||||
# turkish translation by mahmutelmas06
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Marble = Mermer
 | 
					 | 
				
			||||||
Marble Bricks = Mermer tuğla
 | 
					 | 
				
			||||||
Granite = Granit
 | 
					 | 
				
			||||||
Concrete = Beton
 | 
					 | 
				
			||||||
@@ -1,3 +0,0 @@
 | 
				
			|||||||
name = extranodes
 | 
					 | 
				
			||||||
depends = default, technic_worldgen, basic_materials, concrete
 | 
					 | 
				
			||||||
optional_depends = unifieddyes, intllib, moreblocks, steel, streetsmod
 | 
					 | 
				
			||||||
@@ -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
 | 
					 | 
				
			||||||
@@ -1,246 +0,0 @@
 | 
				
			|||||||
# Blender v2.79 (sub 0) OBJ File: 'technic steel strut with insulator clip.blend'
 | 
					 | 
				
			||||||
# www.blender.org
 | 
					 | 
				
			||||||
o Cube_Cube_Material.001
 | 
					 | 
				
			||||||
v -0.375000 0.500532 -0.250000
 | 
					 | 
				
			||||||
v -0.249997 0.562500 -0.249997
 | 
					 | 
				
			||||||
v 0.249997 0.562500 -0.249997
 | 
					 | 
				
			||||||
v 0.375000 0.500532 -0.250000
 | 
					 | 
				
			||||||
v 0.249997 0.562500 0.249997
 | 
					 | 
				
			||||||
v 0.375000 0.500532 0.250000
 | 
					 | 
				
			||||||
v -0.249997 0.562500 0.249997
 | 
					 | 
				
			||||||
v -0.375000 0.500532 0.250000
 | 
					 | 
				
			||||||
v 0.187500 0.562500 -0.187500
 | 
					 | 
				
			||||||
v -0.168668 0.718750 0.168668
 | 
					 | 
				
			||||||
v 0.168668 0.718750 0.168668
 | 
					 | 
				
			||||||
v 0.187500 0.750000 0.187500
 | 
					 | 
				
			||||||
v -0.187500 0.750000 0.187500
 | 
					 | 
				
			||||||
v 0.168668 0.718750 -0.168668
 | 
					 | 
				
			||||||
v 0.187500 0.750000 -0.187500
 | 
					 | 
				
			||||||
v -0.168668 0.718750 -0.168668
 | 
					 | 
				
			||||||
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 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.250000 0.750000 0.250000
 | 
					 | 
				
			||||||
v -0.168668 0.593750 0.168668
 | 
					 | 
				
			||||||
v 0.168668 0.593750 0.168668
 | 
					 | 
				
			||||||
v 0.187500 0.625000 0.187500
 | 
					 | 
				
			||||||
v -0.187500 0.625000 0.187500
 | 
					 | 
				
			||||||
v 0.168668 0.593750 -0.168668
 | 
					 | 
				
			||||||
v 0.187500 0.625000 -0.187500
 | 
					 | 
				
			||||||
v -0.168668 0.593750 -0.168668
 | 
					 | 
				
			||||||
v -0.187500 0.625000 -0.187500
 | 
					 | 
				
			||||||
v -0.168668 0.656250 0.168668
 | 
					 | 
				
			||||||
v 0.168668 0.656250 0.168668
 | 
					 | 
				
			||||||
v 0.187500 0.687500 0.187500
 | 
					 | 
				
			||||||
v -0.187500 0.687500 0.187500
 | 
					 | 
				
			||||||
v 0.168668 0.656250 -0.168668
 | 
					 | 
				
			||||||
v 0.187500 0.687500 -0.187500
 | 
					 | 
				
			||||||
v -0.168668 0.656250 -0.168668
 | 
					 | 
				
			||||||
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.562500 -0.187500
 | 
					 | 
				
			||||||
v -0.499468 -0.499468 -0.499468
 | 
					 | 
				
			||||||
v -0.499468 0.500000 -0.499468
 | 
					 | 
				
			||||||
v 0.499468 -0.499468 -0.499468
 | 
					 | 
				
			||||||
v -0.499468 -0.499468 0.499468
 | 
					 | 
				
			||||||
v -0.499468 0.500000 0.499468
 | 
					 | 
				
			||||||
v 0.499468 -0.499468 0.499468
 | 
					 | 
				
			||||||
v 0.499468 0.500000 -0.499468
 | 
					 | 
				
			||||||
v 0.499468 0.500000 0.499468
 | 
					 | 
				
			||||||
vt 1.000000 0.875000
 | 
					 | 
				
			||||||
vt 0.937500 0.750000
 | 
					 | 
				
			||||||
vt 0.937500 0.250000
 | 
					 | 
				
			||||||
vt 1.000000 0.125000
 | 
					 | 
				
			||||||
vt 0.250000 0.875000
 | 
					 | 
				
			||||||
vt 0.250000 0.750000
 | 
					 | 
				
			||||||
vt 0.750000 0.750000
 | 
					 | 
				
			||||||
vt 0.750000 0.875000
 | 
					 | 
				
			||||||
vt 0.000000 0.125000
 | 
					 | 
				
			||||||
vt 0.062500 0.250000
 | 
					 | 
				
			||||||
vt 0.062500 0.750000
 | 
					 | 
				
			||||||
vt 0.000000 0.875000
 | 
					 | 
				
			||||||
vt 0.750000 0.250000
 | 
					 | 
				
			||||||
vt 0.687500 0.687500
 | 
					 | 
				
			||||||
vt 0.687500 0.312500
 | 
					 | 
				
			||||||
vt 0.312500 0.687500
 | 
					 | 
				
			||||||
vt 0.250000 0.250000
 | 
					 | 
				
			||||||
vt 0.312500 0.312500
 | 
					 | 
				
			||||||
vt 0.331332 1.218750
 | 
					 | 
				
			||||||
vt 0.668668 1.218750
 | 
					 | 
				
			||||||
vt 0.687500 1.250000
 | 
					 | 
				
			||||||
vt 0.312500 1.250000
 | 
					 | 
				
			||||||
vt 0.531250 0.666667
 | 
					 | 
				
			||||||
vt 0.531250 0.333333
 | 
					 | 
				
			||||||
vt 0.500000 0.312500
 | 
					 | 
				
			||||||
vt 0.500000 0.687500
 | 
					 | 
				
			||||||
vt 0.531250 0.333333
 | 
					 | 
				
			||||||
vt 0.531250 0.666667
 | 
					 | 
				
			||||||
vt 0.500000 0.687500
 | 
					 | 
				
			||||||
vt 0.500000 0.312500
 | 
					 | 
				
			||||||
vt 0.331332 1.218750
 | 
					 | 
				
			||||||
vt 0.668668 1.218750
 | 
					 | 
				
			||||||
vt 0.687500 1.250000
 | 
					 | 
				
			||||||
vt 0.312500 1.250000
 | 
					 | 
				
			||||||
vt 0.687500 0.312500
 | 
					 | 
				
			||||||
vt 0.750000 0.250000
 | 
					 | 
				
			||||||
vt 0.750000 0.750000
 | 
					 | 
				
			||||||
vt 0.687500 0.687500
 | 
					 | 
				
			||||||
vt 0.500000 0.250000
 | 
					 | 
				
			||||||
vt 0.500000 0.750000
 | 
					 | 
				
			||||||
vt 0.000000 0.750000
 | 
					 | 
				
			||||||
vt 0.000000 0.250000
 | 
					 | 
				
			||||||
vt 0.500000 0.250000
 | 
					 | 
				
			||||||
vt 0.000000 0.250000
 | 
					 | 
				
			||||||
vt 0.000000 0.750000
 | 
					 | 
				
			||||||
vt 0.500000 0.750000
 | 
					 | 
				
			||||||
vt 0.500000 0.250000
 | 
					 | 
				
			||||||
vt 0.500000 0.750000
 | 
					 | 
				
			||||||
vt 0.000000 0.750000
 | 
					 | 
				
			||||||
vt 0.000000 0.250000
 | 
					 | 
				
			||||||
vt 0.000000 0.250000
 | 
					 | 
				
			||||||
vt 0.500000 0.750000
 | 
					 | 
				
			||||||
vt 0.250000 0.250000
 | 
					 | 
				
			||||||
vt 0.750000 0.250000
 | 
					 | 
				
			||||||
vt 0.750000 0.750000
 | 
					 | 
				
			||||||
vt 0.250000 0.750000
 | 
					 | 
				
			||||||
vt 0.250000 0.750000
 | 
					 | 
				
			||||||
vt 0.312500 0.687500
 | 
					 | 
				
			||||||
vt 0.250000 0.250000
 | 
					 | 
				
			||||||
vt 0.312500 0.312500
 | 
					 | 
				
			||||||
vt 0.250000 0.125000
 | 
					 | 
				
			||||||
vt 0.750000 0.125000
 | 
					 | 
				
			||||||
vt 0.331332 1.093750
 | 
					 | 
				
			||||||
vt 0.668668 1.093750
 | 
					 | 
				
			||||||
vt 0.687500 1.125000
 | 
					 | 
				
			||||||
vt 0.312500 1.125000
 | 
					 | 
				
			||||||
vt 0.656250 0.666667
 | 
					 | 
				
			||||||
vt 0.656250 0.333333
 | 
					 | 
				
			||||||
vt 0.625000 0.312500
 | 
					 | 
				
			||||||
vt 0.625000 0.687500
 | 
					 | 
				
			||||||
vt 0.656250 0.333333
 | 
					 | 
				
			||||||
vt 0.656250 0.666667
 | 
					 | 
				
			||||||
vt 0.625000 0.687500
 | 
					 | 
				
			||||||
vt 0.625000 0.312500
 | 
					 | 
				
			||||||
vt 0.331332 1.093750
 | 
					 | 
				
			||||||
vt 0.668668 1.093750
 | 
					 | 
				
			||||||
vt 0.687500 1.125000
 | 
					 | 
				
			||||||
vt 0.312500 1.125000
 | 
					 | 
				
			||||||
vt 0.331332 1.156250
 | 
					 | 
				
			||||||
vt 0.668668 1.156250
 | 
					 | 
				
			||||||
vt 0.687500 1.187500
 | 
					 | 
				
			||||||
vt 0.312500 1.187500
 | 
					 | 
				
			||||||
vt 0.593750 0.666667
 | 
					 | 
				
			||||||
vt 0.593750 0.333333
 | 
					 | 
				
			||||||
vt 0.562500 0.312500
 | 
					 | 
				
			||||||
vt 0.562500 0.687500
 | 
					 | 
				
			||||||
vt 0.593750 0.333333
 | 
					 | 
				
			||||||
vt 0.593750 0.666667
 | 
					 | 
				
			||||||
vt 0.562500 0.687500
 | 
					 | 
				
			||||||
vt 0.562500 0.312500
 | 
					 | 
				
			||||||
vt 0.331332 1.156250
 | 
					 | 
				
			||||||
vt 0.668668 1.156250
 | 
					 | 
				
			||||||
vt 0.687500 1.187500
 | 
					 | 
				
			||||||
vt 0.312500 1.187500
 | 
					 | 
				
			||||||
vt 0.312500 1.062500
 | 
					 | 
				
			||||||
vt 0.687500 1.062500
 | 
					 | 
				
			||||||
vt 0.687500 0.312500
 | 
					 | 
				
			||||||
vt 0.687500 0.312500
 | 
					 | 
				
			||||||
vt 0.687500 0.687500
 | 
					 | 
				
			||||||
vt 0.312500 1.062500
 | 
					 | 
				
			||||||
vt 0.687500 1.062500
 | 
					 | 
				
			||||||
vt 0.000000 0.750000
 | 
					 | 
				
			||||||
vt 0.000000 0.250000
 | 
					 | 
				
			||||||
vt 1.000000 0.250000
 | 
					 | 
				
			||||||
vt 1.000000 0.750000
 | 
					 | 
				
			||||||
vt 1.000000 1.000000
 | 
					 | 
				
			||||||
vt -0.000000 1.000000
 | 
					 | 
				
			||||||
vt 0.000000 -0.000000
 | 
					 | 
				
			||||||
vt 1.000000 -0.000000
 | 
					 | 
				
			||||||
vt 1.000000 1.000000
 | 
					 | 
				
			||||||
vt -0.000000 1.000000
 | 
					 | 
				
			||||||
vt 0.000000 -0.000000
 | 
					 | 
				
			||||||
vt 1.000000 -0.000000
 | 
					 | 
				
			||||||
vt 0.000000 1.000000
 | 
					 | 
				
			||||||
vt 0.000000 0.000000
 | 
					 | 
				
			||||||
vt 1.000000 0.000000
 | 
					 | 
				
			||||||
vt 1.000000 1.000000
 | 
					 | 
				
			||||||
vt 1.000000 -0.000000
 | 
					 | 
				
			||||||
vt 1.000000 1.000000
 | 
					 | 
				
			||||||
vt 1.000000 1.000000
 | 
					 | 
				
			||||||
vt 0.000000 0.000000
 | 
					 | 
				
			||||||
vt -0.000000 0.000000
 | 
					 | 
				
			||||||
vn 0.0000 0.0000 -1.0000
 | 
					 | 
				
			||||||
vn 0.4442 0.8960 -0.0000
 | 
					 | 
				
			||||||
vn 0.0000 0.0000 1.0000
 | 
					 | 
				
			||||||
vn 0.0000 1.0000 -0.0000
 | 
					 | 
				
			||||||
vn 0.0000 -0.5161 0.8565
 | 
					 | 
				
			||||||
vn 0.8565 -0.5161 0.0000
 | 
					 | 
				
			||||||
vn -0.8565 -0.5161 0.0000
 | 
					 | 
				
			||||||
vn 0.0000 -0.5161 -0.8565
 | 
					 | 
				
			||||||
vn -0.0000 -1.0000 -0.0000
 | 
					 | 
				
			||||||
vn 1.0000 -0.0000 0.0000
 | 
					 | 
				
			||||||
vn -1.0000 0.0000 -0.0000
 | 
					 | 
				
			||||||
vn -0.4442 0.8960 -0.0000
 | 
					 | 
				
			||||||
vn -0.0000 0.5161 0.8565
 | 
					 | 
				
			||||||
vn 0.8565 0.5161 -0.0000
 | 
					 | 
				
			||||||
vn -0.8565 0.5161 -0.0000
 | 
					 | 
				
			||||||
vn 0.0000 0.5161 -0.8565
 | 
					 | 
				
			||||||
g Cube_Cube_Material.001_Cube_Cube_Material.001_clip
 | 
					 | 
				
			||||||
s 1
 | 
					 | 
				
			||||||
f 1/1/1 2/2/1 3/3/1 4/4/1
 | 
					 | 
				
			||||||
f 4/5/2 3/6/2 5/7/2 6/8/2
 | 
					 | 
				
			||||||
f 6/9/3 5/10/3 7/11/3 8/12/3
 | 
					 | 
				
			||||||
f 7/13/4 5/7/4 42/14/4 43/15/4
 | 
					 | 
				
			||||||
f 5/7/4 3/6/4 9/16/4 42/14/4
 | 
					 | 
				
			||||||
f 2/17/4 7/13/4 43/15/4 44/18/4
 | 
					 | 
				
			||||||
f 3/6/4 2/17/4 44/18/4 9/16/4
 | 
					 | 
				
			||||||
f 10/19/5 11/20/5 12/21/5 13/22/5
 | 
					 | 
				
			||||||
f 11/23/6 14/24/6 15/25/6 12/26/6
 | 
					 | 
				
			||||||
f 16/27/7 10/28/7 13/29/7 17/30/7
 | 
					 | 
				
			||||||
f 14/31/8 16/32/8 17/33/8 15/34/8
 | 
					 | 
				
			||||||
f 15/35/9 18/36/9 19/37/9 12/38/9
 | 
					 | 
				
			||||||
f 20/39/1 21/40/1 22/41/1 18/42/1
 | 
					 | 
				
			||||||
f 18/43/10 22/44/10 23/45/10 19/46/10
 | 
					 | 
				
			||||||
f 19/47/3 23/48/3 24/49/3 25/50/3
 | 
					 | 
				
			||||||
f 21/51/11 20/39/11 25/52/11 24/49/11
 | 
					 | 
				
			||||||
f 21/53/4 24/54/4 23/55/4 22/56/4
 | 
					 | 
				
			||||||
f 12/38/9 19/37/9 25/57/9 13/58/9
 | 
					 | 
				
			||||||
f 13/58/9 25/57/9 20/59/9 17/60/9
 | 
					 | 
				
			||||||
f 17/60/9 20/59/9 18/36/9 15/35/9
 | 
					 | 
				
			||||||
f 2/17/12 1/61/12 8/62/12 7/13/12
 | 
					 | 
				
			||||||
f 26/63/5 27/64/5 28/65/5 29/66/5
 | 
					 | 
				
			||||||
f 27/67/6 30/68/6 31/69/6 28/70/6
 | 
					 | 
				
			||||||
f 32/71/7 26/72/7 29/73/7 33/74/7
 | 
					 | 
				
			||||||
f 30/75/8 32/76/8 33/77/8 31/78/8
 | 
					 | 
				
			||||||
f 34/79/5 35/80/5 36/81/5 37/82/5
 | 
					 | 
				
			||||||
f 35/83/6 38/84/6 39/85/6 36/86/6
 | 
					 | 
				
			||||||
f 40/87/7 34/88/7 37/89/7 41/90/7
 | 
					 | 
				
			||||||
f 38/91/8 40/92/8 41/93/8 39/94/8
 | 
					 | 
				
			||||||
f 37/82/13 36/81/13 11/20/13 10/19/13
 | 
					 | 
				
			||||||
f 36/86/14 39/85/14 14/24/14 11/23/14
 | 
					 | 
				
			||||||
f 41/90/15 37/89/15 10/28/15 16/27/15
 | 
					 | 
				
			||||||
f 39/94/16 41/93/16 16/32/16 14/31/16
 | 
					 | 
				
			||||||
f 43/95/13 42/96/13 27/64/13 26/63/13
 | 
					 | 
				
			||||||
f 42/14/14 9/97/14 30/68/14 27/67/14
 | 
					 | 
				
			||||||
f 44/98/15 43/99/15 26/72/15 32/71/15
 | 
					 | 
				
			||||||
f 9/100/16 44/101/16 32/76/16 30/75/16
 | 
					 | 
				
			||||||
f 29/66/13 28/65/13 35/80/13 34/79/13
 | 
					 | 
				
			||||||
f 28/70/14 31/69/14 38/84/14 35/83/14
 | 
					 | 
				
			||||||
f 33/74/15 29/73/15 34/88/15 40/87/15
 | 
					 | 
				
			||||||
f 31/78/16 33/77/16 40/92/16 38/91/16
 | 
					 | 
				
			||||||
f 8/102/9 1/103/9 4/104/9 6/105/9
 | 
					 | 
				
			||||||
g Cube_Cube_Material.001_Cube_Cube_Material.001_sides_with_band
 | 
					 | 
				
			||||||
s off
 | 
					 | 
				
			||||||
f 47/106/10 51/107/10 52/108/10 50/109/10
 | 
					 | 
				
			||||||
f 48/110/11 49/111/11 46/112/11 45/113/11
 | 
					 | 
				
			||||||
f 47/114/9 50/115/9 48/116/9 45/117/9
 | 
					 | 
				
			||||||
f 51/118/4 46/112/4 49/111/4 52/119/4
 | 
					 | 
				
			||||||
g Cube_Cube_Material.001_Cube_Cube_Material.001_sides_without_band
 | 
					 | 
				
			||||||
f 45/113/1 46/120/1 51/107/1 47/121/1
 | 
					 | 
				
			||||||
f 50/109/3 52/119/3 49/111/3 48/122/3
 | 
					 | 
				
			||||||
| 
		 Before Width: | Height: | Size: 202 B  | 
| 
		 Before Width: | Height: | Size: 103 B  | 
@@ -1 +0,0 @@
 | 
				
			|||||||
name = technic
 | 
					 | 
				
			||||||
							
								
								
									
										1
									
								
								modpack.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
							
								
								
									
										68
									
								
								notes_on_iron
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,68 @@
 | 
				
			|||||||
 | 
					Notes on iron and steel
 | 
				
			||||||
 | 
					=======================
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Alloying iron with carbon is of huge importance, but in some processes
 | 
				
			||||||
 | 
					the alloying is an implicit side effect rather than the product of
 | 
				
			||||||
 | 
					explicit mixing, so it is a complex area.  In the real world, there is
 | 
				
			||||||
 | 
					a huge variety of kinds of iron and steel, differing in the proportion
 | 
				
			||||||
 | 
					of carbon included and in other elements added to the mix.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					The Minetest default mod doesn't distinguish between types of iron and
 | 
				
			||||||
 | 
					steel at all.  This mod introduces multiple types in order to get a bit
 | 
				
			||||||
 | 
					of complexity and flavour.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Leaving aside explicit addition of other elements, the iron/carbon
 | 
				
			||||||
 | 
					spectrum is here represented by three substances: wrought iron,
 | 
				
			||||||
 | 
					carbon steel, and cast iron.  Wrought iron has low carbon content
 | 
				
			||||||
 | 
					(less than 0.25%), resists shattering, and is easily welded, but is
 | 
				
			||||||
 | 
					relatively soft and susceptible to rusting.  It was used for rails,
 | 
				
			||||||
 | 
					gates, chains, wire, pipes, fasteners, and other purposes.  Cast iron
 | 
				
			||||||
 | 
					has high carbon content (2.1% to 4%), is especially hard, and resists
 | 
				
			||||||
 | 
					corrosion, but is relatively brittle, and difficult to work.  It was used
 | 
				
			||||||
 | 
					to build large structures such as bridges, and for cannons, cookware,
 | 
				
			||||||
 | 
					and engine cylinders.  Carbon steel has medium carbon content (0.25%
 | 
				
			||||||
 | 
					to 2.1%), and intermediate properties: moderately hard and also tough,
 | 
				
			||||||
 | 
					somewhat resistant to corrosion.  It is now used for most of the purposes
 | 
				
			||||||
 | 
					previously satisfied by wrought iron and many of those of cast iron,
 | 
				
			||||||
 | 
					but has historically been especially important for its use in swords,
 | 
				
			||||||
 | 
					armour, skyscrapers, large bridges, and machines.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Historically, the first form of iron to be refined was wrought iron,
 | 
				
			||||||
 | 
					produced from ore by a low-temperature furnace process in which the
 | 
				
			||||||
 | 
					ore/iron remains solid and impurities (slag) are progressively removed.
 | 
				
			||||||
 | 
					Cast iron, by contrast, was produced somewhat later by a high-temperature
 | 
				
			||||||
 | 
					process in a blast furnace, in which the metal is melted, and carbon is
 | 
				
			||||||
 | 
					unavoidably incorporated from the furnace's fuel.  (In fact, it's done
 | 
				
			||||||
 | 
					in two stages, first producing pig iron from ore, and then remelting the
 | 
				
			||||||
 | 
					pig iron to cast as cast iron.)  Carbon steel requires a more advanced
 | 
				
			||||||
 | 
					process, in which molten pig iron is processed to remove the carbon,
 | 
				
			||||||
 | 
					and then a controlled amount of carbon is explicitly mixed back in.
 | 
				
			||||||
 | 
					Other processes are possible to refine iron ore and to adjust its
 | 
				
			||||||
 | 
					carbon content.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Unfortunately, Minetest doesn't let us readily distinguish between
 | 
				
			||||||
 | 
					low-temperature and high-temperature processes: in the default game, the
 | 
				
			||||||
 | 
					same furnace is used both to cook food (low temperature) and to cast metal
 | 
				
			||||||
 | 
					ingots (varying high temperatures).  So we can't sensibly have wrought
 | 
				
			||||||
 | 
					iron and cast iron produced by different types of furnace.  Nor can
 | 
				
			||||||
 | 
					furnace recipes discriminate by which kind of fuel is used (and thus
 | 
				
			||||||
 | 
					by the availability of carbon).  The alloy furnace allows for explicit
 | 
				
			||||||
 | 
					alloying, which appropriately represents how carbon steel is made, but
 | 
				
			||||||
 | 
					is not sensible for the other two, and is a relatively advanced process.
 | 
				
			||||||
 | 
					About the only option to make a second iron-processing furnace process
 | 
				
			||||||
 | 
					readily available is to cook multiple times; happily, this bears a slight
 | 
				
			||||||
 | 
					resemblance to the real process with pig iron as an intermediate product.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					The default mod's refined iron, which it calls "steel", is identified
 | 
				
			||||||
 | 
					with this mod's wrought iron.  Cooking an iron lump (representing ore)
 | 
				
			||||||
 | 
					initially produces wrought iron; the cooking process here represents a
 | 
				
			||||||
 | 
					low-temperature bloomery process.  Cooking wrought iron then produces
 | 
				
			||||||
 | 
					cast iron; this time the cooking process represents a blast furnace.
 | 
				
			||||||
 | 
					Alloy cooking wrought iron with coal dust (carbon) produces carbon steel;
 | 
				
			||||||
 | 
					this represents the explicit mixing stage of carbon steel production.
 | 
				
			||||||
 | 
					Additionally, alloy cooking carbon steel with coal dust produces cast
 | 
				
			||||||
 | 
					iron, which is logical but not very useful.  Furthermore, to make it
 | 
				
			||||||
 | 
					possible to turn any of the forms of iron into any other, cooking carbon
 | 
				
			||||||
 | 
					steel or cast iron produces wrought iron, in an abbreviated form of the
 | 
				
			||||||
 | 
					bloomery process.  As usual for metals, the same cooking and alloying
 | 
				
			||||||
 | 
					processes can be performed in parallel forms on ingots or dust.
 | 
				
			||||||
@@ -10,29 +10,6 @@ Technic chests code is licensed under the GNU LGPLv2+.
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
Texture licenses:
 | 
					Texture licenses:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
BlockMen modified by Zefram (CC BY-SA 3.0):
 | 
					 | 
				
			||||||
  * technic_chernobylite_block.png
 | 
					 | 
				
			||||||
  * technic_corium_flowing_animated.png
 | 
					 | 
				
			||||||
  * technic_corium_source_animated.png
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
celeron55 (Perttu Ahola) modified by Zefram (CC BY-SA 3.0):
 | 
					 | 
				
			||||||
  * technic_bucket_corium.png
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
sdzen (Elise Staudter) (CC BY-SA 3.0):
 | 
					 | 
				
			||||||
  * most of the older 16x16 textures
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
leftshift (CC BY-SA 3.0):
 | 
					 | 
				
			||||||
  * technic_river_water_can.png
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
RealBadAngel: (WTFPL)
 | 
					RealBadAngel: (WTFPL)
 | 
				
			||||||
  * Everything else.
 | 
					  * Everything.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
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/>
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,7 @@
 | 
				
			|||||||
technic.config = technic.config or Settings(minetest.get_worldpath().."/technic.conf")
 | 
					
 | 
				
			||||||
 | 
					local worldpath = minetest.get_worldpath()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					technic.config = Settings(worldpath.."/technic.conf")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local conf_table = technic.config:to_table()
 | 
					local conf_table = technic.config:to_table()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -6,13 +9,10 @@ local defaults = {
 | 
				
			|||||||
	enable_mining_drill = "true",
 | 
						enable_mining_drill = "true",
 | 
				
			||||||
	enable_mining_laser = "true",
 | 
						enable_mining_laser = "true",
 | 
				
			||||||
	enable_flashlight = "false",
 | 
						enable_flashlight = "false",
 | 
				
			||||||
 | 
						enable_rubber_tree_generation = "true",
 | 
				
			||||||
 | 
						enable_marble_generation = "true",
 | 
				
			||||||
 | 
						enable_granite_generation = "true",
 | 
				
			||||||
	enable_wind_mill = "false",
 | 
						enable_wind_mill = "false",
 | 
				
			||||||
	enable_frames = "false",
 | 
					 | 
				
			||||||
	enable_corium_griefing = "true",
 | 
					 | 
				
			||||||
	enable_radiation_protection = "true",
 | 
					 | 
				
			||||||
	enable_entity_radiation_damage = "true",
 | 
					 | 
				
			||||||
	enable_longterm_radiation_damage = "true",
 | 
					 | 
				
			||||||
	enable_nuclear_reactor_digiline_selfdestruct = "false",
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
for k, v in pairs(defaults) do
 | 
					for k, v in pairs(defaults) do
 | 
				
			||||||
@@ -20,3 +20,4 @@ for k, v in pairs(defaults) do
 | 
				
			|||||||
		technic.config:set(k, v)
 | 
							technic.config:set(k, v)
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,25 +1,4 @@
 | 
				
			|||||||
-- check if we have the necessary dependencies to allow actually using these materials in the crafts
 | 
					-- tubes crafting recipes
 | 
				
			||||||
local mesecons_materials = minetest.get_modpath("mesecons_materials")
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- Remove some recipes
 | 
					 | 
				
			||||||
-- Bronze
 | 
					 | 
				
			||||||
minetest.clear_craft({
 | 
					 | 
				
			||||||
	type = "shapeless",
 | 
					 | 
				
			||||||
	output = "default:bronze_ingot"
 | 
					 | 
				
			||||||
})
 | 
					 | 
				
			||||||
-- Restore recipe for bronze block to ingots
 | 
					 | 
				
			||||||
minetest.register_craft({
 | 
					 | 
				
			||||||
	output = "default:bronze_ingot 9",
 | 
					 | 
				
			||||||
	recipe = {
 | 
					 | 
				
			||||||
		{"default:bronzeblock"}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
})
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- Accelerator tube
 | 
					 | 
				
			||||||
if pipeworks.enable_accelerator_tube then
 | 
					 | 
				
			||||||
	minetest.clear_craft({
 | 
					 | 
				
			||||||
		output = "pipeworks:accelerator_tube_1",
 | 
					 | 
				
			||||||
	})
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
minetest.register_craft({
 | 
					minetest.register_craft({
 | 
				
			||||||
    output = 'pipeworks:accelerator_tube_1',
 | 
					    output = 'pipeworks:accelerator_tube_1',
 | 
				
			||||||
@@ -27,13 +6,6 @@ if pipeworks.enable_accelerator_tube then
 | 
				
			|||||||
        {'technic:copper_coil', 'pipeworks:tube_1', 'technic:copper_coil'},
 | 
					        {'technic:copper_coil', 'pipeworks:tube_1', 'technic:copper_coil'},
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- Teleport tube
 | 
					 | 
				
			||||||
if pipeworks.enable_teleport_tube then
 | 
					 | 
				
			||||||
	minetest.clear_craft({
 | 
					 | 
				
			||||||
		output = "pipeworks:teleport_tube_1",
 | 
					 | 
				
			||||||
	})
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
minetest.register_craft({
 | 
					minetest.register_craft({
 | 
				
			||||||
    output = 'pipeworks:teleport_tube_1',
 | 
					    output = 'pipeworks:teleport_tube_1',
 | 
				
			||||||
@@ -43,21 +15,6 @@ if pipeworks.enable_teleport_tube then
 | 
				
			|||||||
        {'default:mese_crystal', 'technic:copper_coil', 'default:mese_crystal'},
 | 
					        {'default:mese_crystal', 'technic:copper_coil', 'default:mese_crystal'},
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- basic materials' brass ingot
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
minetest.clear_craft({
 | 
					 | 
				
			||||||
	output = "basic_materials:brass_ingot",
 | 
					 | 
				
			||||||
})
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
minetest.register_craft( {
 | 
					 | 
				
			||||||
	type = "shapeless",
 | 
					 | 
				
			||||||
	output = "basic_materials:brass_ingot 9",
 | 
					 | 
				
			||||||
	recipe = { "basic_materials:brass_block" },
 | 
					 | 
				
			||||||
})
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- tubes crafting recipes
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
minetest.register_craft({
 | 
					minetest.register_craft({
 | 
				
			||||||
	output = 'technic:diamond_drill_head',
 | 
						output = 'technic:diamond_drill_head',
 | 
				
			||||||
@@ -80,42 +37,70 @@ minetest.register_craft({
 | 
				
			|||||||
minetest.register_craft({
 | 
					minetest.register_craft({
 | 
				
			||||||
	output = 'technic:blue_energy_crystal',
 | 
						output = 'technic:blue_energy_crystal',
 | 
				
			||||||
	recipe = {
 | 
						recipe = {
 | 
				
			||||||
		{'moreores:mithril_ingot', 'technic:battery', 'dye:blue'},
 | 
							{'default:gold_ingot', 'technic:battery', 'dye:blue'},
 | 
				
			||||||
		{'technic:battery', 'technic:green_energy_crystal', 'technic:battery'},
 | 
							{'technic:battery', 'technic:green_energy_crystal', 'technic:battery'},
 | 
				
			||||||
		{'dye:blue', 'technic:battery', 'moreores:mithril_ingot'},
 | 
							{'dye:blue', 'technic:battery', 'default:gold_ingot'},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
minetest.register_craft({
 | 
					minetest.register_craft({
 | 
				
			||||||
	output = 'technic:red_energy_crystal',
 | 
						output = 'technic:red_energy_crystal',
 | 
				
			||||||
	recipe = {
 | 
						recipe = {
 | 
				
			||||||
		{'moreores:silver_ingot', 'technic:battery', 'dye:red'},
 | 
							{'default:gold_ingot', 'technic:battery', 'dye:red'},
 | 
				
			||||||
		{'technic:battery', 'basic_materials:energy_crystal_simple', 'technic:battery'},
 | 
							{'technic:battery', 'default:diamondblock', 'technic:battery'},
 | 
				
			||||||
		{'dye:red', 'technic:battery', 'moreores:silver_ingot'},
 | 
							{'dye:red', 'technic:battery', 'default:gold_ingot'},
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					minetest.register_craft({
 | 
				
			||||||
 | 
						output = 'technic:fine_copper_wire 2',
 | 
				
			||||||
 | 
						recipe = {
 | 
				
			||||||
 | 
							{'', 'default:copper_ingot', ''},
 | 
				
			||||||
 | 
							{'', 'default:copper_ingot', ''},
 | 
				
			||||||
 | 
							{'', 'default:copper_ingot', ''},
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					minetest.register_craft({
 | 
				
			||||||
 | 
						output = 'technic:fine_gold_wire 2',
 | 
				
			||||||
 | 
						recipe = {
 | 
				
			||||||
 | 
							{'', 'default:gold_ingot', ''},
 | 
				
			||||||
 | 
							{'', 'default:gold_ingot', ''},
 | 
				
			||||||
 | 
							{'', 'default:gold_ingot', ''},
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					minetest.register_craft({
 | 
				
			||||||
 | 
						output = 'technic:fine_silver_wire 2',
 | 
				
			||||||
 | 
						recipe = {
 | 
				
			||||||
 | 
							{'', 'moreores:silver_ingot', ''},
 | 
				
			||||||
 | 
							{'', 'moreores:silver_ingot', ''},
 | 
				
			||||||
 | 
							{'', 'moreores:silver_ingot', ''},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
minetest.register_craft({
 | 
					minetest.register_craft({
 | 
				
			||||||
	output = 'technic:copper_coil 1',
 | 
						output = 'technic:copper_coil 1',
 | 
				
			||||||
	recipe = {
 | 
						recipe = {
 | 
				
			||||||
		{'basic_materials:copper_wire', 'technic:wrought_iron_ingot', 'basic_materials:copper_wire'},
 | 
							{'technic:fine_copper_wire', 'technic:wrought_iron_ingot', 'technic:fine_copper_wire'},
 | 
				
			||||||
		{'technic:wrought_iron_ingot', '', 'technic:wrought_iron_ingot'},
 | 
							{'technic:wrought_iron_ingot', '', 'technic:wrought_iron_ingot'},
 | 
				
			||||||
		{'basic_materials:copper_wire', 'technic:wrought_iron_ingot', 'basic_materials:copper_wire'},
 | 
							{'technic:fine_copper_wire', 'technic:wrought_iron_ingot', 'technic:fine_copper_wire'},
 | 
				
			||||||
	},
 | 
						}
 | 
				
			||||||
	replacements = {
 | 
					 | 
				
			||||||
		{"basic_materials:copper_wire", "basic_materials:empty_spool"},
 | 
					 | 
				
			||||||
		{"basic_materials:copper_wire", "basic_materials:empty_spool"},
 | 
					 | 
				
			||||||
		{"basic_materials:copper_wire", "basic_materials:empty_spool"},
 | 
					 | 
				
			||||||
		{"basic_materials:copper_wire", "basic_materials:empty_spool"}
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local isolation = mesecons_materials and "mesecons_materials:fiber" or "technic:rubber"
 | 
					minetest.register_craft({
 | 
				
			||||||
 | 
						output = 'technic:motor',
 | 
				
			||||||
 | 
						recipe = {
 | 
				
			||||||
 | 
							{'technic:carbon_steel_ingot', 'technic:copper_coil', 'technic:carbon_steel_ingot'},
 | 
				
			||||||
 | 
							{'technic:carbon_steel_ingot', 'technic:copper_coil', 'technic:carbon_steel_ingot'},
 | 
				
			||||||
 | 
							{'technic:carbon_steel_ingot', 'default:copper_ingot', 'technic:carbon_steel_ingot'},
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
minetest.register_craft({
 | 
					minetest.register_craft({
 | 
				
			||||||
	output = 'technic:lv_transformer',
 | 
						output = 'technic:lv_transformer',
 | 
				
			||||||
	recipe = {
 | 
						recipe = {
 | 
				
			||||||
		{isolation,                    'technic:wrought_iron_ingot', isolation},
 | 
							{'technic:wrought_iron_ingot', 'technic:wrought_iron_ingot', 'technic:wrought_iron_ingot'},
 | 
				
			||||||
		{'technic:copper_coil',        'technic:wrought_iron_ingot', 'technic:copper_coil'},
 | 
							{'technic:copper_coil',        'technic:wrought_iron_ingot', 'technic:copper_coil'},
 | 
				
			||||||
		{'technic:wrought_iron_ingot', 'technic:wrought_iron_ingot', 'technic:wrought_iron_ingot'},
 | 
							{'technic:wrought_iron_ingot', 'technic:wrought_iron_ingot', 'technic:wrought_iron_ingot'},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@@ -124,7 +109,7 @@ minetest.register_craft({
 | 
				
			|||||||
minetest.register_craft({
 | 
					minetest.register_craft({
 | 
				
			||||||
	output = 'technic:mv_transformer',
 | 
						output = 'technic:mv_transformer',
 | 
				
			||||||
	recipe = {
 | 
						recipe = {
 | 
				
			||||||
		{isolation,                    'technic:carbon_steel_ingot', isolation},
 | 
							{'technic:carbon_steel_ingot', 'technic:carbon_steel_ingot', 'technic:carbon_steel_ingot'},
 | 
				
			||||||
		{'technic:copper_coil',        'technic:carbon_steel_ingot', 'technic:copper_coil'},
 | 
							{'technic:copper_coil',        'technic:carbon_steel_ingot', 'technic:copper_coil'},
 | 
				
			||||||
		{'technic:carbon_steel_ingot', 'technic:carbon_steel_ingot', 'technic:carbon_steel_ingot'},
 | 
							{'technic:carbon_steel_ingot', 'technic:carbon_steel_ingot', 'technic:carbon_steel_ingot'},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@@ -133,7 +118,7 @@ minetest.register_craft({
 | 
				
			|||||||
minetest.register_craft({
 | 
					minetest.register_craft({
 | 
				
			||||||
	output = 'technic:hv_transformer',
 | 
						output = 'technic:hv_transformer',
 | 
				
			||||||
	recipe = {
 | 
						recipe = {
 | 
				
			||||||
		{isolation,                       'technic:stainless_steel_ingot', isolation},
 | 
							{'technic:stainless_steel_ingot', 'technic:stainless_steel_ingot', 'technic:stainless_steel_ingot'},
 | 
				
			||||||
		{'technic:copper_coil',           'technic:stainless_steel_ingot', 'technic:copper_coil'},
 | 
							{'technic:copper_coil',           'technic:stainless_steel_ingot', 'technic:copper_coil'},
 | 
				
			||||||
		{'technic:stainless_steel_ingot', 'technic:stainless_steel_ingot', 'technic:stainless_steel_ingot'},
 | 
							{'technic:stainless_steel_ingot', 'technic:stainless_steel_ingot', 'technic:stainless_steel_ingot'},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@@ -142,11 +127,10 @@ minetest.register_craft({
 | 
				
			|||||||
minetest.register_craft({
 | 
					minetest.register_craft({
 | 
				
			||||||
	output = 'technic:control_logic_unit',
 | 
						output = 'technic:control_logic_unit',
 | 
				
			||||||
	recipe = {
 | 
						recipe = {
 | 
				
			||||||
		{'', 'basic_materials:gold_wire', ''},
 | 
							{'', 'default:gold_ingot', ''},
 | 
				
			||||||
		{'default:copper_ingot', 'technic:silicon_wafer', 'default:copper_ingot'},
 | 
							{'default:copper_ingot', 'technic:silicon_wafer', 'default:copper_ingot'},
 | 
				
			||||||
		{'', 'technic:chromium_ingot', ''},
 | 
							{'', 'default:copper_ingot', ''},
 | 
				
			||||||
	},
 | 
						}
 | 
				
			||||||
	replacements = { {"basic_materials:gold_wire", "basic_materials:empty_spool"}, },
 | 
					 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
minetest.register_craft({
 | 
					minetest.register_craft({
 | 
				
			||||||
@@ -154,7 +138,7 @@ minetest.register_craft({
 | 
				
			|||||||
	recipe = {
 | 
						recipe = {
 | 
				
			||||||
		{'technic:stainless_steel_ingot', 'technic:stainless_steel_ingot', 'technic:stainless_steel_ingot'},
 | 
							{'technic:stainless_steel_ingot', 'technic:stainless_steel_ingot', 'technic:stainless_steel_ingot'},
 | 
				
			||||||
		{'default:bronze_ingot',          'default:bronze_ingot',          'default:bronze_ingot'},
 | 
							{'default:bronze_ingot',          'default:bronze_ingot',          'default:bronze_ingot'},
 | 
				
			||||||
		{'default:tin_ingot',             'default:tin_ingot',             'default:tin_ingot'},
 | 
							{'moreores:tin_ingot',            'moreores:tin_ingot',            'moreores:tin_ingot'},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -169,41 +153,49 @@ minetest.register_craft({
 | 
				
			|||||||
	output = "technic:machine_casing",
 | 
						output = "technic:machine_casing",
 | 
				
			||||||
	recipe = {
 | 
						recipe = {
 | 
				
			||||||
		{ "technic:cast_iron_ingot", "technic:cast_iron_ingot", "technic:cast_iron_ingot" },
 | 
							{ "technic:cast_iron_ingot", "technic:cast_iron_ingot", "technic:cast_iron_ingot" },
 | 
				
			||||||
		{ "technic:cast_iron_ingot", "basic_materials:brass_ingot", "technic:cast_iron_ingot" },
 | 
							{ "technic:cast_iron_ingot", "technic:brass_ingot", "technic:cast_iron_ingot" },
 | 
				
			||||||
		{ "technic:cast_iron_ingot", "technic:cast_iron_ingot", "technic:cast_iron_ingot" },
 | 
							{ "technic:cast_iron_ingot", "technic:cast_iron_ingot", "technic:cast_iron_ingot" },
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Remove some recipes
 | 
				
			||||||
 | 
					minetest.register_craftitem("technic:nothing", {
 | 
				
			||||||
 | 
						description = "",
 | 
				
			||||||
 | 
						inventory_image = "blank.png",
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if minetest.register_craft_predict then
 | 
				
			||||||
 | 
						minetest.register_craft_predict(function(itemstack, player, old_craft_grid, craft_inv)
 | 
				
			||||||
 | 
							if itemstack:get_name() == "technic:nothing" then
 | 
				
			||||||
 | 
								return ItemStack("")
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end)
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Bronze
 | 
				
			||||||
minetest.register_craft({
 | 
					minetest.register_craft({
 | 
				
			||||||
	output = "default:dirt 2",
 | 
					 | 
				
			||||||
	type = "shapeless",
 | 
						type = "shapeless",
 | 
				
			||||||
	replacements = {{"bucket:bucket_water","bucket:bucket_empty"}},
 | 
						output = "technic:nothing",
 | 
				
			||||||
 | 
						recipe = {"default:copper_ingot", "default:steel_ingot"}
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Accelerator tube
 | 
				
			||||||
 | 
					minetest.register_craft({
 | 
				
			||||||
 | 
						output = "technic:nothing",
 | 
				
			||||||
	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({
 | 
					minetest.register_craft({
 | 
				
			||||||
	output = "technic:rubber_goo",
 | 
						output = "technic:nothing",
 | 
				
			||||||
	type = "shapeless",
 | 
					 | 
				
			||||||
	recipe = {
 | 
						recipe = {
 | 
				
			||||||
		"technic:raw_latex",
 | 
						        { "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" },
 | 
				
			||||||
		"default:coal_lump",
 | 
						        { "default:desert_stone", "default:mese_block", "default:desert_stone" },
 | 
				
			||||||
		"default:coal_lump",
 | 
						        { "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" }
 | 
				
			||||||
		"default:coal_lump",
 | 
					 | 
				
			||||||
		"default:coal_lump",
 | 
					 | 
				
			||||||
		"default:coal_lump",
 | 
					 | 
				
			||||||
		"default:coal_lump",
 | 
					 | 
				
			||||||
		"default:coal_lump",
 | 
					 | 
				
			||||||
		"default:coal_lump",
 | 
					 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
minetest.register_craft({
 | 
					 | 
				
			||||||
	output = "technic:rubber",
 | 
					 | 
				
			||||||
	type = "cooking",
 | 
					 | 
				
			||||||
	recipe = "technic:rubber_goo",
 | 
					 | 
				
			||||||
})
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										7
									
								
								technic/depends.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,7 @@
 | 
				
			|||||||
 | 
					default
 | 
				
			||||||
 | 
					moreores
 | 
				
			||||||
 | 
					pipeworks
 | 
				
			||||||
 | 
					mesecons
 | 
				
			||||||
 | 
					mesecons_mvps?
 | 
				
			||||||
 | 
					intllib?
 | 
				
			||||||
 | 
					unified_inventory?
 | 
				
			||||||
@@ -1,268 +0,0 @@
 | 
				
			|||||||
# technic API
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
This file documents the functions within the technic modpack for use in mods.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[Switch to plaintext format](https://raw.githubusercontent.com/minetest-mods/technic/master/technic/doc/api.md)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
**Undocumented API may change at any time.**
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Tiers
 | 
					 | 
				
			||||||
Tier are network types. List of pre-registered tiers:
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
* `"LV"`, Low Voltage
 | 
					 | 
				
			||||||
* `"MV"`, Medium Voltage
 | 
					 | 
				
			||||||
* `"HV"`, High Voltage
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Available functions:
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
* `technic.register_tier(tier, description)`
 | 
					 | 
				
			||||||
	* Registers a network type (tier)
 | 
					 | 
				
			||||||
	* `tier`: string, short name (ex. `LV`)
 | 
					 | 
				
			||||||
	* `description`: string, long name (ex. `Low Voltage`)
 | 
					 | 
				
			||||||
	* See also `tiers`
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Cables
 | 
					 | 
				
			||||||
* `technic.register_cable(tier, size)`
 | 
					 | 
				
			||||||
	* Registers an existing node as cable
 | 
					 | 
				
			||||||
	* `tier`: string
 | 
					 | 
				
			||||||
	* `size`: number, visual size of the wire
 | 
					 | 
				
			||||||
* `technic.get_cable_tier(nodename)`
 | 
					 | 
				
			||||||
	* Retrieves the tier assigned to the provided node name
 | 
					 | 
				
			||||||
	* `nodename`: string, name of the node
 | 
					 | 
				
			||||||
	* Returns the tier (string) or `nil`
 | 
					 | 
				
			||||||
* `technic.is_tier_cable(nodename, tier)`
 | 
					 | 
				
			||||||
	* Tells whether the node `nodename` is the cable of the tier `tier`.
 | 
					 | 
				
			||||||
	* Short version of `technic.get_cable_tier(nodename) == tier`
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Machines
 | 
					 | 
				
			||||||
The machine type indicates the direction of power flow.
 | 
					 | 
				
			||||||
List of pre-registered machine types:
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
* `technic.receiver = "RE"`: consumes energy. e.g. grinder
 | 
					 | 
				
			||||||
* `technic.producer = "PR"`: provides energy. e.g. solar panel
 | 
					 | 
				
			||||||
* `technic.producer_receiver = "PR_RE"` supply converter
 | 
					 | 
				
			||||||
* `technic.battery  = "BA"`: stores energy. e.g. LV battery box
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Available functions:
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
* `technic.register_base_machine(data)`
 | 
					 | 
				
			||||||
	* Registers a new node and defines the underlying machine behaviour. `data` fields:
 | 
					 | 
				
			||||||
	* `tier`: string, see #Tiers
 | 
					 | 
				
			||||||
	* `typename`: string, equivalent to the processing type registered
 | 
					 | 
				
			||||||
	  by `technic.register_recipe`. Examples: `"cooking"` `"alloy"`
 | 
					 | 
				
			||||||
	* `machine_name`: string, node name
 | 
					 | 
				
			||||||
	* `machine_desc`: string, node description
 | 
					 | 
				
			||||||
	* `demand`: table, EU consumption values for each upgrade level.
 | 
					 | 
				
			||||||
	  Up to three indices. Index 1 == no upgrade. Example: `{3000, 2000, 1000}`.
 | 
					 | 
				
			||||||
	* `upgrade`: (boolean), whether to add upgrade slots
 | 
					 | 
				
			||||||
	* `modname`: (string), mod origin
 | 
					 | 
				
			||||||
	* `tube`: (boolean), whether the machine has Pipeworks connectivity
 | 
					 | 
				
			||||||
	* `can_insert`: (func), see Pipeworks documentation
 | 
					 | 
				
			||||||
		* Accepts all inputs by default, if `tube = 1`
 | 
					 | 
				
			||||||
		* See also: `technic.can_insert_unique_stack`
 | 
					 | 
				
			||||||
	* `insert_object`: (func), see Pipeworks documentation
 | 
					 | 
				
			||||||
		* Accepts all inputs by default, if `tube = 1`
 | 
					 | 
				
			||||||
		* See also: `technic.insert_object_unique_stack`
 | 
					 | 
				
			||||||
	* `connect_sides`: (table), see Lua API documentation. Defaults to all directions but front.
 | 
					 | 
				
			||||||
* `technic.register_machine(tier, nodename, machine_type)`
 | 
					 | 
				
			||||||
	* Register an existing node as machine, bound to the network tier
 | 
					 | 
				
			||||||
	* `tier`: string, see #Tiers
 | 
					 | 
				
			||||||
	* `nodename`: string, node name
 | 
					 | 
				
			||||||
	* `machine_type`: string, following options are possible:
 | 
					 | 
				
			||||||
		* `technic.receiver = "RE"`: Consumes energy
 | 
					 | 
				
			||||||
		* `technic.producer = "PR"`: Provides energy
 | 
					 | 
				
			||||||
		* `technic.battery = "BA"`: Energy storage
 | 
					 | 
				
			||||||
	* See also `Machine types`
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Callbacks for pipeworks item transfer:
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
* `technic.can_insert_unique_stack(pos, node, stack, direction)`
 | 
					 | 
				
			||||||
* `technic.insert_object_unique_stack(pos, node, stack, direction)`
 | 
					 | 
				
			||||||
	* Functions for the parameters `can_insert` and `insert_object` to avoid
 | 
					 | 
				
			||||||
	  filling multiple inventory slots with same type of item.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
### Recipes
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
* `technic.register_recipe_type(typename, recipedef)`
 | 
					 | 
				
			||||||
	* Registers a new recipe type used for machine processing
 | 
					 | 
				
			||||||
	* `typename`: string, name of the recipe type
 | 
					 | 
				
			||||||
	* Fields of `recipedef`:
 | 
					 | 
				
			||||||
		* `description`: string, descriptor of the recipe type
 | 
					 | 
				
			||||||
		* `input_size`: (numeric), count of input ItemStacks. default 1
 | 
					 | 
				
			||||||
		* `output_size`: (numeric), count of output ItemStacks. default 1
 | 
					 | 
				
			||||||
* `technic.register_recipe(recipe)`
 | 
					 | 
				
			||||||
	* Registers a individual input/output recipe. Fields of `recipe`:
 | 
					 | 
				
			||||||
	* `input`: table, integer-indexed list of input ItemStacks.
 | 
					 | 
				
			||||||
	* `output`: table/ItemStack, single output or list of output ItemStacks.
 | 
					 | 
				
			||||||
	* `time`: numeric, process time in seconds.
 | 
					 | 
				
			||||||
* `technic.get_recipe(typename, items)`
 | 
					 | 
				
			||||||
	* `typename`: string, see `technic.register_recipe_type`
 | 
					 | 
				
			||||||
	* `items`: table, integer-indexed list of input ItemStacks.
 | 
					 | 
				
			||||||
	* Returns: `recipe` table on success, `nil` otherwise
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
The following functions can be used to register recipes for
 | 
					 | 
				
			||||||
a specific machine type:
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
* Centrifuge
 | 
					 | 
				
			||||||
	* `technic.register_separating_recipe(recipe)`
 | 
					 | 
				
			||||||
* Compressor
 | 
					 | 
				
			||||||
	* `technic.register_compressor_recipe(recipe)`
 | 
					 | 
				
			||||||
* Furnaces (electric, normal)
 | 
					 | 
				
			||||||
	* `minetest.register_recipe(recipe)`
 | 
					 | 
				
			||||||
* Extractor
 | 
					 | 
				
			||||||
	* `technic.register_extractor_recipe(recipe)`
 | 
					 | 
				
			||||||
* Freezer
 | 
					 | 
				
			||||||
	* `technic.register_freezer_recipe(recipe)`
 | 
					 | 
				
			||||||
* Grinder
 | 
					 | 
				
			||||||
	* `technic.register_grinder_recipe(recipe)`
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Tools
 | 
					 | 
				
			||||||
* `technic.register_power_tool(itemname, max_charge)`
 | 
					 | 
				
			||||||
	* Register or configure the maximal charge held by an existing item
 | 
					 | 
				
			||||||
	* `craftitem`: string, item or node name
 | 
					 | 
				
			||||||
	* `max_charge`: number, maximal EU capacity
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Helper functions
 | 
					 | 
				
			||||||
Unsorted functions:
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
* `technic.EU_string(num)`
 | 
					 | 
				
			||||||
	* Converts num to a human-readable string (see `pretty_num`)
 | 
					 | 
				
			||||||
	  and adds the `EU` unit
 | 
					 | 
				
			||||||
	* Use this function when showing players energy values
 | 
					 | 
				
			||||||
* `technic.pretty_num(num)`
 | 
					 | 
				
			||||||
	* Converts the number `num` to a human-readable string with SI prefixes
 | 
					 | 
				
			||||||
* `technic.config:get(name)`
 | 
					 | 
				
			||||||
	* Some configuration function
 | 
					 | 
				
			||||||
* `technic.tube_inject_item(pos, start_pos, velocity, item)`
 | 
					 | 
				
			||||||
	* Same as `pipeworks.tube_inject_item`
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
### Energy modifiers
 | 
					 | 
				
			||||||
* `technic.set_RE_wear(itemstack, item_load, max_charge)`
 | 
					 | 
				
			||||||
	* Modifies the power tool wear of the given itemstack
 | 
					 | 
				
			||||||
	* `itemstack`: ItemStack to modify
 | 
					 | 
				
			||||||
	* `item_load`: number, used energy in EU
 | 
					 | 
				
			||||||
	* `max_charge`: number, maximal EU capacity of the tool
 | 
					 | 
				
			||||||
	* The itemdef field `wear_represents` must be set to `"technic_RE_charge"`,
 | 
					 | 
				
			||||||
	  otherwise this function will do nothing.
 | 
					 | 
				
			||||||
	* Returns the modified itemstack
 | 
					 | 
				
			||||||
* `technic.refill_RE_charge(itemstack)`
 | 
					 | 
				
			||||||
	* This function fully recharges an RE chargeable item.
 | 
					 | 
				
			||||||
	* If `technic.power_tools[itemstack:get_name()]` is `nil` (or `false`), this
 | 
					 | 
				
			||||||
	  function does nothing, else that value is the maximum charge.
 | 
					 | 
				
			||||||
	* The itemstack metadata is changed to contain the charge.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
### Node-specific
 | 
					 | 
				
			||||||
* `technic.get_or_load_node(pos)`
 | 
					 | 
				
			||||||
	* If the mapblock is loaded, it returns the node at pos,
 | 
					 | 
				
			||||||
	  else it loads the chunk and returns `nil`.
 | 
					 | 
				
			||||||
* `technic.swap_node(pos, nodename)`
 | 
					 | 
				
			||||||
	* Same as `mintest.swap_node` but it only changes the nodename.
 | 
					 | 
				
			||||||
	* It uses `minetest.get_node` before swapping to ensure the new nodename
 | 
					 | 
				
			||||||
	  is not the same as the current one.
 | 
					 | 
				
			||||||
* `technic.trace_node_ray(pos, dir, range)`
 | 
					 | 
				
			||||||
	* Returns an iteration function (usable in the for loop) to iterate over the
 | 
					 | 
				
			||||||
	  node positions along the specified ray.
 | 
					 | 
				
			||||||
	* The returned positions will not include the starting position `pos`.
 | 
					 | 
				
			||||||
* `technic.trace_node_ray_fat(pos, dir, range)`
 | 
					 | 
				
			||||||
	* Like `technic.trace_node_ray` but includes extra positions near the ray.
 | 
					 | 
				
			||||||
	* The node ray functions are used for mining lasers.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Item Definition fields
 | 
					 | 
				
			||||||
Groups:
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
* `technic_<tier> = 1`
 | 
					 | 
				
			||||||
	* Makes the node connect to the cables of the matching tier name
 | 
					 | 
				
			||||||
	* `<tier>`: name of the tier, in lowercase (ex. `lv`)
 | 
					 | 
				
			||||||
* `technic_machine = 1`
 | 
					 | 
				
			||||||
	* UNRELIABLE. Indicates whether the item or node belongs to technic
 | 
					 | 
				
			||||||
* `connect_sides = {"top", "left", ...}`
 | 
					 | 
				
			||||||
	* Extends the Minetest API. Indicates where the machine can be connected.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Additional definition fields:
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
* `<itemdef>.wear_represents = "string"`
 | 
					 | 
				
			||||||
	* Specifies how the tool wear level is handled. Available modes:
 | 
					 | 
				
			||||||
		* `"mechanical_wear"`: represents physical damage
 | 
					 | 
				
			||||||
		* `"technic_RE_charge"`: represents electrical charge
 | 
					 | 
				
			||||||
* `<itemdef>.technic_run = function(pos, node) ...`
 | 
					 | 
				
			||||||
	* This callback is used to update the node.
 | 
					 | 
				
			||||||
	  Modders have to manually change the information about supply etc. in the
 | 
					 | 
				
			||||||
	  node metadata.
 | 
					 | 
				
			||||||
	* Technic-registered machines use this callback by default.
 | 
					 | 
				
			||||||
* `<itemdef>.technic_disabled_machine_name = "string"`
 | 
					 | 
				
			||||||
	* Specifies the machine's node name to use when it's not connected connected to a network
 | 
					 | 
				
			||||||
* `<itemdef>.technic_on_disable = function(pos, node) ...`
 | 
					 | 
				
			||||||
	* This callback is run when the machine is no longer connected to a technic-powered network.
 | 
					 | 
				
			||||||
* `<itemdef>.technic_get_charge = function(itemstack) ...`
 | 
					 | 
				
			||||||
	* Optional callback to overwrite the default charge behaviour.
 | 
					 | 
				
			||||||
	* `itemstack`: ItemStack, the tool to analyse
 | 
					 | 
				
			||||||
	* Return values:
 | 
					 | 
				
			||||||
		* `charge`: Electrical charge of the tool
 | 
					 | 
				
			||||||
		* `max_charge`: Upper charge limit
 | 
					 | 
				
			||||||
	* Etc. `local charge, maxcharge = itemdef.technic_get_charge(itemstack)`
 | 
					 | 
				
			||||||
* `<itemdef>.technic_set_charge = function(itemstack, charge) ...`
 | 
					 | 
				
			||||||
	* Optional callback to overwrite the default charge behaviour.
 | 
					 | 
				
			||||||
	* `itemstack`: ItemStack, the tool to update
 | 
					 | 
				
			||||||
	* `charge`: numeric, value between `0` and `max_charge`
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Node Metadata fields
 | 
					 | 
				
			||||||
Nodes connected to the network will have one or more of these parameters as meta
 | 
					 | 
				
			||||||
data:
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
* `<tier>_EU_supply` - direction: output
 | 
					 | 
				
			||||||
	* For nodes registered as `PR` or `BA` tier
 | 
					 | 
				
			||||||
	* This is the EU value supplied by the node.
 | 
					 | 
				
			||||||
* `<tier>_EU_demand` - direction: output
 | 
					 | 
				
			||||||
	* For nodes registered as `RE` or `BA` tier
 | 
					 | 
				
			||||||
	* This is the EU value the node requires to run.
 | 
					 | 
				
			||||||
* `<tier>_EU_input` - direction: input
 | 
					 | 
				
			||||||
	* For nodes registered as `RE` or `BA` tier
 | 
					 | 
				
			||||||
	* This is the actual EU value the network can give the node.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
`<tier>` corresponds to the tier name registered using
 | 
					 | 
				
			||||||
`technic.register_tier` (ex. `LV`). It is possible for the machine to depend on
 | 
					 | 
				
			||||||
multiple tiers (or networks).
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Manual: Network basics
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
The switching station is the center of all power distribution on an electric
 | 
					 | 
				
			||||||
network. This node is used to calculate the power supply of the network and
 | 
					 | 
				
			||||||
to distribute the power across nodes.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
The switching station is the center of all electricity distribution. It collects
 | 
					 | 
				
			||||||
power from sources (PR), distributes it to sinks (RE), and uses the
 | 
					 | 
				
			||||||
excess/shortfall to charge and discharge batteries (BA).
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
As a thumb of rule, "EU" (energy unit) values are expressed in kW.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Network functionality:
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
1. All PR, BA, RE nodes are indexed and tagged with one switching station.
 | 
					 | 
				
			||||||
   The tagging is a workaround to allow more stations to be built without allowing
 | 
					 | 
				
			||||||
   a cheat with duplicating power.
 | 
					 | 
				
			||||||
2. All the RE nodes are queried for their current EU demand.
 | 
					 | 
				
			||||||
   If the total demand is less than the available power they are all updated
 | 
					 | 
				
			||||||
   with the demand number.
 | 
					 | 
				
			||||||
3. BA nodes are evenly charged from energy surplus.
 | 
					 | 
				
			||||||
4. Excess power draw will discharge batteries evenly.
 | 
					 | 
				
			||||||
5. If the total demand is more than the available power all RE nodes will be shut
 | 
					 | 
				
			||||||
   down. We have a brown-out situation.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Deprecated functions
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Following functions are either no longer used by technic, or are planned to
 | 
					 | 
				
			||||||
be removed soon. Please update mods depending on technic accordingly.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 * `technic.get_RE_item_load`
 | 
					 | 
				
			||||||
    * Scales the tool wear to a certain numeric range
 | 
					 | 
				
			||||||
 * `technic.set_RE_item_load`
 | 
					 | 
				
			||||||
    * Scales a certain numeric range to the tool wear
 | 
					 | 
				
			||||||
@@ -1,71 +1,20 @@
 | 
				
			|||||||
local constant_digit_count = technic.config:get("constant_digit_count")
 | 
					minetest.swap_node = minetest.swap_node or function(pos, node)
 | 
				
			||||||
 | 
						local oldmeta = minetest.get_meta(pos):to_table()
 | 
				
			||||||
-- converts a number to a readable string with SI prefix, e.g. 10000 → "10 k",
 | 
						minetest.set_node(pos, node)
 | 
				
			||||||
-- 15 → "15 ", 0.1501 → "150.1 m"
 | 
						minetest.get_meta(pos):from_table(oldmeta)
 | 
				
			||||||
-- a non-breaking space (U+a0) instead of a usual one is put after number
 | 
					 | 
				
			||||||
-- The precision is 4 digits
 | 
					 | 
				
			||||||
local prefixes = {[-8] = "y", [-7] = "z", [-6] = "a", [-5] = "f", [-4] = "p",
 | 
					 | 
				
			||||||
	[-3] = "n", [-2] = "µ", [-1] = "m", [0] = "",  [1] = "k", [2] = "M",
 | 
					 | 
				
			||||||
	[3] = "G", [4] = "T", [5] = "P", [6] = "E", [7] = "Z", [8] = "Y"}
 | 
					 | 
				
			||||||
function technic.pretty_num(num)
 | 
					 | 
				
			||||||
	-- the small number added is due to floating point inaccuracy
 | 
					 | 
				
			||||||
	local b = math.floor(math.log10(math.abs(num)) +0.000001)
 | 
					 | 
				
			||||||
	local pref_i
 | 
					 | 
				
			||||||
	if b ~= 0 then
 | 
					 | 
				
			||||||
		-- b is decremented by 1 to avoid a single digit with many decimals,
 | 
					 | 
				
			||||||
		-- e.g. instead of 1.021 MEU, 1021 kEU is shown
 | 
					 | 
				
			||||||
		pref_i = math.floor((b - 1) / 3)
 | 
					 | 
				
			||||||
	else
 | 
					 | 
				
			||||||
		-- as special case, avoid showing e.g. 1100 mEU instead of 1.1 EU
 | 
					 | 
				
			||||||
		pref_i = 0
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	if not prefixes[pref_i] then
 | 
					 | 
				
			||||||
		-- This happens for 0, nan, inf, very big values, etc.
 | 
					 | 
				
			||||||
		if num == 0 then
 | 
					 | 
				
			||||||
			-- handle 0 explicilty to avoid showing "-0"
 | 
					 | 
				
			||||||
			if not constant_digit_count then
 | 
					 | 
				
			||||||
				return "0 "
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			-- gives 0.000
 | 
					 | 
				
			||||||
			return string.format("%.3f ", 0)
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		return string.format("%.4g ", num)
 | 
					 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	num = num * 10 ^ (-3 * pref_i)
 | 
					-- Only changes name, keeps other params
 | 
				
			||||||
	if constant_digit_count then
 | 
					 | 
				
			||||||
		local comma_digits_cnt = 3 - (b - 3 * pref_i)
 | 
					 | 
				
			||||||
		return string.format("%." .. comma_digits_cnt .. "f %s",
 | 
					 | 
				
			||||||
			num, prefixes[pref_i])
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	return string.format("%.4g %s", num, prefixes[pref_i])
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- some unittests
 | 
					 | 
				
			||||||
assert(technic.pretty_num(-0) == "0 ")
 | 
					 | 
				
			||||||
assert(technic.pretty_num(0) == "0 ")
 | 
					 | 
				
			||||||
assert(technic.pretty_num(1234) == "1234 ")
 | 
					 | 
				
			||||||
assert(technic.pretty_num(123456789) == "123.5 M")
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- used to display power values
 | 
					 | 
				
			||||||
function technic.EU_string(num)
 | 
					 | 
				
			||||||
	return technic.pretty_num(num) .. "EU"
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
--- Same as minetest.swap_node, but only changes name
 | 
					 | 
				
			||||||
-- and doesn't re-set if already set.
 | 
					 | 
				
			||||||
function technic.swap_node(pos, name)
 | 
					function technic.swap_node(pos, name)
 | 
				
			||||||
	local node = minetest.get_node(pos)
 | 
						local node = minetest.get_node(pos)
 | 
				
			||||||
	if node.name ~= name then
 | 
						if node.name ~= name then
 | 
				
			||||||
		node.name = name
 | 
							node.name = name
 | 
				
			||||||
		minetest.swap_node(pos, node)
 | 
							minetest.swap_node(pos, node)
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
 | 
						return node.name
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Fully charge RE chargeable item.
 | 
				
			||||||
--- Fully charge RE chargeable item.
 | 
					 | 
				
			||||||
-- Must be defined early to reference in item definitions.
 | 
					-- Must be defined early to reference in item definitions.
 | 
				
			||||||
function technic.refill_RE_charge(stack)
 | 
					function technic.refill_RE_charge(stack)
 | 
				
			||||||
	local max_charge = technic.power_tools[stack:get_name()]
 | 
						local max_charge = technic.power_tools[stack:get_name()]
 | 
				
			||||||
@@ -77,147 +26,20 @@ function technic.refill_RE_charge(stack)
 | 
				
			|||||||
	return stack
 | 
						return stack
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 --------------------------------------------------------------------------------
 | 
				
			||||||
-- If the node is loaded, returns it.  If it isn't loaded, load it and return nil.
 | 
					local function resolve_name(function_name)
 | 
				
			||||||
function technic.get_or_load_node(pos)
 | 
						local a = _G
 | 
				
			||||||
	local node = minetest.get_node_or_nil(pos)
 | 
						for key in string.gmatch(function_name, "([^%.]+)(%.?)") do
 | 
				
			||||||
	if node then return node end
 | 
							if a[key] then
 | 
				
			||||||
	local vm = VoxelManip()
 | 
								a = a[key]
 | 
				
			||||||
	local _, _ = vm:read_from_map(pos, pos)
 | 
							else
 | 
				
			||||||
			return nil
 | 
								return nil
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						return a
 | 
				
			||||||
technic.tube_inject_item = pipeworks.tube_inject_item or function(pos, start_pos, velocity, item)
 | 
					 | 
				
			||||||
	local tubed = pipeworks.tube_item(vector.new(pos), item)
 | 
					 | 
				
			||||||
	tubed:get_luaentity().start_pos = vector.new(start_pos)
 | 
					 | 
				
			||||||
	tubed:set_velocity(velocity)
 | 
					 | 
				
			||||||
	tubed:set_acceleration(vector.new(0, 0, 0))
 | 
					 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function technic.function_exists(function_name)
 | 
				
			||||||
--- Iterates over the node positions along the specified ray.
 | 
						return type(resolve_name(function_name)) == 'function'
 | 
				
			||||||
-- The returned positions will not include the starting position.
 | 
					 | 
				
			||||||
function technic.trace_node_ray(pos, dir, range)
 | 
					 | 
				
			||||||
	local x_step = dir.x > 0 and 1 or -1
 | 
					 | 
				
			||||||
	local y_step = dir.y > 0 and 1 or -1
 | 
					 | 
				
			||||||
	local z_step = dir.z > 0 and 1 or -1
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	local i = 1
 | 
					 | 
				
			||||||
	return function(p)
 | 
					 | 
				
			||||||
		-- Approximation of where we should be if we weren't rounding
 | 
					 | 
				
			||||||
		-- to nodes.  This moves forward a bit faster then we do.
 | 
					 | 
				
			||||||
		-- A correction is done below.
 | 
					 | 
				
			||||||
		local real_x = pos.x + (dir.x * i)
 | 
					 | 
				
			||||||
		local real_y = pos.y + (dir.y * i)
 | 
					 | 
				
			||||||
		local real_z = pos.z + (dir.z * i)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		-- How far off we've gotten from where we should be.
 | 
					 | 
				
			||||||
		local dx = math.abs(real_x - p.x)
 | 
					 | 
				
			||||||
		local dy = math.abs(real_y - p.y)
 | 
					 | 
				
			||||||
		local dz = math.abs(real_z - p.z)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		-- If the real position moves ahead too fast, stop it so we
 | 
					 | 
				
			||||||
		-- can catch up.  If it gets too far ahead it will smooth
 | 
					 | 
				
			||||||
		-- out our movement too much and we won't turn fast enough.
 | 
					 | 
				
			||||||
		if dx + dy + dz < 2 then
 | 
					 | 
				
			||||||
			i = i + 1
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		-- Step in whichever direction we're most off course in.
 | 
					 | 
				
			||||||
		if dx > dy then
 | 
					 | 
				
			||||||
			if dx > dz then
 | 
					 | 
				
			||||||
				p.x = p.x + x_step
 | 
					 | 
				
			||||||
			else
 | 
					 | 
				
			||||||
				p.z = p.z + z_step
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		elseif dy > dz then
 | 
					 | 
				
			||||||
			p.y = p.y + y_step
 | 
					 | 
				
			||||||
		else
 | 
					 | 
				
			||||||
			p.z = p.z + z_step
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		if vector.distance(pos, p) > range then
 | 
					 | 
				
			||||||
			return nil
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		return p
 | 
					 | 
				
			||||||
	end, vector.round(pos)
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
--- Like trace_node_ray, but includes extra positions close to the ray.
 | 
					 | 
				
			||||||
function technic.trace_node_ray_fat(pos, dir, range)
 | 
					 | 
				
			||||||
	local x_step = dir.x > 0 and 1 or -1
 | 
					 | 
				
			||||||
	local y_step = dir.y > 0 and 1 or -1
 | 
					 | 
				
			||||||
	local z_step = dir.z > 0 and 1 or -1
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	local next_poses = {}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	local i = 1
 | 
					 | 
				
			||||||
	return function(p)
 | 
					 | 
				
			||||||
		local ni, np = next(next_poses)
 | 
					 | 
				
			||||||
		if np then
 | 
					 | 
				
			||||||
			next_poses[ni] = nil
 | 
					 | 
				
			||||||
			return np
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		-- Approximation of where we should be if we weren't rounding
 | 
					 | 
				
			||||||
		-- to nodes.  This moves forward a bit faster then we do.
 | 
					 | 
				
			||||||
		-- A correction is done below.
 | 
					 | 
				
			||||||
		local real_x = pos.x + (dir.x * i)
 | 
					 | 
				
			||||||
		local real_y = pos.y + (dir.y * i)
 | 
					 | 
				
			||||||
		local real_z = pos.z + (dir.z * i)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		-- How far off we've gotten from where we should be.
 | 
					 | 
				
			||||||
		local dx = math.abs(real_x - p.x)
 | 
					 | 
				
			||||||
		local dy = math.abs(real_y - p.y)
 | 
					 | 
				
			||||||
		local dz = math.abs(real_z - p.z)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		-- If the real position moves ahead too fast, stop it so we
 | 
					 | 
				
			||||||
		-- can catch up.  If it gets too far ahead it will smooth
 | 
					 | 
				
			||||||
		-- out our movement too much and we won't turn fast enough.
 | 
					 | 
				
			||||||
		if dx + dy + dz < 2 then
 | 
					 | 
				
			||||||
			i = i + 1
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		-- Step in whichever direction we're most off course in.
 | 
					 | 
				
			||||||
		local sx, sy, sz  -- Whether we've already stepped along each axis
 | 
					 | 
				
			||||||
		if dx > dy then
 | 
					 | 
				
			||||||
			if dx > dz then
 | 
					 | 
				
			||||||
				sx = true
 | 
					 | 
				
			||||||
				p.x = p.x + x_step
 | 
					 | 
				
			||||||
			else
 | 
					 | 
				
			||||||
				sz = true
 | 
					 | 
				
			||||||
				p.z = p.z + z_step
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		elseif dy > dz then
 | 
					 | 
				
			||||||
			sy = true
 | 
					 | 
				
			||||||
			p.y = p.y + y_step
 | 
					 | 
				
			||||||
		else
 | 
					 | 
				
			||||||
			sz = true
 | 
					 | 
				
			||||||
			p.z = p.z + z_step
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		if vector.distance(pos, p) > range then
 | 
					 | 
				
			||||||
			return nil
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		-- Add other positions that we're significantly off on.
 | 
					 | 
				
			||||||
		-- We can just use fixed integer keys here because the
 | 
					 | 
				
			||||||
		-- table will be completely cleared before we reach this
 | 
					 | 
				
			||||||
		-- code block again.
 | 
					 | 
				
			||||||
		local dlen = math.sqrt(dx*dx + dy*dy + dz*dz)
 | 
					 | 
				
			||||||
		-- Normalized axis deltas
 | 
					 | 
				
			||||||
		local dxn, dyn, dzn = dx / dlen, dy / dlen, dz / dlen
 | 
					 | 
				
			||||||
		if not sx and dxn > 0.5 then
 | 
					 | 
				
			||||||
			next_poses[1] = vector.new(p.x + x_step, p.y, p.z)
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		if not sy and dyn > 0.5 then
 | 
					 | 
				
			||||||
			next_poses[2] = vector.new(p.x, p.y + y_step, p.z)
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		if not sz and dzn > 0.5 then
 | 
					 | 
				
			||||||
			next_poses[3] = vector.new(p.x, p.y, p.z + z_step)
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		return p
 | 
					 | 
				
			||||||
	end, vector.round(pos)
 | 
					 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					--------------------------------------------------------------------------------
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,36 +1,18 @@
 | 
				
			|||||||
 | 
					-- Minetest 0.4.7 mod: technic
 | 
				
			||||||
-- namespace: technic
 | 
					-- namespace: technic
 | 
				
			||||||
-- (c) 2012-2013 by RealBadAngel <mk@realbadangel.pl>
 | 
					-- (c) 2012-2013 by RealBadAngel <mk@realbadangel.pl>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if not minetest.get_translator then
 | 
					technic = {}
 | 
				
			||||||
	error("[technic] Your Minetest version is no longer supported."
 | 
					 | 
				
			||||||
		.. " (version < 5.0.0)")
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
local load_start = os.clock()
 | 
					local load_start = os.clock()
 | 
				
			||||||
 | 
					 | 
				
			||||||
technic = rawget(_G, "technic") or {}
 | 
					 | 
				
			||||||
technic.creative_mode = minetest.settings:get_bool("creative_mode")
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
local modpath = minetest.get_modpath("technic")
 | 
					local modpath = minetest.get_modpath("technic")
 | 
				
			||||||
technic.modpath = modpath
 | 
					technic.modpath = modpath
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
-- Boilerplate to support intllib
 | 
					-- Boilerplate to support intllib
 | 
				
			||||||
if rawget(_G, "intllib") then
 | 
					if intllib then
 | 
				
			||||||
	technic.getter = intllib.Getter()
 | 
						technic.getter = intllib.Getter()
 | 
				
			||||||
else
 | 
					else
 | 
				
			||||||
	-- Intllib copypasta: TODO replace with the client-side translation API
 | 
						technic.getter = function(s) return s end
 | 
				
			||||||
	technic.getter = function(s,a,...)
 | 
					 | 
				
			||||||
		if a==nil then return s end
 | 
					 | 
				
			||||||
		a={a,...}
 | 
					 | 
				
			||||||
		return s:gsub("(@?)@(%(?)(%d+)(%)?)", function(e,o,n,c)
 | 
					 | 
				
			||||||
			if e==""then
 | 
					 | 
				
			||||||
				return a[tonumber(n)]..(o==""and c or"")
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			return "@"..o..n..c
 | 
					 | 
				
			||||||
		end)
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
local S = technic.getter
 | 
					local S = technic.getter
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -49,9 +31,6 @@ dofile(modpath.."/crafts.lua")
 | 
				
			|||||||
-- Register functions
 | 
					-- Register functions
 | 
				
			||||||
dofile(modpath.."/register.lua")
 | 
					dofile(modpath.."/register.lua")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- Radiation
 | 
					 | 
				
			||||||
dofile(modpath.."/radiation.lua")
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- Machines
 | 
					-- Machines
 | 
				
			||||||
dofile(modpath.."/machines/init.lua")
 | 
					dofile(modpath.."/machines/init.lua")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -61,7 +40,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_get("log_mod") 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
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -11,6 +11,11 @@ minetest.register_craftitem( "technic:doped_silicon_wafer", {
 | 
				
			|||||||
	inventory_image = "technic_doped_silicon_wafer.png",
 | 
						inventory_image = "technic_doped_silicon_wafer.png",
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					minetest.register_craftitem("technic:enriched_uranium", {
 | 
				
			||||||
 | 
						description = S("Enriched Uranium"),
 | 
				
			||||||
 | 
						inventory_image = "technic_enriched_uranium.png",
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
minetest.register_craftitem("technic:uranium_fuel", {
 | 
					minetest.register_craftitem("technic:uranium_fuel", {
 | 
				
			||||||
	description = S("Uranium Fuel"),
 | 
						description = S("Uranium Fuel"),
 | 
				
			||||||
	inventory_image = "technic_uranium_fuel.png",
 | 
						inventory_image = "technic_uranium_fuel.png",
 | 
				
			||||||
@@ -69,16 +74,41 @@ minetest.register_tool("technic:red_energy_crystal", {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
}) 
 | 
					}) 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					minetest.register_craftitem("technic:fine_copper_wire", {
 | 
				
			||||||
 | 
						description = S("Fine Copper Wire"),
 | 
				
			||||||
 | 
						inventory_image = "technic_fine_copper_wire.png",
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					minetest.register_craftitem("technic:fine_gold_wire", {
 | 
				
			||||||
 | 
						description = S("Fine Gold Wire"),
 | 
				
			||||||
 | 
						inventory_image = "technic_fine_gold_wire.png",
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					minetest.register_craftitem("technic:fine_silver_wire", {
 | 
				
			||||||
 | 
						description = S("Fine Silver Wire"),
 | 
				
			||||||
 | 
						inventory_image = "technic_fine_silver_wire.png",
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
minetest.register_craftitem("technic:copper_coil", {
 | 
					minetest.register_craftitem("technic:copper_coil", {
 | 
				
			||||||
	description = S("Copper Coil"),
 | 
						description = S("Copper Coil"),
 | 
				
			||||||
	inventory_image = "technic_copper_coil.png",
 | 
						inventory_image = "technic_copper_coil.png",
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					minetest.register_craftitem("technic:motor", {
 | 
				
			||||||
 | 
						description = S("Electric Motor"),
 | 
				
			||||||
 | 
						inventory_image = "technic_motor.png",
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
minetest.register_craftitem("technic:lv_transformer", {
 | 
					minetest.register_craftitem("technic:lv_transformer", {
 | 
				
			||||||
	description = S("Low Voltage Transformer"),
 | 
						description = S("Low Voltage Transformer"),
 | 
				
			||||||
	inventory_image = "technic_lv_transformer.png",
 | 
						inventory_image = "technic_lv_transformer.png",
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					minetest.register_craftitem("technic:lv_transformer", {
 | 
				
			||||||
 | 
						description = S("Low Voltage Transformer"),
 | 
				
			||||||
 | 
						inventory_image = "technic_lv_transformer.png",
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
minetest.register_craftitem("technic:mv_transformer", {
 | 
					minetest.register_craftitem("technic:mv_transformer", {
 | 
				
			||||||
	description = S("Medium Voltage Transformer"),
 | 
						description = S("Medium Voltage Transformer"),
 | 
				
			||||||
	inventory_image = "technic_mv_transformer.png",
 | 
						inventory_image = "technic_mv_transformer.png",
 | 
				
			||||||
@@ -133,76 +163,3 @@ minetest.register_node("technic:machine_casing", {
 | 
				
			|||||||
	tiles = {"technic_machine_casing.png"},
 | 
						tiles = {"technic_machine_casing.png"},
 | 
				
			||||||
	sounds = default.node_sound_stone_defaults(),
 | 
						sounds = default.node_sound_stone_defaults(),
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					 | 
				
			||||||
minetest.register_craftitem("technic:rubber_goo", {
 | 
					 | 
				
			||||||
	description = S("Rubber Goo"),
 | 
					 | 
				
			||||||
	inventory_image = "technic_rubber_goo.png",
 | 
					 | 
				
			||||||
})
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
for p = 0, 35 do
 | 
					 | 
				
			||||||
	local nici = (p ~= 0 and p ~= 7 and p ~= 35) and 1 or nil
 | 
					 | 
				
			||||||
	local psuffix = p == 7 and "" or p
 | 
					 | 
				
			||||||
	local ingot = "technic:uranium"..psuffix.."_ingot"
 | 
					 | 
				
			||||||
	local block = "technic:uranium"..psuffix.."_block"
 | 
					 | 
				
			||||||
	local ov = p == 7 and minetest.override_item or nil;
 | 
					 | 
				
			||||||
	(ov or minetest.register_craftitem)(ingot, {
 | 
					 | 
				
			||||||
		description = string.format(S("%.1f%%-Fissile Uranium Ingot"), p/10),
 | 
					 | 
				
			||||||
		inventory_image = "technic_uranium_ingot.png",
 | 
					 | 
				
			||||||
		groups = {uranium_ingot=1, not_in_creative_inventory=nici},
 | 
					 | 
				
			||||||
	});
 | 
					 | 
				
			||||||
	-- Note on radioactivity of blocks:
 | 
					 | 
				
			||||||
	-- Source: <http://www.wise-uranium.org/rup.html>
 | 
					 | 
				
			||||||
	-- The baseline radioactivity of an isotope is not especially
 | 
					 | 
				
			||||||
	-- correlated with whether it's fissile (i.e., suitable as
 | 
					 | 
				
			||||||
	-- reactor fuel).  Natural uranium consists mainly of fissile
 | 
					 | 
				
			||||||
	-- U-235 and non-fissile U-238, and both U-235 and U-238 are
 | 
					 | 
				
			||||||
	-- significantly radioactive.  U-235's massic activity is
 | 
					 | 
				
			||||||
	-- about 80.0 MBq/kg, and U-238's is about 12.4 MBq/kg, which
 | 
					 | 
				
			||||||
	-- superficially suggests that 3.5%-fissile uranium should have
 | 
					 | 
				
			||||||
	-- only 1.19 times the activity of fully-depleted uranium.
 | 
					 | 
				
			||||||
	-- But a third isotope affects the result hugely: U-234 has
 | 
					 | 
				
			||||||
	-- massic activity of 231 GBq/kg.  Natural uranium has massic
 | 
					 | 
				
			||||||
	-- composition of 99.2837% U-238, 0.711% U-235, and 0.0053% U-234,
 | 
					 | 
				
			||||||
	-- so its activity comes roughly 49% each from U-234 and U-238
 | 
					 | 
				
			||||||
	-- and only 2% from U-235.  During enrichment via centrifuge,
 | 
					 | 
				
			||||||
	-- the U-234 fraction is concentrated along with the U-235, with
 | 
					 | 
				
			||||||
	-- the U-234:U-235 ratio remaining close to its original value.
 | 
					 | 
				
			||||||
	-- (Actually the U-234 gets separated from U-238 slightly more
 | 
					 | 
				
			||||||
	-- than the U-235 is, so the U-234:U-235 ratio is slightly
 | 
					 | 
				
			||||||
	-- higher in enriched uranium.)  A typical massic composition
 | 
					 | 
				
			||||||
	-- for 3.5%-fissile uranium is 96.47116% U-238, 3.5% U-235, and
 | 
					 | 
				
			||||||
	-- 0.02884% U-234.  This gives 3.5%-fissile uranium about 6.55
 | 
					 | 
				
			||||||
	-- times the activity of fully-depleted uranium.  The values we
 | 
					 | 
				
			||||||
	-- compute here for the "radioactive" group value are based on
 | 
					 | 
				
			||||||
	-- linear interpolation of activity along that scale, rooted at
 | 
					 | 
				
			||||||
	-- a natural (0.7%-fissile) uranium block having the activity of
 | 
					 | 
				
			||||||
	-- 9 uranium ore blocks (due to 9 ingots per block).  The group
 | 
					 | 
				
			||||||
	-- value is proportional to the square root of the activity, and
 | 
					 | 
				
			||||||
	-- uranium ore has radioactive=1.  This yields radioactive=1.0
 | 
					 | 
				
			||||||
	-- for a fully-depleted uranium block and radioactive=2.6 for
 | 
					 | 
				
			||||||
	-- a 3.5%-fissile uranium block.
 | 
					 | 
				
			||||||
	local radioactivity = math.floor(math.sqrt((1+5.55*p/35) * 18 / (1+5.55*7/35)) + 0.5);
 | 
					 | 
				
			||||||
	(ov or minetest.register_node)(block, {
 | 
					 | 
				
			||||||
		description = string.format(S("%.1f%%-Fissile Uranium Block"), p/10),
 | 
					 | 
				
			||||||
		tiles = {"technic_uranium_block.png"},
 | 
					 | 
				
			||||||
		is_ground_content = true,
 | 
					 | 
				
			||||||
		groups = {uranium_block=1, not_in_creative_inventory=nici,
 | 
					 | 
				
			||||||
			cracky=1, level=2, radioactive=radioactivity},
 | 
					 | 
				
			||||||
		sounds = default.node_sound_stone_defaults(),
 | 
					 | 
				
			||||||
	});
 | 
					 | 
				
			||||||
	if not ov then
 | 
					 | 
				
			||||||
		minetest.register_craft({
 | 
					 | 
				
			||||||
			output = block,
 | 
					 | 
				
			||||||
			recipe = {
 | 
					 | 
				
			||||||
				{ingot, ingot, ingot},
 | 
					 | 
				
			||||||
				{ingot, ingot, ingot},
 | 
					 | 
				
			||||||
				{ingot, ingot, ingot},
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
		})
 | 
					 | 
				
			||||||
		minetest.register_craft({
 | 
					 | 
				
			||||||
			output = ingot.." 9",
 | 
					 | 
				
			||||||
			recipe = {{block}},
 | 
					 | 
				
			||||||
		})
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
@@ -22,20 +22,16 @@ technic.legacy_nodenames = {
 | 
				
			|||||||
	["technic:compressor"]        = "technic:lv_compressor",
 | 
						["technic:compressor"]        = "technic:lv_compressor",
 | 
				
			||||||
	["technic:compressor_active"] = "technic:lv_compressor_active",
 | 
						["technic:compressor_active"] = "technic:lv_compressor_active",
 | 
				
			||||||
	["technic:hv_battery_box"] = "technic:hv_battery_box0",
 | 
						["technic:hv_battery_box"] = "technic:hv_battery_box0",
 | 
				
			||||||
 | 
						["technic:hv_cable"] = "technic:hv_cable0",
 | 
				
			||||||
 | 
						["technic:lv_cable"] = "technic:lv_cable0",
 | 
				
			||||||
 | 
						["technic:mv_cable"] = "technic:mv_cable0",
 | 
				
			||||||
	["technic:mv_battery_box"] = "technic:mv_battery_box0",
 | 
						["technic:mv_battery_box"] = "technic:mv_battery_box0",
 | 
				
			||||||
	["technic:generator"]        = "technic:lv_generator",
 | 
						["technic:generator"]        = "technic:lv_generator",
 | 
				
			||||||
	["technic:generator_active"] = "technic:lv_generator_active",
 | 
						["technic:generator_active"] = "technic:lv_generator_active",
 | 
				
			||||||
	["technic:iron_dust"] = "technic:wrought_iron_dust",
 | 
						["technic:iron_dust"] = "technic:wrought_iron_dust",
 | 
				
			||||||
	["technic:enriched_uranium"] = "technic:uranium35_ingot",
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
for old, new in pairs(technic.legacy_nodenames) do
 | 
					for old, new in pairs(technic.legacy_nodenames) do
 | 
				
			||||||
	minetest.register_alias(old, new)
 | 
						minetest.register_alias(old, new)
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
for i = 0, 64 do
 | 
					 | 
				
			||||||
	minetest.register_alias("technic:hv_cable"..i, "technic:hv_cable")
 | 
					 | 
				
			||||||
	minetest.register_alias("technic:mv_cable"..i, "technic:mv_cable")
 | 
					 | 
				
			||||||
	minetest.register_alias("technic:lv_cable"..i, "technic:lv_cable")
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
@@ -29,14 +29,11 @@ Graphite = Graphit
 | 
				
			|||||||
Carbon Cloth = Kohlefasergewebe
 | 
					Carbon Cloth = Kohlefasergewebe
 | 
				
			||||||
Raw Latex = Rohlatex
 | 
					Raw Latex = Rohlatex
 | 
				
			||||||
Rubber Fiber = Gummifaser
 | 
					Rubber Fiber = Gummifaser
 | 
				
			||||||
%.1f%%-Fissile Uranium Ingot =
 | 
					 | 
				
			||||||
%.1f%%-Fissile Uranium Block =
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Machine misc
 | 
					## Machine misc
 | 
				
			||||||
Machine cannot be removed because it is not empty = Die Maschine kann nicht entfernt werden, weil sie noch nicht leer ist.
 | 
					Machine cannot be removed because it is not empty = Die Maschine kann nicht entfernt werden, weil sie noch nicht leer ist.
 | 
				
			||||||
Inventory move disallowed due to protection = Das Inventar ist geschuetzt, Zugriff verweigert.
 | 
					Inventory move disallowed due to protection = Das Inventar ist geschuetzt, Zugriff verweigert.
 | 
				
			||||||
# $1: Machine name (Includes tier)
 | 
					# $1: Machine name (Includes tier)
 | 
				
			||||||
@1 Active (@2 EU) = @1 ist eingeschaltet (@2 EU)
 | 
					 | 
				
			||||||
%s Active = %s ist eingeschaltet
 | 
					%s Active = %s ist eingeschaltet
 | 
				
			||||||
%s Disabled = %s ist ausgeschaltet
 | 
					%s Disabled = %s ist ausgeschaltet
 | 
				
			||||||
%s Enabled =
 | 
					%s Enabled =
 | 
				
			||||||
@@ -53,20 +50,16 @@ Upgrade Slots = Verbesserungsfaecher
 | 
				
			|||||||
In: = Rein:
 | 
					In: = Rein:
 | 
				
			||||||
Out: = Raus:
 | 
					Out: = Raus:
 | 
				
			||||||
Slot %d = Fach %d
 | 
					Slot %d = Fach %d
 | 
				
			||||||
Itemwise = Einzelstuecke
 | 
					Mode: %s = Methode: %s
 | 
				
			||||||
Stackwise = Ganzer Stapel
 | 
					single items = Einzelstuecke
 | 
				
			||||||
Owner: =
 | 
					whole stacks = Ganzer Stapel
 | 
				
			||||||
Unlocked =
 | 
					 | 
				
			||||||
Locked =
 | 
					 | 
				
			||||||
Radius: =
 | 
					 | 
				
			||||||
Enabled =
 | 
					 | 
				
			||||||
Disabled =
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Machine names
 | 
					## Machine names
 | 
				
			||||||
# $1: Tier
 | 
					# $1: Tier
 | 
				
			||||||
%s Alloy Furnace = %s Legierungsofen
 | 
					%s Alloy Furnace = %s Legierungsofen
 | 
				
			||||||
%s Battery Box = %s Batteriebox
 | 
					%s Battery Box = %s Batteriebox
 | 
				
			||||||
%s Cable = %s Kabel
 | 
					%s Cable = %s Kabel
 | 
				
			||||||
 | 
					%s CNC Machine = %s CNC-Maschine
 | 
				
			||||||
%s Compressor = %s Kompressor
 | 
					%s Compressor = %s Kompressor
 | 
				
			||||||
%s Extractor = %s Extraktor
 | 
					%s Extractor = %s Extraktor
 | 
				
			||||||
%s Forcefield Emitter = %s Kraftfeld-Emitter 
 | 
					%s Forcefield Emitter = %s Kraftfeld-Emitter 
 | 
				
			||||||
@@ -82,7 +75,7 @@ Hydro %s Generator = %s Wassermuehle
 | 
				
			|||||||
Nuclear %s Generator Core = %s Reaktorkern
 | 
					Nuclear %s Generator Core = %s Reaktorkern
 | 
				
			||||||
Small Solar %s Generator = %s Solarmodul
 | 
					Small Solar %s Generator = %s Solarmodul
 | 
				
			||||||
Wind %s Generator = %s Windmuehle
 | 
					Wind %s Generator = %s Windmuehle
 | 
				
			||||||
Self-Contained Injector = Selbstversorger-Injektor
 | 
					Injector = Injektor
 | 
				
			||||||
Constructor Mk%d = Konstruktor Modell %d
 | 
					Constructor Mk%d = Konstruktor Modell %d
 | 
				
			||||||
Frame = Rahmen
 | 
					Frame = Rahmen
 | 
				
			||||||
Frame Motor = Rahmenmotor
 | 
					Frame Motor = Rahmenmotor
 | 
				
			||||||
@@ -98,7 +91,6 @@ Fuel-Fired Furnace = Kohle-Ofen
 | 
				
			|||||||
Wind Mill Frame = Windmuehlengeruest
 | 
					Wind Mill Frame = Windmuehlengeruest
 | 
				
			||||||
Forcefield = Kraftfeld
 | 
					Forcefield = Kraftfeld
 | 
				
			||||||
Nuclear Reactor Rod Compartment = Brennstabfaecher
 | 
					Nuclear Reactor Rod Compartment = Brennstabfaecher
 | 
				
			||||||
Administrative World Anchor =
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Machine-specific
 | 
					## Machine-specific
 | 
				
			||||||
# $1: Pruduced EU
 | 
					# $1: Pruduced EU
 | 
				
			||||||
@@ -106,19 +98,48 @@ Charge = Aufladen
 | 
				
			|||||||
Discharge = Entladen
 | 
					Discharge = Entladen
 | 
				
			||||||
Power level = Energiestufe
 | 
					Power level = Energiestufe
 | 
				
			||||||
# $1: Tier $2: current_charge $3: max_charge 
 | 
					# $1: Tier $2: current_charge $3: max_charge 
 | 
				
			||||||
@1 Battery Box: @2/@3 = @1 Batteriebox: @2/@3
 | 
					%s Battery Box: %d/%d = %s Batteriebox: %d/%d
 | 
				
			||||||
# $1: Machine name $2: Supply $3: Demand
 | 
					# $1: Machine name $2: Supply $3: Demand
 | 
				
			||||||
@1. Supply: @2 Demand: @3 = @1. Versorgung: @2 Bedarf: @3
 | 
					%s. Supply: %d Demand: %d = %s. Versorgung: %d Bedarf: %d
 | 
				
			||||||
Production at %d%% = Produktion bei %d%%
 | 
					Production at %d%% = Produktion bei %d%%
 | 
				
			||||||
Choose Milling Program: = Waehle ein Fraesprogramm:
 | 
					Choose Milling Program: = Waehle ein Fraesprogramm:
 | 
				
			||||||
Slim Elements half / normal height: = Schmale Elemente von halber / normaler Hoehe:
 | 
					Slim Elements half / normal height: = Schmale Elemente von halber / normaler Hoehe:
 | 
				
			||||||
Current track %s = Aktueller Titel %s
 | 
					Current track %s = Aktueller Titel %s
 | 
				
			||||||
Stopped =
 | 
					
 | 
				
			||||||
Keeping %d/%d map blocks loaded =
 | 
					## CNC
 | 
				
			||||||
Digging not started =
 | 
					Cylinder = Zylinder
 | 
				
			||||||
Digging finished =
 | 
					Element Cross = Halbes Kreuzelement
 | 
				
			||||||
Digging %d m above machine =
 | 
					Element Cross Double = Kreuzelement
 | 
				
			||||||
Digging %d m below machine =
 | 
					Element Edge = Halbes Eckelement
 | 
				
			||||||
 | 
					Element Edge Double = Eckelement
 | 
				
			||||||
 | 
					Element End = Halbes Endelement
 | 
				
			||||||
 | 
					Element End Double = Endelement
 | 
				
			||||||
 | 
					Element Straight = Halbes aufrechtes Element
 | 
				
			||||||
 | 
					Element Straight Double = Aufrechtes Element
 | 
				
			||||||
 | 
					Element T = Halbes T-Element
 | 
				
			||||||
 | 
					Element T Double = T-Element
 | 
				
			||||||
 | 
					Horizontal Cylinder = Liegender Zylinder
 | 
				
			||||||
 | 
					One Curved Edge Block = Block mit einer abgerundeten Kante
 | 
				
			||||||
 | 
					Pyramid = Pyramide
 | 
				
			||||||
 | 
					Slope = Schraege
 | 
				
			||||||
 | 
					Slope Edge = Schraege mit Ecke
 | 
				
			||||||
 | 
					Slope Inner Edge = Schraege mit Innenecke
 | 
				
			||||||
 | 
					Slope Lying = Liegende Schraege
 | 
				
			||||||
 | 
					Slope Upside Down = Umgedrehte Schraege
 | 
				
			||||||
 | 
					Slope Upside Down Edge = Umgedrehte Schraege mit Ecke
 | 
				
			||||||
 | 
					Slope Upside Down Inner Edge = Umgedrehte Schraege mit Innenecke
 | 
				
			||||||
 | 
					Sphere = Kugel
 | 
				
			||||||
 | 
					Spike = Spitze
 | 
				
			||||||
 | 
					Stick = Stange
 | 
				
			||||||
 | 
					Two Curved Edge Block = Block mit zwei abgerundeten Kanten
 | 
				
			||||||
 | 
					Brick = Ziegel:
 | 
				
			||||||
 | 
					Cobble = Pflasterstein:
 | 
				
			||||||
 | 
					Dirt = Erde:
 | 
				
			||||||
 | 
					Leaves = Laub:
 | 
				
			||||||
 | 
					Sandstone = Sandstein:
 | 
				
			||||||
 | 
					Stone = Stein:
 | 
				
			||||||
 | 
					Tree = Baumstamm:
 | 
				
			||||||
 | 
					Wooden = Holz:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Grinder Recipes
 | 
					## Grinder Recipes
 | 
				
			||||||
# $1: Name
 | 
					# $1: Name
 | 
				
			||||||
@@ -141,7 +162,6 @@ Talinite = Talinite
 | 
				
			|||||||
Tin = Zinn
 | 
					Tin = Zinn
 | 
				
			||||||
Wrought Iron = Schmiedeeisen
 | 
					Wrought Iron = Schmiedeeisen
 | 
				
			||||||
Zinc = Zink
 | 
					Zinc = Zink
 | 
				
			||||||
%.1f%%-Fissile Uranium =
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Tools
 | 
					## Tools
 | 
				
			||||||
RE Battery = Akkubatterie
 | 
					RE Battery = Akkubatterie
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -29,14 +29,11 @@ Graphite = Grafito
 | 
				
			|||||||
Carbon Cloth = Tela de Carbon
 | 
					Carbon Cloth = Tela de Carbon
 | 
				
			||||||
Raw Latex = Latex Crudo
 | 
					Raw Latex = Latex Crudo
 | 
				
			||||||
Rubber Fiber = Fibra de Hule
 | 
					Rubber Fiber = Fibra de Hule
 | 
				
			||||||
%.1f%%-Fissile Uranium Ingot =
 | 
					 | 
				
			||||||
%.1f%%-Fissile Uranium Block =
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Machine misc
 | 
					## Machine misc
 | 
				
			||||||
Machine cannot be removed because it is not empty = La maquina no puede removerse porque no esta vacia
 | 
					Machine cannot be removed because it is not empty = La maquina no puede removerse porque no esta vacia
 | 
				
			||||||
Inventory move disallowed due to protection =
 | 
					Inventory move disallowed due to protection =
 | 
				
			||||||
# $1: Machine name (Includes tier)
 | 
					# $1: Machine name (Includes tier)
 | 
				
			||||||
@1 Active (@2 EU) = @1 Activo (@2 EU)
 | 
					 | 
				
			||||||
%s Active = %s Activo
 | 
					%s Active = %s Activo
 | 
				
			||||||
%s Enabled =
 | 
					%s Enabled =
 | 
				
			||||||
%s Idle = %s Quieto
 | 
					%s Idle = %s Quieto
 | 
				
			||||||
@@ -49,20 +46,13 @@ Inventory move disallowed due to protection =
 | 
				
			|||||||
%s Improperly Placed = %s No Colocado Apropiadamente
 | 
					%s Improperly Placed = %s No Colocado Apropiadamente
 | 
				
			||||||
Range = Alcance
 | 
					Range = Alcance
 | 
				
			||||||
Enable/Disable = Habilitar/Deshabilitar
 | 
					Enable/Disable = Habilitar/Deshabilitar
 | 
				
			||||||
Itemwise =
 | 
					 | 
				
			||||||
Stackwise =
 | 
					 | 
				
			||||||
Owner: =
 | 
					 | 
				
			||||||
Unlocked =
 | 
					 | 
				
			||||||
Locked =
 | 
					 | 
				
			||||||
Radius: =
 | 
					 | 
				
			||||||
Enabled =
 | 
					 | 
				
			||||||
Disabled =
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Machine names
 | 
					## Machine names
 | 
				
			||||||
# $1: Tier
 | 
					# $1: Tier
 | 
				
			||||||
%s Alloy Furnace = Horno de Aleacion %s
 | 
					%s Alloy Furnace = Horno de Aleacion %s
 | 
				
			||||||
%s Battery Box = Caja de Bateria %s
 | 
					%s Battery Box = Caja de Bateria %s
 | 
				
			||||||
%s Cable = Cable %s
 | 
					%s Cable = Cable %s
 | 
				
			||||||
 | 
					%s CNC Machine = Maquina CNC %s
 | 
				
			||||||
%s Compressor = Compresor %s
 | 
					%s Compressor = Compresor %s
 | 
				
			||||||
%s Extractor = Extractor %s
 | 
					%s Extractor = Extractor %s
 | 
				
			||||||
%s Forcefield Emitter = Emisor de Campo de Fuerza %s
 | 
					%s Forcefield Emitter = Emisor de Campo de Fuerza %s
 | 
				
			||||||
@@ -78,7 +68,7 @@ Hydro %s Generator = Molino de Agua %s
 | 
				
			|||||||
Nuclear %s Generator Core = Nucleo de Reactor Nuclear %s
 | 
					Nuclear %s Generator Core = Nucleo de Reactor Nuclear %s
 | 
				
			||||||
Small Solar %s Generator = Panel Solar %s
 | 
					Small Solar %s Generator = Panel Solar %s
 | 
				
			||||||
Wind %s Generator = Molino de Viento %s
 | 
					Wind %s Generator = Molino de Viento %s
 | 
				
			||||||
Self-Contained Injector =
 | 
					Injector =
 | 
				
			||||||
Constructor Mk%d =
 | 
					Constructor Mk%d =
 | 
				
			||||||
Frame =
 | 
					Frame =
 | 
				
			||||||
Frame Motor =
 | 
					Frame Motor =
 | 
				
			||||||
@@ -94,7 +84,6 @@ Fuel-Fired Furnace = Horno a Carbon
 | 
				
			|||||||
Forcefield = Campo de Fuerza
 | 
					Forcefield = Campo de Fuerza
 | 
				
			||||||
Nuclear Reactor Rod Compartment = Compartimiento para Vara de Reactor Nuclear
 | 
					Nuclear Reactor Rod Compartment = Compartimiento para Vara de Reactor Nuclear
 | 
				
			||||||
Wind Mill Frame = Armazon de Molino de Viento
 | 
					Wind Mill Frame = Armazon de Molino de Viento
 | 
				
			||||||
Administrative World Anchor =
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Machine-specific
 | 
					## Machine-specific
 | 
				
			||||||
# $1: Pruduced EU
 | 
					# $1: Pruduced EU
 | 
				
			||||||
@@ -102,17 +91,45 @@ Charge = Cargar
 | 
				
			|||||||
Discharge = Descargar
 | 
					Discharge = Descargar
 | 
				
			||||||
Power level = Nivel de Poder
 | 
					Power level = Nivel de Poder
 | 
				
			||||||
# $1: Tier $2: current_charge $3: max_charge 
 | 
					# $1: Tier $2: current_charge $3: max_charge 
 | 
				
			||||||
@1 Battery Box: @2/@3 = Caja de Bateria @1: @2/@3
 | 
					%s Battery Box: %d/%d = Caja de Bateria %s: %d/%d
 | 
				
			||||||
# $1: Machine name $2: Supply $3: Demand
 | 
					# $1: Machine name $2: Supply $3: Demand
 | 
				
			||||||
@1. Supply: @2 Demand: @3 = @1. Alimentacion: @2 Demanda: @3
 | 
					%s. Supply: %d Demand: %d = %s. Alimentacion: %d Demanda: %d
 | 
				
			||||||
# $1: Production percent
 | 
					# $1: Production percent
 | 
				
			||||||
Production at %d%% = Produccion en %d%%
 | 
					Production at %d%% = Produccion en %d%%
 | 
				
			||||||
Stopped =
 | 
					
 | 
				
			||||||
Keeping %d/%d map blocks loaded =
 | 
					## CNC Machine
 | 
				
			||||||
Digging not started =
 | 
					Element Edge = Elemento Borde
 | 
				
			||||||
Digging finished =
 | 
					Tree = Arbol
 | 
				
			||||||
Digging %d m above machine =
 | 
					Element Cross Double = Elemento Cruz Doble
 | 
				
			||||||
Digging %d m below machine =
 | 
					Spike = Pica
 | 
				
			||||||
 | 
					Element Edge Double = Elemento Borde Doble
 | 
				
			||||||
 | 
					Two Curved Edge Block = Dos Bloques de Borde Curvados
 | 
				
			||||||
 | 
					Pyramid = Piramide
 | 
				
			||||||
 | 
					Slope Upside Down Inner Edge = Borde Interno de Rampa Al Reves
 | 
				
			||||||
 | 
					Slope Upside Down Edge = Borde de Rampa Al Reves
 | 
				
			||||||
 | 
					Element Straight Double = Elemento Doble Recto
 | 
				
			||||||
 | 
					Sphere = Esfera
 | 
				
			||||||
 | 
					Element End Double = Doble Fin de Elemento
 | 
				
			||||||
 | 
					Element Straight = Recta de Elemento
 | 
				
			||||||
 | 
					Horizontal Cylinder = Cilindro Horizontal
 | 
				
			||||||
 | 
					Slope Inner Edge = Borde Interno de Rampa
 | 
				
			||||||
 | 
					One Curved Edge Block = Un Bloque de Borde Curvado
 | 
				
			||||||
 | 
					Element Cross = Cruce de Elementos
 | 
				
			||||||
 | 
					Stick = Varita
 | 
				
			||||||
 | 
					Element End = Fin de Elemento
 | 
				
			||||||
 | 
					Slope Lying = Rampa en Reposo
 | 
				
			||||||
 | 
					Slope Upside Down = Rampa Al Reves
 | 
				
			||||||
 | 
					Slope Edge = Borde de Rampa
 | 
				
			||||||
 | 
					Slope = Rampa
 | 
				
			||||||
 | 
					Element T = Elemento T
 | 
				
			||||||
 | 
					Cylinder = Cilindro
 | 
				
			||||||
 | 
					Cobble = Adoquines
 | 
				
			||||||
 | 
					Stone = Piedra
 | 
				
			||||||
 | 
					Brick = Ladrillo
 | 
				
			||||||
 | 
					Dirt = Tierra
 | 
				
			||||||
 | 
					Sandstone = Arenisca
 | 
				
			||||||
 | 
					Wooden = Madera
 | 
				
			||||||
 | 
					Leaves = Hojas
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Grinder Recipes
 | 
					## Grinder Recipes
 | 
				
			||||||
# $1: Name
 | 
					# $1: Name
 | 
				
			||||||
@@ -135,7 +152,6 @@ Talinite = Talinita
 | 
				
			|||||||
Tin = Estanio
 | 
					Tin = Estanio
 | 
				
			||||||
Wrought Iron = Hierro Forjado
 | 
					Wrought Iron = Hierro Forjado
 | 
				
			||||||
Zinc = Zinc
 | 
					Zinc = Zinc
 | 
				
			||||||
%.1f%%-Fissile Uranium =
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Tools
 | 
					## Tools
 | 
				
			||||||
RE Battery =
 | 
					RE Battery =
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,215 +0,0 @@
 | 
				
			|||||||
# template.txt
 | 
					 | 
				
			||||||
# Template for translations of Technic
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Misc
 | 
					 | 
				
			||||||
[Technic] Loaded in %f seconds                          = [Technic] Chargement en %f secondes
 | 
					 | 
				
			||||||
                                                        
 | 
					 | 
				
			||||||
## Items                                                
 | 
					 | 
				
			||||||
Silicon Wafer                                           = Tranche de silicium
 | 
					 | 
				
			||||||
Doped Silicon Wafer                                     = Tranche de silicium doppée
 | 
					 | 
				
			||||||
Enriched Uranium                                        = Uranium enrichi
 | 
					 | 
				
			||||||
Uranium Fuel                                            = Uranium 235
 | 
					 | 
				
			||||||
Diamond Drill Head                                      = Tête de forage en diamant
 | 
					 | 
				
			||||||
Blue Energy Crystal                                     = Cristal d'énergie bleu
 | 
					 | 
				
			||||||
Green Energy Crystal                                    = Cristal d'énergie vert
 | 
					 | 
				
			||||||
Red Energy Crystal                                      = Cristal d'énergie rouge
 | 
					 | 
				
			||||||
Fine Copper Wire                                        = Fil en cuivre fin
 | 
					 | 
				
			||||||
Fine Gold Wire                                          = Fil en or fin
 | 
					 | 
				
			||||||
Fine Silver Wire                                        = Fil en argent fin
 | 
					 | 
				
			||||||
Copper Coil                                             = Bobine de cuivre
 | 
					 | 
				
			||||||
Electric Motor                                          = Moteur électrique
 | 
					 | 
				
			||||||
Low Voltage Transformer                                 = Transformateur basse tension
 | 
					 | 
				
			||||||
Medium Voltage Transformer                              = Transformateur moyenne tension
 | 
					 | 
				
			||||||
High Voltage Transformer                                = Transformateur haute tension
 | 
					 | 
				
			||||||
Control Logic Unit                                      = Unité de contrôle logique
 | 
					 | 
				
			||||||
Mixed Metal Ingot                                       = Lingot de métal allié
 | 
					 | 
				
			||||||
Composite Plate                                         = Plaque composite
 | 
					 | 
				
			||||||
Copper Plate                                            = Plaque de cuivre
 | 
					 | 
				
			||||||
Carbon Plate                                            = Plaque de carbone
 | 
					 | 
				
			||||||
Graphite                                                = Graphite
 | 
					 | 
				
			||||||
Carbon Cloth                                            = Fibre de carbone
 | 
					 | 
				
			||||||
Raw Latex                                               = Latex brut
 | 
					 | 
				
			||||||
Rubber Fiber                                            = Fibre de caoutchouc
 | 
					 | 
				
			||||||
%.1f%%-Fissile Uranium Ingot                            = Lingot d'uranium fissile (%.1f%%)
 | 
					 | 
				
			||||||
%.1f%%-Fissile Uranium Block                            = Bloc d'uranium fissile (%.1f%%)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Machine misc
 | 
					 | 
				
			||||||
Machine cannot be removed because it is not empty       = La machine ne peut pas être retirée car elle n'est pas vide
 | 
					 | 
				
			||||||
Inventory move disallowed due to protection             = Le mouvement d'inventaire n'est pas autorisé en raison de la protection
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# $1: Machine name (Includes tier)
 | 
					 | 
				
			||||||
@1 Active (@2 EU)                                       = @1 Active (@2 EU)
 | 
					 | 
				
			||||||
%s Active                                               = %s actif
 | 
					 | 
				
			||||||
%s Disabled                                             = %s désactivé
 | 
					 | 
				
			||||||
%s Enabled                                              = %s activé
 | 
					 | 
				
			||||||
%s Idle                                                 = %s au repos
 | 
					 | 
				
			||||||
%s Improperly Placed                                    = %s est mal placé
 | 
					 | 
				
			||||||
%s is empty                                             = %s est vide
 | 
					 | 
				
			||||||
%s Unpowered                                            = %s non alimenté en énergie
 | 
					 | 
				
			||||||
%s Out Of Fuel                                          = %s plus de carburant
 | 
					 | 
				
			||||||
%s Has Bad Cabling                                      = %s est mal cablé
 | 
					 | 
				
			||||||
%s (Slave)                                              = %s (esclave)
 | 
					 | 
				
			||||||
%s Has No Network                                       = %s n'a pas de réseau
 | 
					 | 
				
			||||||
%s Finished                                             = %s a fini
 | 
					 | 
				
			||||||
Enable/Disable                                          = Activer/Désactiver
 | 
					 | 
				
			||||||
Range                                                   = Plage
 | 
					 | 
				
			||||||
Upgrade Slots                                           = Emplacement d'amélioration
 | 
					 | 
				
			||||||
In:                                                     = Entrée :
 | 
					 | 
				
			||||||
Out:                                                    = Sortie :
 | 
					 | 
				
			||||||
Slot %d                                                 = Emplacement %d
 | 
					 | 
				
			||||||
Itemwise                                                = Item par Item
 | 
					 | 
				
			||||||
Stackwise                                               = Stack par Stack
 | 
					 | 
				
			||||||
Ignoring Mesecon Signal                                 = Ignorer le signal Mesecon
 | 
					 | 
				
			||||||
Controlled by Mesecon Signal                            = Contrôlé par signal Mesecon
 | 
					 | 
				
			||||||
Owner:                                                  = Propriétaire :
 | 
					 | 
				
			||||||
Unlocked                                                = Déverrouillé
 | 
					 | 
				
			||||||
Locked                                                  = Verrouillé
 | 
					 | 
				
			||||||
Radius:                                                 = Rayon :
 | 
					 | 
				
			||||||
Enabled                                                 = Activé
 | 
					 | 
				
			||||||
Disabled                                                = Désactivé
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Machine names
 | 
					 | 
				
			||||||
# $1: Tier
 | 
					 | 
				
			||||||
%s Alloy Furnace                                        = Four à alliage %s
 | 
					 | 
				
			||||||
%s Battery Box                                          = Batterie %s
 | 
					 | 
				
			||||||
%s Cable                                                = Câble %s
 | 
					 | 
				
			||||||
%s CNC Machine                                          = Machine-outils %s
 | 
					 | 
				
			||||||
%s Centrifuge                                           = Centrifugeuse %s
 | 
					 | 
				
			||||||
%s Compressor                                           = Compresseur %s
 | 
					 | 
				
			||||||
%s Extractor                                            = Extracteur %s
 | 
					 | 
				
			||||||
%s Forcefield Emitter                                   = Emetteur de champ de force %s
 | 
					 | 
				
			||||||
%s Furnace                                              = Four %s
 | 
					 | 
				
			||||||
%s Grinder                                              = Broyeur %s
 | 
					 | 
				
			||||||
%s Music Player                                         = Grammophone %s
 | 
					 | 
				
			||||||
%s Quarry                                               = Carrière %s
 | 
					 | 
				
			||||||
%s Tool Workshop                                        = Atelier d'outillage %s
 | 
					 | 
				
			||||||
Arrayed Solar %s Generator                              = Générateur solaire %s
 | 
					 | 
				
			||||||
Fuel-Fired %s Generator                                 = Générateur thermique %s
 | 
					 | 
				
			||||||
Geothermal %s Generator                                 = Géénarteur géothermique %s
 | 
					 | 
				
			||||||
Hydro %s Generator                                      = Générateur hydroélectrique %s
 | 
					 | 
				
			||||||
Nuclear %s Generator Core                               = Générateur nucléaire %
 | 
					 | 
				
			||||||
Small Solar %s Generator                                = Petit générateur solaire %s
 | 
					 | 
				
			||||||
Wind %s Generator                                       = Générateur éolien %s
 | 
					 | 
				
			||||||
Self-Contained Injector                                 = Injecteur autonome
 | 
					 | 
				
			||||||
Constructor Mk%d                                        = Constructeur Mk%d
 | 
					 | 
				
			||||||
Frame                                                   = Cadre
 | 
					 | 
				
			||||||
Frame Motor                                             = Cadre de moteur
 | 
					 | 
				
			||||||
Template                                                = Modèle
 | 
					 | 
				
			||||||
Template (replacing)                                    =
 | 
					 | 
				
			||||||
Template Motor                                          =
 | 
					 | 
				
			||||||
Template Tool                                           =
 | 
					 | 
				
			||||||
Battery Box                                             = Compartiment à batterie
 | 
					 | 
				
			||||||
Supply Converter                                        = Convertisseur de tension
 | 
					 | 
				
			||||||
Switching Station                                       = Station de commutation
 | 
					 | 
				
			||||||
Fuel-Fired Alloy Furnace                                = Four à alliage à carburant
 | 
					 | 
				
			||||||
Fuel-Fired Furnace                                      = Four à carburant
 | 
					 | 
				
			||||||
Wind Mill Frame                                         = Cadre d'éolienne
 | 
					 | 
				
			||||||
Forcefield                                              = Champ de force
 | 
					 | 
				
			||||||
Nuclear Reactor Rod Compartment                         = Compartiment à barres du réacteur nucléaire
 | 
					 | 
				
			||||||
Administrative World Anchor                             =
 | 
					 | 
				
			||||||
                                                        
 | 
					 | 
				
			||||||
## Machine-specific                                     
 | 
					 | 
				
			||||||
# $1: Pruduced EU                                       
 | 
					 | 
				
			||||||
Charge                                                  = Charger
 | 
					 | 
				
			||||||
Discharge                                               = Décharger
 | 
					 | 
				
			||||||
Power level                                             = Niveau d'énergie
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# $1: Tier $2: current_charge $3: max_charge 
 | 
					 | 
				
			||||||
@1 Battery Box: @2/@3                                   = @1 batterie : @2/@3
 | 
					 | 
				
			||||||
                                                        
 | 
					 | 
				
			||||||
# $1: Machine name $2: Supply $3: Demand                
 | 
					 | 
				
			||||||
@1. Supply: @2 Demand: @3                               = @1. fournit : @2 demande : @3
 | 
					 | 
				
			||||||
Production at %d%%                                      = Production à %d%%
 | 
					 | 
				
			||||||
Choose Milling Program:                                 = Choisissez le programme de fraisage :
 | 
					 | 
				
			||||||
Slim Elements half / normal height:                     =
 | 
					 | 
				
			||||||
Current track %s                                        = Morceau actuel %s
 | 
					 | 
				
			||||||
Stopped                                                 = Arrêté
 | 
					 | 
				
			||||||
Keeping %d/%d map blocks loaded                         =
 | 
					 | 
				
			||||||
Digging not started                                     = Creusement non démarré
 | 
					 | 
				
			||||||
Digging finished                                        = Creusement terminé
 | 
					 | 
				
			||||||
Digging %d m above machine                              = Creusement à %dm au dessus de la machine
 | 
					 | 
				
			||||||
Digging %d m below machine                              = Creusement à %dm en dessous de la machine
 | 
					 | 
				
			||||||
@1 (@2 @3 -> @4 @5)                                     = @1 (@2 @3 -> @4 @5)
 | 
					 | 
				
			||||||
                                                        
 | 
					 | 
				
			||||||
## CNC                                                  
 | 
					 | 
				
			||||||
Cylinder                                                =
 | 
					 | 
				
			||||||
Element Cross                                           = Elément croisé
 | 
					 | 
				
			||||||
Element Cross Double                                    = Elément croisé (double)
 | 
					 | 
				
			||||||
Element Edge                                            = Elément de bordure
 | 
					 | 
				
			||||||
Element Edge Double                                     = Elément de bordure (double)
 | 
					 | 
				
			||||||
Element End                                             = Elément de fin
 | 
					 | 
				
			||||||
Element End Double                                      = Elément de fin (double)
 | 
					 | 
				
			||||||
Element Straight                                        = Elément droit
 | 
					 | 
				
			||||||
Element Straight Double                                 = Elément droit (double)
 | 
					 | 
				
			||||||
Element T                                               = Elément en T
 | 
					 | 
				
			||||||
Element T Double                                        = Elément en T (double)
 | 
					 | 
				
			||||||
Horizontal Cylinder                                     = Cylindre horizontal
 | 
					 | 
				
			||||||
One Curved Edge Block                                   = Bloc à un bord incurvé
 | 
					 | 
				
			||||||
Pyramid                                                 = Pyramide
 | 
					 | 
				
			||||||
Slope                                                   = Pente
 | 
					 | 
				
			||||||
Slope Edge                                              =
 | 
					 | 
				
			||||||
Slope Inner Edge                                        =
 | 
					 | 
				
			||||||
Slope Lying                                             =
 | 
					 | 
				
			||||||
Slope Upside Down                                       =
 | 
					 | 
				
			||||||
Slope Upside Down Edge                                  =
 | 
					 | 
				
			||||||
Slope Upside Down Inner Edge                            =
 | 
					 | 
				
			||||||
Sphere                                                  = Sphère
 | 
					 | 
				
			||||||
Spike                                                   = Pointe
 | 
					 | 
				
			||||||
Stick                                                   = Bâton
 | 
					 | 
				
			||||||
Two Curved Edge Block                                   = Bloc à deux bords incurvés
 | 
					 | 
				
			||||||
Brick                                                   = Brique
 | 
					 | 
				
			||||||
Cobble                                                  = Pierre taillée
 | 
					 | 
				
			||||||
Dirt                                                    = Terre
 | 
					 | 
				
			||||||
Leaves                                                  = Feuilles
 | 
					 | 
				
			||||||
Sandstone                                               = Grès
 | 
					 | 
				
			||||||
Stone                                                   = Pierre
 | 
					 | 
				
			||||||
Tree                                                    = Arbre
 | 
					 | 
				
			||||||
Wooden                                                  = Bois
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Grinder Recipes
 | 
					 | 
				
			||||||
# $1: Name
 | 
					 | 
				
			||||||
%s Dust                                                 = Poudre de %s
 | 
					 | 
				
			||||||
Akalin                                                  =
 | 
					 | 
				
			||||||
Alatro                                                  =
 | 
					 | 
				
			||||||
Arol                                                    =
 | 
					 | 
				
			||||||
Brass                                                   = Laiton
 | 
					 | 
				
			||||||
Bronze                                                  = Bronze
 | 
					 | 
				
			||||||
Carbon Steel                                            = Acier au carbone
 | 
					 | 
				
			||||||
Cast Iron                                               = Fonte
 | 
					 | 
				
			||||||
Chromium                                                = Chrome
 | 
					 | 
				
			||||||
Coal                                                    = Charbon
 | 
					 | 
				
			||||||
Copper                                                  = Cuivre
 | 
					 | 
				
			||||||
Gold                                                    = Or
 | 
					 | 
				
			||||||
Mithril                                                 = Mithril
 | 
					 | 
				
			||||||
Silver                                                  = Argent
 | 
					 | 
				
			||||||
Stainless Steel                                         = Acier inoxydable
 | 
					 | 
				
			||||||
Talinite                                                = Talanite
 | 
					 | 
				
			||||||
Tin                                                     = Etain
 | 
					 | 
				
			||||||
Wrought Iron                                            = Fer
 | 
					 | 
				
			||||||
Zinc                                                    = Zinc
 | 
					 | 
				
			||||||
%.1f%%-Fissile Uranium                                  = Uranium fissile (%.1f%%)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Tools
 | 
					 | 
				
			||||||
RE Battery                                              = Batterie RE
 | 
					 | 
				
			||||||
Water Can                                               = Jerrycan d'eau
 | 
					 | 
				
			||||||
Lava Can                                                = Jerrycan de lave
 | 
					 | 
				
			||||||
Chainsaw                                                = Tronçonneuse
 | 
					 | 
				
			||||||
Flashlight                                              = Lampe-torche
 | 
					 | 
				
			||||||
3 nodes deep.                                           =
 | 
					 | 
				
			||||||
3 nodes tall.                                           =
 | 
					 | 
				
			||||||
3 nodes wide.                                           =
 | 
					 | 
				
			||||||
3x3 nodes.                                              =
 | 
					 | 
				
			||||||
Use while sneaking to change Mining Drill Mk%d modes.   =
 | 
					 | 
				
			||||||
Mining Drill Mk%d Mode %d                               = Foreuse Mk%d Mode %d
 | 
					 | 
				
			||||||
Mining Drill Mk%d                                       = Foreuse Mk%d
 | 
					 | 
				
			||||||
Mining Laser Mk%d                                       = Foreuse laser Mk%d
 | 
					 | 
				
			||||||
Single node.                                            = Mode simple.
 | 
					 | 
				
			||||||
Sonic Screwdriver                                       = Tournevis supersonique
 | 
					 | 
				
			||||||
Tree Tap                                                = Robinet à sève
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Craft descriptions
 | 
					 | 
				
			||||||
Alloy cooking                                           = Fonderie d'alliage
 | 
					 | 
				
			||||||
Grinding                                                = Broyage
 | 
					 | 
				
			||||||
Compressing                                             = Compression
 | 
					 | 
				
			||||||
Extracting                                              = Extraction
 | 
					 | 
				
			||||||
Separating                                              = Séparation
 | 
					 | 
				
			||||||
@@ -26,17 +26,14 @@ 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 Block = %.1f%%-Blocco di uranio fissile
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
## 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
 | 
				
			||||||
Inventory move disallowed due to protection = Impossibile muovere l'inventario a causa della protezione
 | 
					Inventory move disallowed due to protection = Impossibile muovere l'inventario a causa della protezione
 | 
				
			||||||
# $1: Machine name (Includes tier)
 | 
					# $1: Machine name (Includes tier)
 | 
				
			||||||
@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,24 +43,20 @@ 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
 | 
					Mode: %s = Modalità: %s
 | 
				
			||||||
Stackwise = pila completa
 | 
					single items = Singolo elemento
 | 
				
			||||||
Owner: = Proprietario:
 | 
					whole stacks = pila completa
 | 
				
			||||||
Unlocked = Non chiuso a chiave
 | 
					 | 
				
			||||||
Locked = Chiuso a chiave
 | 
					 | 
				
			||||||
Radius: = Raggio:
 | 
					 | 
				
			||||||
Enabled = Abilitato
 | 
					 | 
				
			||||||
Disabled = Disabilitato
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Machine names
 | 
					## Machine names
 | 
				
			||||||
# $1: Tier
 | 
					# $1: Tier
 | 
				
			||||||
%s Alloy Furnace = %s Fornace per leghe
 | 
					%s Alloy Furnace = %s Fornace per leghe
 | 
				
			||||||
%s Battery Box =  %s Box batterie
 | 
					%s Battery Box =  %s Box batterie
 | 
				
			||||||
%s Cable = Cavo %s
 | 
					%s Cable = Cavo %s
 | 
				
			||||||
 | 
					%s CNC Machine = Tornio CNC %s
 | 
				
			||||||
%s Compressor = Compressore %s
 | 
					%s Compressor = Compressore %s
 | 
				
			||||||
%s Extractor = Estrattore %s
 | 
					%s Extractor = Estrattore %s
 | 
				
			||||||
%s Forcefield Emitter = Emettitore di campo di forza %s
 | 
					%s Forcefield Emitter = Emettitore di campo di forza %s
 | 
				
			||||||
@@ -79,14 +72,14 @@ Hydro %s Generator = Turbina Elettrica %s
 | 
				
			|||||||
Nuclear %s Generator Core = Reattore nucleare %s
 | 
					Nuclear %s Generator Core = Reattore nucleare %s
 | 
				
			||||||
Small Solar %s Generator = %s Pannello solare
 | 
					Small Solar %s Generator = %s Pannello solare
 | 
				
			||||||
Wind %s Generator = %s Generatore eolico
 | 
					Wind %s Generator = %s Generatore eolico
 | 
				
			||||||
Self-Contained Injector = Ignettore
 | 
					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
 | 
				
			||||||
@@ -95,7 +88,6 @@ 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
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Machine-specific
 | 
					## Machine-specific
 | 
				
			||||||
# $1: Pruduced EU
 | 
					# $1: Pruduced EU
 | 
				
			||||||
@@ -103,19 +95,48 @@ Charge = Carica
 | 
				
			|||||||
Discharge = Scarica
 | 
					Discharge = Scarica
 | 
				
			||||||
Power level = Livello di potenza
 | 
					Power level = Livello di potenza
 | 
				
			||||||
# $1: Tier $2: current_charge $3: max_charge
 | 
					# $1: Tier $2: current_charge $3: max_charge
 | 
				
			||||||
@1 Battery Box: @2/@3 = @1 Box Batterie: @2/@3
 | 
					%s Battery Box: %d/%d = %s Box Batterie: %d/%d
 | 
				
			||||||
# $1: Machine name $2: Supply $3: Demand
 | 
					# $1: Machine name $2: Supply $3: Demand
 | 
				
			||||||
@1. Supply: @2 Demand: @3 = @1. Prodotto: @2 Consumato: @3
 | 
					%s. Supply: %d Demand: %d = %s. Prodotto: %d Consumato: %d
 | 
				
			||||||
Production at %d%% = Produzione a %d%%
 | 
					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
 | 
					
 | 
				
			||||||
Keeping %d/%d map blocks loaded = Mantenimento di %d/%d blocchi mappa caricati
 | 
					## CNC
 | 
				
			||||||
Digging not started = Scavo non iniziato
 | 
					Cylinder = Cilindro
 | 
				
			||||||
Digging finished = Scavo finito
 | 
					Element Cross = Elemento a croce
 | 
				
			||||||
Digging %d m above machine = Scavo di %d m sopra la macchina
 | 
					Element Cross Double = Elemento a croce doppio
 | 
				
			||||||
Digging %d m below machine = Scavo di %d m sotto la macchina
 | 
					Element Edge = Elemento bordo
 | 
				
			||||||
 | 
					Element Edge Double = Elemento bordo doppio
 | 
				
			||||||
 | 
					Element End = Elemento finale
 | 
				
			||||||
 | 
					Element End Double = Elemento finale doppio
 | 
				
			||||||
 | 
					Element Straight = Elemento dritto
 | 
				
			||||||
 | 
					Element Straight Double = Elemento dritto doppio
 | 
				
			||||||
 | 
					Element T = Elemento a T
 | 
				
			||||||
 | 
					Element T Double = Elemento a T doppio
 | 
				
			||||||
 | 
					Horizontal Cylinder = Cilindro orizzontale
 | 
				
			||||||
 | 
					One Curved Edge Block = Blocco con bordo curvo
 | 
				
			||||||
 | 
					Pyramid = Piramide
 | 
				
			||||||
 | 
					Slope = Inclinato
 | 
				
			||||||
 | 
					Slope Edge = Bordo inclinato
 | 
				
			||||||
 | 
					Slope Inner Edge = Bordo interno inclinato
 | 
				
			||||||
 | 
					Slope Lying = Pendenza bugiarda
 | 
				
			||||||
 | 
					Slope Upside Down = Pendenza capovolta
 | 
				
			||||||
 | 
					Slope Upside Down Edge = Bordo inclinato capovolto
 | 
				
			||||||
 | 
					Slope Upside Down Inner Edge = Bordo interno inclinato capovolto
 | 
				
			||||||
 | 
					Sphere = Sfera
 | 
				
			||||||
 | 
					Spike = Spuntone
 | 
				
			||||||
 | 
					Stick = Bastone
 | 
				
			||||||
 | 
					Two Curved Edge Block = Blocco con bordo a doppia curva
 | 
				
			||||||
 | 
					Brick = Mattone
 | 
				
			||||||
 | 
					Cobble = Ciottolato
 | 
				
			||||||
 | 
					Dirt = Terra
 | 
				
			||||||
 | 
					Leaves = Foglie
 | 
				
			||||||
 | 
					Sandstone = Arenaria
 | 
				
			||||||
 | 
					Stone = Pietra
 | 
				
			||||||
 | 
					Tree = Albero
 | 
				
			||||||
 | 
					Wooden = Legno
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Grinder Recipes
 | 
					## Grinder Recipes
 | 
				
			||||||
# $1: Name
 | 
					# $1: Name
 | 
				
			||||||
@@ -138,10 +159,9 @@ Talinite = Talinite
 | 
				
			|||||||
Tin = Stagno
 | 
					Tin = Stagno
 | 
				
			||||||
Wrought Iron = Ferro Battuto
 | 
					Wrought Iron = Ferro Battuto
 | 
				
			||||||
Zinc = Zinco
 | 
					Zinc = Zinco
 | 
				
			||||||
%.1f%%-Fissile Uranium = %.1f%%-Uranio fissile
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
## 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
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,175 +0,0 @@
 | 
				
			|||||||
# Polish Translation for Technic mod
 | 
					 | 
				
			||||||
# Polskie tłumaczenie Technic mod
 | 
					 | 
				
			||||||
# by mat9117
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Misc
 | 
					 | 
				
			||||||
[Technic] Loaded in %f seconds = [Technic] Wczytany w %f sekund
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Items
 | 
					 | 
				
			||||||
Silicon Wafer = Płytka krzemowa
 | 
					 | 
				
			||||||
Doped Silicon Wafer = Domieszkowana płytka krzemowa
 | 
					 | 
				
			||||||
Enriched Uranium = Wzbogacony uran
 | 
					 | 
				
			||||||
Uranium Fuel = Paliwo uranowe
 | 
					 | 
				
			||||||
Diamond Drill Head = Diamentowa głowica wiertła
 | 
					 | 
				
			||||||
Blue Energy Crystal = Niebieski kryształ energii
 | 
					 | 
				
			||||||
Green Energy Crystal = Zielony kryształ energii
 | 
					 | 
				
			||||||
Red Energy Crystal = Czerwony kryształ energii
 | 
					 | 
				
			||||||
Fine Copper Wire = Cienki miedziany drut
 | 
					 | 
				
			||||||
Copper Coil = Miedziana cewka
 | 
					 | 
				
			||||||
Electric Motor = Silnik elektryczny
 | 
					 | 
				
			||||||
Low Voltage Transformer = Transformator niskiego napięcia
 | 
					 | 
				
			||||||
Medium Voltage Transformer = Transformator średniego napięcia
 | 
					 | 
				
			||||||
High Voltage Transformer = Transformator wysokiego napięcia
 | 
					 | 
				
			||||||
Control Logic Unit = Jednostka sterująca
 | 
					 | 
				
			||||||
Mixed Metal Ingot = Sztabka zmieszanych metali
 | 
					 | 
				
			||||||
Composite Plate = Płytka kompozytowa
 | 
					 | 
				
			||||||
Copper Plate = Płytka miedziana
 | 
					 | 
				
			||||||
Carbon Plate = Płytka węglowa
 | 
					 | 
				
			||||||
Graphite = Grafit
 | 
					 | 
				
			||||||
Carbon Cloth = Włókno węglowe
 | 
					 | 
				
			||||||
Raw Latex = Lateks naturalny
 | 
					 | 
				
			||||||
Rubber Fiber = Włókno gumowe
 | 
					 | 
				
			||||||
%.1f%%-Fissile Uranium Ingot = %.1f%% Sztabka uranu
 | 
					 | 
				
			||||||
%.1f%%-Fissile Uranium Block = %.1f%% Blok uranu
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Machine misc
 | 
					 | 
				
			||||||
Machine cannot be removed because it is not empty = Nie można usunąć maszyny, ponieważ nie jest pusta
 | 
					 | 
				
			||||||
Inventory move disallowed due to protection = Przenoszenie rzeczy z ekwipunku niemożliwe z powodu ochrony
 | 
					 | 
				
			||||||
# $1: Machine name (Includes tier)
 | 
					 | 
				
			||||||
@1 Active (@2 EU) = @1 Aktywny (@2 EU)
 | 
					 | 
				
			||||||
%s Active = %s Aktywny/a
 | 
					 | 
				
			||||||
%s Disabled = %s Wyłączony/a
 | 
					 | 
				
			||||||
%s Enabled = %s Włączony/a
 | 
					 | 
				
			||||||
%s Idle = %s Bezczynny/a
 | 
					 | 
				
			||||||
%s Improperly Placed = %s Ustawiony/a nieprawidłowo
 | 
					 | 
				
			||||||
%s is empty = %s jest pusty/a
 | 
					 | 
				
			||||||
%s Unpowered = %s brak zasilania
 | 
					 | 
				
			||||||
%s Out Of Fuel = %s brak paliwa
 | 
					 | 
				
			||||||
%s Has Bad Cabling = %s Źle podłączono kable
 | 
					 | 
				
			||||||
%s (Slave) =
 | 
					 | 
				
			||||||
%s Has No Network = %s Nie podłączony/a do sieci
 | 
					 | 
				
			||||||
%s Finished = %s Ukończony
 | 
					 | 
				
			||||||
Enable/Disable = Włącz/Wyłącz
 | 
					 | 
				
			||||||
Range = Zasięg
 | 
					 | 
				
			||||||
Upgrade Slots = Miejsca na ulepszenia
 | 
					 | 
				
			||||||
In: = Wejście
 | 
					 | 
				
			||||||
Out: = Wyjście
 | 
					 | 
				
			||||||
Slot %d = Otwór %d
 | 
					 | 
				
			||||||
Itemwise = Jeden przedmiot
 | 
					 | 
				
			||||||
Stackwise = Cały stack
 | 
					 | 
				
			||||||
Ignoring Mesecon Signal = Ignoruj sygnał Mesecon
 | 
					 | 
				
			||||||
Controlled by Mesecon Signal = Sterowany sygnałem Mesecon
 | 
					 | 
				
			||||||
Owner: = Właściciel:
 | 
					 | 
				
			||||||
Unlocked = Odblokowany/a
 | 
					 | 
				
			||||||
Locked = Zablokowany/a
 | 
					 | 
				
			||||||
Radius: = Promień:
 | 
					 | 
				
			||||||
Enabled = Włączony/a
 | 
					 | 
				
			||||||
Disabled = Wyłączony/a
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Machine names
 | 
					 | 
				
			||||||
# $1: Tier
 | 
					 | 
				
			||||||
%s Alloy Furnace = %s Piec stopowy
 | 
					 | 
				
			||||||
%s Battery Box = %s Skrzynka baterii
 | 
					 | 
				
			||||||
%s Cable = %s Przewód
 | 
					 | 
				
			||||||
%s Centrifuge = %s Centryfuga
 | 
					 | 
				
			||||||
%s Compressor = %s Kompresor
 | 
					 | 
				
			||||||
%s Extractor = %s Ekstraktor
 | 
					 | 
				
			||||||
%s Forcefield Emitter = %s Emiter pola siłowego
 | 
					 | 
				
			||||||
%s Furnace = %s Piec
 | 
					 | 
				
			||||||
%s Grinder = %s Młynek
 | 
					 | 
				
			||||||
%s Music Player = %s Odtwarzacz muzyki
 | 
					 | 
				
			||||||
%s Quarry = %s Kamieniołom
 | 
					 | 
				
			||||||
%s Tool Workshop = %s Warsztat narzędzi
 | 
					 | 
				
			||||||
Arrayed Solar %s Generator = %s Szeregowy generator słoneczny
 | 
					 | 
				
			||||||
Fuel-Fired %s Generator = %s Generator zasilany paliwem
 | 
					 | 
				
			||||||
Geothermal %s Generator = %s Generator geotermalny
 | 
					 | 
				
			||||||
Hydro %s Generator = %s Hydrogenerator
 | 
					 | 
				
			||||||
Nuclear %s Generator Core = %s Reaktor atomowy
 | 
					 | 
				
			||||||
Small Solar %s Generator = %s Mały generator słoneczny
 | 
					 | 
				
			||||||
Wind %s Generator = %s Generator wiatrowy
 | 
					 | 
				
			||||||
Self-Contained Injector = Samowystarczalny wtryskiwacz
 | 
					 | 
				
			||||||
Constructor Mk%d = Konstruktor Mk%d
 | 
					 | 
				
			||||||
Frame = Klatka
 | 
					 | 
				
			||||||
Frame Motor = Silnik klatkowy
 | 
					 | 
				
			||||||
Template = Szablon
 | 
					 | 
				
			||||||
Template (replacing) = Szablon (zastępczy)
 | 
					 | 
				
			||||||
Template Motor =Szablon silnika
 | 
					 | 
				
			||||||
Template Tool = Szablon narzędzia
 | 
					 | 
				
			||||||
Battery Box = Skrzynka baterii
 | 
					 | 
				
			||||||
Supply Converter = Konwerter zasilania
 | 
					 | 
				
			||||||
Switching Station = Rozdzielnia
 | 
					 | 
				
			||||||
Fuel-Fired Alloy Furnace = Piec stopowy zasilany paliwem
 | 
					 | 
				
			||||||
Fuel-Fired Furnace = Piec zasilany paliwem
 | 
					 | 
				
			||||||
Wind Mill Frame = Klatka wiatraka
 | 
					 | 
				
			||||||
Forcefield = Pole siłowe
 | 
					 | 
				
			||||||
Nuclear Reactor Rod Compartment = Komora rdzenia reaktora atomowego
 | 
					 | 
				
			||||||
Administrative World Anchor = Administracyjna kotwica świata
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Machine-specific
 | 
					 | 
				
			||||||
# $1: Pruduced EU
 | 
					 | 
				
			||||||
Charge = Ładuj
 | 
					 | 
				
			||||||
Discharge = Rozładuj
 | 
					 | 
				
			||||||
Power level = Poziom zasilania
 | 
					 | 
				
			||||||
# $1: Tier $2: current_charge $3: max_charge
 | 
					 | 
				
			||||||
@1 Battery Box: @2/@3 = @1 Skrzynka baterii: @2/@3
 | 
					 | 
				
			||||||
# $1: Machine name $2: Supply $3: Demand
 | 
					 | 
				
			||||||
@1. Supply: @2 Demand: @3 = @1. Zapas: @2 Pobór: @3 
 | 
					 | 
				
			||||||
Production at %d%% = Produkowanie w %d%%
 | 
					 | 
				
			||||||
Choose Milling Program: = Wybierz program mielenia:
 | 
					 | 
				
			||||||
Slim Elements half / normal height: = Małe elementy połowa / normalna wysokość:
 | 
					 | 
				
			||||||
Current track %s =
 | 
					 | 
				
			||||||
Stopped = Zatrzymany/a
 | 
					 | 
				
			||||||
Keeping %d/%d map blocks loaded = Ciągle ładuję %d/%d bloki mapy 
 | 
					 | 
				
			||||||
Digging not started = Nie rozpoczęto kopania
 | 
					 | 
				
			||||||
Digging finished = Kopanie skończone
 | 
					 | 
				
			||||||
Digging %d m above machine = Kopię %d m nad maszyną
 | 
					 | 
				
			||||||
Digging %d m below machine = Kopię %d m pod maszyną
 | 
					 | 
				
			||||||
@1 (@2 @3 -> @4 @5) = @1 (@2 @3 -> @4 @5)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Grinder Recipes
 | 
					 | 
				
			||||||
# $1: Name
 | 
					 | 
				
			||||||
%s Dust = %s Pył
 | 
					 | 
				
			||||||
Akalin = Akalinowy
 | 
					 | 
				
			||||||
Alatro = Alatrowy
 | 
					 | 
				
			||||||
Arol = Arolowy
 | 
					 | 
				
			||||||
Brass = Mosiądzu
 | 
					 | 
				
			||||||
Bronze = Brązu
 | 
					 | 
				
			||||||
Carbon Steel = Stali węglowej
 | 
					 | 
				
			||||||
Cast Iron = Żeliwa
 | 
					 | 
				
			||||||
Chromium = Chromu
 | 
					 | 
				
			||||||
Coal = Węglowy
 | 
					 | 
				
			||||||
Copper = Miedzi
 | 
					 | 
				
			||||||
Gold = Złoty
 | 
					 | 
				
			||||||
Mithril = Mithrilu
 | 
					 | 
				
			||||||
Silver = Srebrny
 | 
					 | 
				
			||||||
Stainless Steel = Stali nierdzewnej
 | 
					 | 
				
			||||||
Talinite = Talinitu
 | 
					 | 
				
			||||||
Tin = Cyny
 | 
					 | 
				
			||||||
Wrought Iron = Kutego żelaza
 | 
					 | 
				
			||||||
Zinc = Cynku
 | 
					 | 
				
			||||||
%.1f%%-Fissile Uranium = %.1f%% Uranu
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Tools
 | 
					 | 
				
			||||||
RE Battery = Bateria ładowalna
 | 
					 | 
				
			||||||
Water Can = Kanister wody
 | 
					 | 
				
			||||||
Lava Can = Kanister lawy
 | 
					 | 
				
			||||||
Chainsaw = Piła łańcuchowa
 | 
					 | 
				
			||||||
Flashlight = Latarka
 | 
					 | 
				
			||||||
3 nodes deep. = Głęboki na 3 bloki.
 | 
					 | 
				
			||||||
3 nodes tall. = Wysoki na 3 bloki.
 | 
					 | 
				
			||||||
3 nodes wide. = Szeroki na 3 bloki.
 | 
					 | 
				
			||||||
3x3 nodes. = 3x3 bloki.
 | 
					 | 
				
			||||||
Use while sneaking to change Mining Drill Mk%d modes. = Użyj podczas skradania, aby zmienić tryby wiertła górniczego Mk%d
 | 
					 | 
				
			||||||
Mining Drill Mk%d Mode %d = Tryb wiertła górniczego Mk%d
 | 
					 | 
				
			||||||
Mining Drill Mk%d = Wiertło górnicze Mk%d
 | 
					 | 
				
			||||||
Mining Laser Mk%d = Laser górniczy Mk%d
 | 
					 | 
				
			||||||
Single node. = Pojedynczy blok.
 | 
					 | 
				
			||||||
Sonic Screwdriver = Dźwiękowy śrubokręt 
 | 
					 | 
				
			||||||
Tree Tap = Nacinak drzewny
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Craft descriptions
 | 
					 | 
				
			||||||
Alloy cooking = Stapianie
 | 
					 | 
				
			||||||
Grinding = Mielenie
 | 
					 | 
				
			||||||
Compressing = Kompresowanie
 | 
					 | 
				
			||||||
Extracting = Ekstrakcja
 | 
					 | 
				
			||||||
Separating = Oddzielanie
 | 
					 | 
				
			||||||
@@ -1,211 +0,0 @@
 | 
				
			|||||||
# Braziliam portuguese translation for technic
 | 
					 | 
				
			||||||
# Tradução portuguesa brasileira para technic
 | 
					 | 
				
			||||||
# By Sires
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Misc
 | 
					 | 
				
			||||||
[Technic] Loaded in %f seconds = [Technic] Carregado em %f segundos
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Items
 | 
					 | 
				
			||||||
Silicon Wafer = Pastilha de Silício
 | 
					 | 
				
			||||||
Doped Silicon Wafer = Pastilha de Silício Dopada
 | 
					 | 
				
			||||||
Enriched Uranium = Urânio Enriquecido
 | 
					 | 
				
			||||||
Uranium Fuel = Combustivel de Urânio
 | 
					 | 
				
			||||||
Diamond Drill Head = Cabeça de Broca de Diamante
 | 
					 | 
				
			||||||
Blue Energy Crystal = Cristal de Energia Azul
 | 
					 | 
				
			||||||
Green Energy Crystal = Cristal de Energia Verde
 | 
					 | 
				
			||||||
Red Energy Crystal = Cristal de Energia Vermelho
 | 
					 | 
				
			||||||
Fine Copper Wire = Fio Fino de Cobre
 | 
					 | 
				
			||||||
Copper Coil = Bobina de Cobre
 | 
					 | 
				
			||||||
Electric Motor = Motor Elétrico
 | 
					 | 
				
			||||||
Low Voltage Transformer = Transformador de Baixa Voltagem
 | 
					 | 
				
			||||||
Medium Voltage Transformer = Transformador de Média Voltagem
 | 
					 | 
				
			||||||
High Voltage Transformer = Transformador de Alta Voltagem
 | 
					 | 
				
			||||||
Control Logic Unit = Unidade de Controle Lógico
 | 
					 | 
				
			||||||
Mixed Metal Ingot = Lingote de Metal Misturado
 | 
					 | 
				
			||||||
Composite Plate = Placa Composta
 | 
					 | 
				
			||||||
Copper Plate = Placa de Cobre
 | 
					 | 
				
			||||||
Carbon Plate = Placa de Carbono
 | 
					 | 
				
			||||||
Graphite = Grafite
 | 
					 | 
				
			||||||
Carbon Cloth = Recido de Carbono
 | 
					 | 
				
			||||||
Raw Latex = Latex bruto
 | 
					 | 
				
			||||||
Rubber Fiber = Fibra de Borracha
 | 
					 | 
				
			||||||
%.1f%%-Fissile Uranium Ingot = Lingote de Urânio %.1f%%-Físsil
 | 
					 | 
				
			||||||
%.1f%%-Fissile Uranium Block = Bloco de Urânio %.1f%%-Físsil
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Machine Misc
 | 
					 | 
				
			||||||
Machine cannot be removed because it is not empty = A máquina não pode ser removida porque ela não está vazia
 | 
					 | 
				
			||||||
Inventory move disallowed due to protection = Movimento de inventário não permitido pela proteção
 | 
					 | 
				
			||||||
# $1: Machine name (includes tier)
 | 
					 | 
				
			||||||
@1 Active (@2 EU) = @1 Ativo (@2 EU)
 | 
					 | 
				
			||||||
%s Active = %s Ativo
 | 
					 | 
				
			||||||
%s Disabled = %s Ativado
 | 
					 | 
				
			||||||
%s Enabled = %s Desativado
 | 
					 | 
				
			||||||
%s Idle = Ócio
 | 
					 | 
				
			||||||
%s Improperly Placed = %s Colocado Inapropriadamente
 | 
					 | 
				
			||||||
%s is empty = %s está vazio
 | 
					 | 
				
			||||||
%s Unpowered = %s Sem energia
 | 
					 | 
				
			||||||
%s Out Of Fuel = %s Sem Combustível
 | 
					 | 
				
			||||||
%s Has Bad Cabling = %s Tem Cabeamento Ruim
 | 
					 | 
				
			||||||
%s (Slave) = %s (Servo)
 | 
					 | 
				
			||||||
%s Has No Network = %s Não Tem Rede
 | 
					 | 
				
			||||||
%s Finished = %s Acabou
 | 
					 | 
				
			||||||
Enable/Disable = Ativar/Desativar
 | 
					 | 
				
			||||||
Range = Alcance
 | 
					 | 
				
			||||||
Upgrade Slots = Lugares para Melhoria
 | 
					 | 
				
			||||||
In: = Entrada:
 | 
					 | 
				
			||||||
Out: = Saída:
 | 
					 | 
				
			||||||
Slot %d = Lugar %d
 | 
					 | 
				
			||||||
Itemwise = Por item
 | 
					 | 
				
			||||||
Stackwise = Por pilha
 | 
					 | 
				
			||||||
Ignoring Mesecon Signal = Ignorar Sinaal de Mesecon
 | 
					 | 
				
			||||||
Controlled by Mesecon Signal = Controlado por Sinal de Mesecon
 | 
					 | 
				
			||||||
Owner: = Dono:
 | 
					 | 
				
			||||||
Unlocked = Destravado
 | 
					 | 
				
			||||||
Locked = Travado
 | 
					 | 
				
			||||||
Radius: = Raio:
 | 
					 | 
				
			||||||
Enabled = Ativado
 | 
					 | 
				
			||||||
Disabled = Desativado
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Machine names
 | 
					 | 
				
			||||||
# $1: Tier
 | 
					 | 
				
			||||||
%s Alloy Furnace = Fornalha de Liga %s
 | 
					 | 
				
			||||||
%s Battery Box = Caixa de Bateria %s
 | 
					 | 
				
			||||||
%s Cable = Cabo %s
 | 
					 | 
				
			||||||
%s CNC Machine = Máquina CNC %s
 | 
					 | 
				
			||||||
%s Centrifuge = Centrifuga %s
 | 
					 | 
				
			||||||
%s Compressor = Compresso %s
 | 
					 | 
				
			||||||
%s Extractor = Extrator %s
 | 
					 | 
				
			||||||
%s Forcefield Emitter = Emissor de Campo de Força %s
 | 
					 | 
				
			||||||
%s Furnace = Fornalha %s
 | 
					 | 
				
			||||||
%s Grinder = Triturador %s
 | 
					 | 
				
			||||||
%s Music Player = Tocador de Música %s
 | 
					 | 
				
			||||||
%s Quarry = Pedreira %s
 | 
					 | 
				
			||||||
%s Tool Workshop = Oficina de Ferramentas %s
 | 
					 | 
				
			||||||
Arrayed Solar %s Generator = Gerador Solar Equipado %s
 | 
					 | 
				
			||||||
Fuel-Fired %s Generator = Gerador Alimentado-por-Combustível %s
 | 
					 | 
				
			||||||
Geothermal %s Generator = Gerador Geotermal %s
 | 
					 | 
				
			||||||
Hydro %s Generator = Gerador Hidráulico %s
 | 
					 | 
				
			||||||
Nuclear %s Generator Core = Núcleo de Gerador Nuclear %s
 | 
					 | 
				
			||||||
Small Solar %s Generator = Gerador Solar Pequeno %s
 | 
					 | 
				
			||||||
Wind %s Generator = Gerador de Energia Eólica %s
 | 
					 | 
				
			||||||
Self-Contained Injector = Injetor Auto-Contido
 | 
					 | 
				
			||||||
Constructor Mk%d = Construtor Nv%d
 | 
					 | 
				
			||||||
Frame = Armação
 | 
					 | 
				
			||||||
Frame Motor = Motor de Armação
 | 
					 | 
				
			||||||
Template = Modelo
 | 
					 | 
				
			||||||
Template (replacing) = Modelo (recolocando)
 | 
					 | 
				
			||||||
Template Motor = Modelo de Motor
 | 
					 | 
				
			||||||
Template Tool = Modelo de Ferramenta
 | 
					 | 
				
			||||||
Battery Box = Caixa de Bateria
 | 
					 | 
				
			||||||
Supply Converter = Conversor de Energia
 | 
					 | 
				
			||||||
Switching Station = Estação de Comutação
 | 
					 | 
				
			||||||
Fuel-Fired Alloy Furnace = Fornalha de Liga Alimentada-por-Combustível
 | 
					 | 
				
			||||||
Fuel-Fired Furnace = Fornalha Alimentada-por-Combustível
 | 
					 | 
				
			||||||
Wind Mill Frame = Armação de Moinho de Vento
 | 
					 | 
				
			||||||
Forcefield = Campo de Força
 | 
					 | 
				
			||||||
Nuclear Reactor Rod Compartment = Compartimento de Barra do Reator Nuclear
 | 
					 | 
				
			||||||
Administrative World Anchor = Âncora de Mundo Administrativa
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Machine-specific
 | 
					 | 
				
			||||||
# $1: Pruduced EU
 | 
					 | 
				
			||||||
Charge = Carregar
 | 
					 | 
				
			||||||
Discharge = Descarregar
 | 
					 | 
				
			||||||
Power level = Nível de Energia
 | 
					 | 
				
			||||||
# $1: Tier $2: current_charge $3: max_charge 
 | 
					 | 
				
			||||||
@1 Battery Box: @2/@3 = Caixa de Baterias @1: @2/@3
 | 
					 | 
				
			||||||
# $1: Machine name $2: Supply $3: Demand
 | 
					 | 
				
			||||||
@1. Supply: @2 Demand: @3 = @1. Suprimento: @2 Demanda: @3
 | 
					 | 
				
			||||||
Production at %d%% = Produção em %d%%
 | 
					 | 
				
			||||||
Choose Milling Program: = Escolha o Programa de Serragem:
 | 
					 | 
				
			||||||
Slim Elements half / normal height: = Metade de Elementos Finos / altura normal:
 | 
					 | 
				
			||||||
Current track %s = Música Atual %s
 | 
					 | 
				
			||||||
Stopped = Parado
 | 
					 | 
				
			||||||
Keeping %d/%d map blocks loaded = Mantendo %d/%d blocos de mapa carregados
 | 
					 | 
				
			||||||
Digging not started = Escavação não começada
 | 
					 | 
				
			||||||
Digging finished = Escavação terminada
 | 
					 | 
				
			||||||
Digging %d m above machine = Escavando %d m acima da máquina
 | 
					 | 
				
			||||||
Digging %d m below machine = Escavando %d m abaixo da máquina
 | 
					 | 
				
			||||||
@1 (@2 @3 -> @4 @5) = @1 (@2 @3 -> @4 @5)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## CNC
 | 
					 | 
				
			||||||
Cylinder = Cilindro
 | 
					 | 
				
			||||||
Element Cross = Cruz do Elemento
 | 
					 | 
				
			||||||
Element Cross Double = Cruz Dupla do Elemento
 | 
					 | 
				
			||||||
Element Edge = Borda do Elemento
 | 
					 | 
				
			||||||
Element Edge Double = Borda Dupla do Elemento
 | 
					 | 
				
			||||||
Element End = Final do Elemento
 | 
					 | 
				
			||||||
Element End Double = Final Duplo do Elemento
 | 
					 | 
				
			||||||
Element Straight = Elemento Contínuo
 | 
					 | 
				
			||||||
Element Straight Double = Elemento Contínuo duplo
 | 
					 | 
				
			||||||
Element T = Elemento em T
 | 
					 | 
				
			||||||
Element T Double = Elemento em T Duplo
 | 
					 | 
				
			||||||
Horizontal Cylinder = Cilindro Horizontal
 | 
					 | 
				
			||||||
One Curved Edge Block = Uma Borda de Bloco Curvada
 | 
					 | 
				
			||||||
Pyramid = Pirâmide
 | 
					 | 
				
			||||||
Slope = Ladeira
 | 
					 | 
				
			||||||
Slope Edge = Canto de Ladeira
 | 
					 | 
				
			||||||
Slope Inner Edge = Canto de Dentro de Ladeira
 | 
					 | 
				
			||||||
Slope Lying = Ladeira Deitada
 | 
					 | 
				
			||||||
Slope Upside Down = Ladeira de Cabeça para Baixo
 | 
					 | 
				
			||||||
Slope Upside Down Edge = Cande de Ladeira de Cabeça para Baixo
 | 
					 | 
				
			||||||
Slope Upside Down Inner Edge = Canto de Dentro de Ladeira de Cabeça para Baixo
 | 
					 | 
				
			||||||
Sphere = Esfera
 | 
					 | 
				
			||||||
Spike = Espinho
 | 
					 | 
				
			||||||
Stick = Graveto
 | 
					 | 
				
			||||||
Two Curved Edge Block = Bloco de Duas Bordas Curvadas
 | 
					 | 
				
			||||||
Brick = Tijolo
 | 
					 | 
				
			||||||
Cobble = Pedregulho
 | 
					 | 
				
			||||||
Dirt = Terra
 | 
					 | 
				
			||||||
Leaves = Folhas
 | 
					 | 
				
			||||||
Sandstone = Arenito
 | 
					 | 
				
			||||||
Stone = Pedra
 | 
					 | 
				
			||||||
Tree = Árvore
 | 
					 | 
				
			||||||
Wooden = de Madeira
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Grinder Recipes
 | 
					 | 
				
			||||||
# $1: Name
 | 
					 | 
				
			||||||
%s Dust = Pó de %s
 | 
					 | 
				
			||||||
Akalin = Akalin
 | 
					 | 
				
			||||||
Alatro = Alatro
 | 
					 | 
				
			||||||
Arol = Arol
 | 
					 | 
				
			||||||
Brass = Latão
 | 
					 | 
				
			||||||
Bronze = Bronze
 | 
					 | 
				
			||||||
Carbon Steel = Aço Carbono
 | 
					 | 
				
			||||||
Cast Iron = Ferro Fundido
 | 
					 | 
				
			||||||
Chromium = Crômio
 | 
					 | 
				
			||||||
Coal = Carvão
 | 
					 | 
				
			||||||
Copper = Cobre
 | 
					 | 
				
			||||||
Gold = Ouro
 | 
					 | 
				
			||||||
Mithril = Mithril
 | 
					 | 
				
			||||||
Silver = Prata
 | 
					 | 
				
			||||||
Stainless Steel = Aço Inoxidável
 | 
					 | 
				
			||||||
Talinite = Talinite
 | 
					 | 
				
			||||||
Tin = Estanho
 | 
					 | 
				
			||||||
Wrought Iron = Ferro Forjado
 | 
					 | 
				
			||||||
Zinc = Zinco
 | 
					 | 
				
			||||||
%.1f%%-Fissile Uranium = Urânio %.1f%%-Físsil
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Tools
 | 
					 | 
				
			||||||
RE Battery = Bateria RE
 | 
					 | 
				
			||||||
Water Can = Lata de Água
 | 
					 | 
				
			||||||
Lava Can = Lata de Lava
 | 
					 | 
				
			||||||
Chainsaw = Motosserra
 | 
					 | 
				
			||||||
Flashlight = Lanterna
 | 
					 | 
				
			||||||
3 nodes deep. = 3 nodes de profundidade.
 | 
					 | 
				
			||||||
3 nodes tall. = 3 nodes de altura.
 | 
					 | 
				
			||||||
3 nodes wide. = 3 nodes de largura.
 | 
					 | 
				
			||||||
3x3 nodes. = 3x3 nodes.
 | 
					 | 
				
			||||||
Use while sneaking to change Mining Drill Mk%d modes. = Use enquanto esgueirando para mudar os modos da Broca de Mineração Nv%d.
 | 
					 | 
				
			||||||
Mining Drill Mk%d Mode %d = Broca de Mineração Nv%d Modo %d
 | 
					 | 
				
			||||||
Mining Drill Mk%d = Broca de Mineração Nv%d
 | 
					 | 
				
			||||||
Mining Laser Mk%d = Laser de Mineração Nv%d
 | 
					 | 
				
			||||||
Single node. = Unico node.
 | 
					 | 
				
			||||||
Sonic Screwdriver = Chave de Fenda Sônica.
 | 
					 | 
				
			||||||
Tree Tap = Torneira de Árvore
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Craft descriptions
 | 
					 | 
				
			||||||
Alloy cooking = Cozinhando em liga
 | 
					 | 
				
			||||||
Grinding = Triturando
 | 
					 | 
				
			||||||
Compressing = Comprimindo
 | 
					 | 
				
			||||||
Extracting = Extraindo
 | 
					 | 
				
			||||||
Separating = Separando
 | 
					 | 
				
			||||||
@@ -15,8 +15,6 @@ Blue Energy Crystal =
 | 
				
			|||||||
Green Energy Crystal =
 | 
					Green Energy Crystal =
 | 
				
			||||||
Red Energy Crystal =
 | 
					Red Energy Crystal =
 | 
				
			||||||
Fine Copper Wire =
 | 
					Fine Copper Wire =
 | 
				
			||||||
Fine Gold Wire =
 | 
					 | 
				
			||||||
Fine Silver Wire =
 | 
					 | 
				
			||||||
Copper Coil =
 | 
					Copper Coil =
 | 
				
			||||||
Electric Motor =
 | 
					Electric Motor =
 | 
				
			||||||
Low Voltage Transformer =
 | 
					Low Voltage Transformer =
 | 
				
			||||||
@@ -31,14 +29,11 @@ Graphite =
 | 
				
			|||||||
Carbon Cloth =
 | 
					Carbon Cloth =
 | 
				
			||||||
Raw Latex =
 | 
					Raw Latex =
 | 
				
			||||||
Rubber Fiber =
 | 
					Rubber Fiber =
 | 
				
			||||||
%.1f%%-Fissile Uranium Ingot =
 | 
					 | 
				
			||||||
%.1f%%-Fissile Uranium Block =
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Machine misc
 | 
					## Machine misc
 | 
				
			||||||
Machine cannot be removed because it is not empty =
 | 
					Machine cannot be removed because it is not empty =
 | 
				
			||||||
Inventory move disallowed due to protection =
 | 
					Inventory move disallowed due to protection =
 | 
				
			||||||
# $1: Machine name (Includes tier)
 | 
					# $1: Machine name (Includes tier)
 | 
				
			||||||
@1 Active (@2 EU) =
 | 
					 | 
				
			||||||
%s Active =
 | 
					%s Active =
 | 
				
			||||||
%s Disabled =
 | 
					%s Disabled =
 | 
				
			||||||
%s Enabled =
 | 
					%s Enabled =
 | 
				
			||||||
@@ -48,7 +43,6 @@ Inventory move disallowed due to protection =
 | 
				
			|||||||
%s Unpowered =
 | 
					%s Unpowered =
 | 
				
			||||||
%s Out Of Fuel =
 | 
					%s Out Of Fuel =
 | 
				
			||||||
%s Has Bad Cabling =
 | 
					%s Has Bad Cabling =
 | 
				
			||||||
%s (Slave) =
 | 
					 | 
				
			||||||
%s Has No Network =
 | 
					%s Has No Network =
 | 
				
			||||||
%s Finished =
 | 
					%s Finished =
 | 
				
			||||||
Enable/Disable =
 | 
					Enable/Disable =
 | 
				
			||||||
@@ -57,23 +51,16 @@ Upgrade Slots =
 | 
				
			|||||||
In: =
 | 
					In: =
 | 
				
			||||||
Out: =
 | 
					Out: =
 | 
				
			||||||
Slot %d =
 | 
					Slot %d =
 | 
				
			||||||
Itemwise =
 | 
					Mode: %s =
 | 
				
			||||||
Stackwise =
 | 
					single items =
 | 
				
			||||||
Ignoring Mesecon Signal =
 | 
					whole stacks =
 | 
				
			||||||
Controlled by Mesecon Signal =
 | 
					 | 
				
			||||||
Owner: =
 | 
					 | 
				
			||||||
Unlocked =
 | 
					 | 
				
			||||||
Locked =
 | 
					 | 
				
			||||||
Radius: =
 | 
					 | 
				
			||||||
Enabled =
 | 
					 | 
				
			||||||
Disabled =
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Machine names
 | 
					## Machine names
 | 
				
			||||||
# $1: Tier
 | 
					# $1: Tier
 | 
				
			||||||
%s Alloy Furnace =
 | 
					%s Alloy Furnace =
 | 
				
			||||||
%s Battery Box = 
 | 
					%s Battery Box = 
 | 
				
			||||||
%s Cable =
 | 
					%s Cable =
 | 
				
			||||||
%s Centrifuge =
 | 
					%s CNC Machine =
 | 
				
			||||||
%s Compressor =
 | 
					%s Compressor =
 | 
				
			||||||
%s Extractor =
 | 
					%s Extractor =
 | 
				
			||||||
%s Forcefield Emitter =
 | 
					%s Forcefield Emitter =
 | 
				
			||||||
@@ -89,7 +76,7 @@ Hydro %s Generator =
 | 
				
			|||||||
Nuclear %s Generator Core =
 | 
					Nuclear %s Generator Core =
 | 
				
			||||||
Small Solar %s Generator =
 | 
					Small Solar %s Generator =
 | 
				
			||||||
Wind %s Generator =
 | 
					Wind %s Generator =
 | 
				
			||||||
Self-Contained Injector =
 | 
					Injector =
 | 
				
			||||||
Constructor Mk%d =
 | 
					Constructor Mk%d =
 | 
				
			||||||
Frame =
 | 
					Frame =
 | 
				
			||||||
Frame Motor =
 | 
					Frame Motor =
 | 
				
			||||||
@@ -105,7 +92,6 @@ Fuel-Fired Furnace =
 | 
				
			|||||||
Wind Mill Frame =
 | 
					Wind Mill Frame =
 | 
				
			||||||
Forcefield =
 | 
					Forcefield =
 | 
				
			||||||
Nuclear Reactor Rod Compartment =
 | 
					Nuclear Reactor Rod Compartment =
 | 
				
			||||||
Administrative World Anchor =
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Machine-specific
 | 
					## Machine-specific
 | 
				
			||||||
# $1: Pruduced EU
 | 
					# $1: Pruduced EU
 | 
				
			||||||
@@ -113,21 +99,48 @@ Charge =
 | 
				
			|||||||
Discharge =
 | 
					Discharge =
 | 
				
			||||||
Power level =
 | 
					Power level =
 | 
				
			||||||
# $1: Tier $2: current_charge $3: max_charge 
 | 
					# $1: Tier $2: current_charge $3: max_charge 
 | 
				
			||||||
@1 Battery Box: @2/@3 =
 | 
					%s Battery Box: %d/%d =
 | 
				
			||||||
# $1: Machine name $2: Supply $3: Demand
 | 
					# $1: Machine name $2: Supply $3: Demand
 | 
				
			||||||
@1. Supply: @2 Demand: @3 =
 | 
					%s. Supply: %d Demand: %d =
 | 
				
			||||||
Production at %d%% =
 | 
					Production at %d%% =
 | 
				
			||||||
Choose Milling Program: =
 | 
					Choose Milling Program: =
 | 
				
			||||||
Slim Elements half / normal height: =
 | 
					Slim Elements half / normal height: =
 | 
				
			||||||
Current track %s =
 | 
					Current track %s =
 | 
				
			||||||
Stopped =
 | 
					 | 
				
			||||||
Keeping %d/%d map blocks loaded =
 | 
					 | 
				
			||||||
Digging not started =
 | 
					 | 
				
			||||||
Digging finished =
 | 
					 | 
				
			||||||
Digging %d m above machine =
 | 
					 | 
				
			||||||
Digging %d m below machine =
 | 
					 | 
				
			||||||
@1 (@2 @3 -> @4 @5) =
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## CNC
 | 
				
			||||||
 | 
					Cylinder =
 | 
				
			||||||
 | 
					Element Cross =
 | 
				
			||||||
 | 
					Element Cross Double =
 | 
				
			||||||
 | 
					Element Edge =
 | 
				
			||||||
 | 
					Element Edge Double =
 | 
				
			||||||
 | 
					Element End =
 | 
				
			||||||
 | 
					Element End Double =
 | 
				
			||||||
 | 
					Element Straight =
 | 
				
			||||||
 | 
					Element Straight Double =
 | 
				
			||||||
 | 
					Element T =
 | 
				
			||||||
 | 
					Element T Double =
 | 
				
			||||||
 | 
					Horizontal Cylinder =
 | 
				
			||||||
 | 
					One Curved Edge Block =
 | 
				
			||||||
 | 
					Pyramid =
 | 
				
			||||||
 | 
					Slope =
 | 
				
			||||||
 | 
					Slope Edge =
 | 
				
			||||||
 | 
					Slope Inner Edge =
 | 
				
			||||||
 | 
					Slope Lying =
 | 
				
			||||||
 | 
					Slope Upside Down =
 | 
				
			||||||
 | 
					Slope Upside Down Edge =
 | 
				
			||||||
 | 
					Slope Upside Down Inner Edge =
 | 
				
			||||||
 | 
					Sphere =
 | 
				
			||||||
 | 
					Spike =
 | 
				
			||||||
 | 
					Stick =
 | 
				
			||||||
 | 
					Two Curved Edge Block =
 | 
				
			||||||
 | 
					Brick =
 | 
				
			||||||
 | 
					Cobble =
 | 
				
			||||||
 | 
					Dirt =
 | 
				
			||||||
 | 
					Leaves =
 | 
				
			||||||
 | 
					Sandstone =
 | 
				
			||||||
 | 
					Stone =
 | 
				
			||||||
 | 
					Tree =
 | 
				
			||||||
 | 
					Wooden =
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Grinder Recipes
 | 
					## Grinder Recipes
 | 
				
			||||||
# $1: Name
 | 
					# $1: Name
 | 
				
			||||||
@@ -150,7 +163,6 @@ Talinite =
 | 
				
			|||||||
Tin =
 | 
					Tin =
 | 
				
			||||||
Wrought Iron =
 | 
					Wrought Iron =
 | 
				
			||||||
Zinc =
 | 
					Zinc =
 | 
				
			||||||
%.1f%%-Fissile Uranium =
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Tools
 | 
					## Tools
 | 
				
			||||||
RE Battery =
 | 
					RE Battery =
 | 
				
			||||||
@@ -175,4 +187,3 @@ Alloy cooking =
 | 
				
			|||||||
Grinding =
 | 
					Grinding =
 | 
				
			||||||
Compressing =
 | 
					Compressing =
 | 
				
			||||||
Extracting =
 | 
					Extracting =
 | 
				
			||||||
Separating =
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,11 +1,10 @@
 | 
				
			|||||||
-- HV battery box
 | 
					-- HV battery box
 | 
				
			||||||
 | 
					 | 
				
			||||||
minetest.register_craft({
 | 
					minetest.register_craft({
 | 
				
			||||||
	output = 'technic:hv_battery_box0',
 | 
						output = 'technic:hv_battery_box0',
 | 
				
			||||||
	recipe = {
 | 
						recipe = {
 | 
				
			||||||
		{'technic:mv_battery_box0', 'technic:mv_battery_box0', 'technic:mv_battery_box0'},
 | 
							{'technic:mv_battery_box0', 'technic:mv_battery_box0', 'technic:mv_battery_box0'},
 | 
				
			||||||
		{'technic:mv_battery_box0', 'technic:hv_transformer',  'technic:mv_battery_box0'},
 | 
							{'technic:mv_battery_box0', 'technic:hv_transformer',  'technic:mv_battery_box0'},
 | 
				
			||||||
		{'',                        'technic:hv_cable',        ''},
 | 
							{'',                        'technic:hv_cable0',       ''},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,10 +1,10 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
minetest.register_craft({
 | 
					minetest.register_craft({
 | 
				
			||||||
	output = 'technic:hv_cable 3',
 | 
						output = 'technic:hv_cable0 3',
 | 
				
			||||||
	recipe = {
 | 
						recipe = {
 | 
				
			||||||
		{'homedecor:plastic_sheeting', 'homedecor:plastic_sheeting', 'homedecor:plastic_sheeting'},
 | 
							{'technic:rubber',    'technic:rubber',    'technic:rubber'},
 | 
				
			||||||
		{'technic:mv_cable',           'technic:mv_cable',           'technic:mv_cable'},
 | 
							{'technic:mv_cable0', 'technic:mv_cable0', 'technic:mv_cable0'},
 | 
				
			||||||
		{'homedecor:plastic_sheeting', 'homedecor:plastic_sheeting', 'homedecor:plastic_sheeting'},
 | 
							{'technic:rubber',    'technic:rubber',    'technic:rubber'},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}) 
 | 
					}) 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,40 +1,26 @@
 | 
				
			|||||||
--- Forcefield generator.
 | 
					-- Forcefield mod by ShadowNinja
 | 
				
			||||||
-- @author ShadowNinja
 | 
					-- Modified by kpoppel
 | 
				
			||||||
--
 | 
					--
 | 
				
			||||||
-- Forcefields are powerful barriers but they consume huge amounts of power.
 | 
					-- Forcefields are powerful barriers but they consume huge amounts of power.
 | 
				
			||||||
-- The forcefield Generator is an HV machine.
 | 
					-- Forcefield Generator is a HV machine.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- 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 forcefield_step_interval = 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
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 = {
 | 
				
			||||||
		{"default:mese",         "basic_materials:motor",          "default:mese"        },
 | 
								{'default:mese',         'technic:motor',          'default:mese'        },
 | 
				
			||||||
		{"technic:deployer_off", "technic:machine_casing", "technic:deployer_off"},
 | 
								{'technic:deployer_off', 'technic:machine_casing', 'technic:deployer_off'},
 | 
				
			||||||
		{"default:mese",         "technic:hv_cable",       "default:mese"        },
 | 
								{'default:mese',         'technic:hv_cable0',      'default:mese'        },
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local replaceable_cids = {}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
minetest.after(0, function()
 | 
					 | 
				
			||||||
	for name, ndef in pairs(minetest.registered_nodes) do
 | 
					 | 
				
			||||||
		if ndef.buildable_to == true and name ~= "ignore" then
 | 
					 | 
				
			||||||
			replaceable_cids[minetest.get_content_id(name)] = true
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
end)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- Idea: Let forcefields have different colors by upgrade slot.
 | 
					-- Idea: Let forcefields have different colors by upgrade slot.
 | 
				
			||||||
-- Idea: Let forcefields add up by detecting if one hits another.
 | 
					-- Idea: Let forcefields add up by detecting if one hits another.
 | 
				
			||||||
--    ___   __
 | 
					--    ___   __
 | 
				
			||||||
@@ -42,12 +28,11 @@ end)
 | 
				
			|||||||
--  |          |
 | 
					--  |          |
 | 
				
			||||||
--   \___/\___/
 | 
					--   \___/\___/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local function update_forcefield(pos, meta, active)
 | 
					local function update_forcefield(pos, range, active)
 | 
				
			||||||
	local shape = meta:get_int("shape")
 | 
					 | 
				
			||||||
	local range = meta:get_int("range")
 | 
					 | 
				
			||||||
	local vm = VoxelManip()
 | 
						local vm = VoxelManip()
 | 
				
			||||||
	local MinEdge, MaxEdge = vm:read_from_map(vector.subtract(pos, range),
 | 
						local p1 = {x = pos.x-range, y = pos.y-range, z = pos.z-range}
 | 
				
			||||||
			vector.add(pos, range))
 | 
						local p2 = {x = pos.x+range, y = pos.y+range, z = pos.z+range}
 | 
				
			||||||
 | 
						local MinEdge, MaxEdge = vm:read_from_map(p1, p2)
 | 
				
			||||||
	local area = VoxelArea:new({MinEdge = MinEdge, MaxEdge = MaxEdge})
 | 
						local area = VoxelArea:new({MinEdge = MinEdge, MaxEdge = MaxEdge})
 | 
				
			||||||
	local data = vm:get_data()
 | 
						local data = vm:get_data()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -58,23 +43,11 @@ local function update_forcefield(pos, meta, active)
 | 
				
			|||||||
	for y=-range, range do
 | 
						for y=-range, range do
 | 
				
			||||||
	local vi = area:index(pos.x+(-range), pos.y+y, pos.z+z)
 | 
						local vi = area:index(pos.x+(-range), pos.y+y, pos.z+z)
 | 
				
			||||||
	for x=-range, range do
 | 
						for x=-range, range do
 | 
				
			||||||
		local relevant
 | 
							if x*x+y*y+z*z <= range     *  range    +  range    and
 | 
				
			||||||
		if shape == 0 then
 | 
							   x*x+y*y+z*z >= (range-1) * (range-1) + (range-1) then
 | 
				
			||||||
			local squared = x * x + y * y + z * z
 | 
								if active and data[vi] == c_air then
 | 
				
			||||||
			relevant =
 | 
					 | 
				
			||||||
				squared <= range       *  range      +  range and
 | 
					 | 
				
			||||||
				squared >= (range - 1) * (range - 1) + (range - 1)
 | 
					 | 
				
			||||||
		else
 | 
					 | 
				
			||||||
			relevant =
 | 
					 | 
				
			||||||
				x == -range or x == range or
 | 
					 | 
				
			||||||
				y == -range or y == range or
 | 
					 | 
				
			||||||
				z == -range or z == range
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		if relevant then
 | 
					 | 
				
			||||||
			local cid = data[vi]
 | 
					 | 
				
			||||||
			if active and replaceable_cids[cid] then
 | 
					 | 
				
			||||||
				data[vi] = c_field
 | 
									data[vi] = c_field
 | 
				
			||||||
			elseif not active and cid == c_field then
 | 
								elseif not active and data[vi] == c_field then
 | 
				
			||||||
				data[vi] = c_air
 | 
									data[vi] = c_air
 | 
				
			||||||
			end
 | 
								end
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
@@ -86,216 +59,54 @@ local function update_forcefield(pos, meta, active)
 | 
				
			|||||||
	vm:set_data(data)
 | 
						vm:set_data(data)
 | 
				
			||||||
	vm:update_liquids()
 | 
						vm:update_liquids()
 | 
				
			||||||
	vm:write_to_map()
 | 
						vm:write_to_map()
 | 
				
			||||||
 | 
						vm:update_map()
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local function set_forcefield_formspec(meta)
 | 
					local function set_forcefield_formspec(meta)
 | 
				
			||||||
	local formspec
 | 
						local formspec = "size[5,1.5]"..
 | 
				
			||||||
	if digilines_path then
 | 
							"field[2,0.5;2,1;range;"..S("Range")..";"..meta:get_int("range").."]"
 | 
				
			||||||
		formspec = "size[5,3.25]"..
 | 
					 | 
				
			||||||
			"field[0.3,3;5,1;channel;Digiline Channel;"..meta:get_string("channel").."]"
 | 
					 | 
				
			||||||
	else
 | 
					 | 
				
			||||||
		formspec = "size[5,2.25]"
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	formspec = formspec..
 | 
					 | 
				
			||||||
		"field[0.3,0.5;2,1;range;"..S("Range")..";"..meta:get_int("range").."]"
 | 
					 | 
				
			||||||
	-- The names for these toggle buttons are explicit about which
 | 
					 | 
				
			||||||
	-- state they'll switch to, so that multiple presses (arising
 | 
					 | 
				
			||||||
	-- from the ambiguity between lag and a missed press) only make
 | 
					 | 
				
			||||||
	-- the single change that the user expects.
 | 
					 | 
				
			||||||
	if meta:get_int("shape") == 0 then
 | 
					 | 
				
			||||||
		formspec = formspec.."button[3,0.2;2,1;shape1;"..S("Sphere").."]"
 | 
					 | 
				
			||||||
	else
 | 
					 | 
				
			||||||
		formspec = formspec.."button[3,0.2;2,1;shape0;"..S("Cube").."]"
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	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
 | 
					 | 
				
			||||||
	-- TODO: String replacement with %s will stop working with client-side translations
 | 
					 | 
				
			||||||
	if meta:get_int("enabled") == 0 then
 | 
						if meta:get_int("enabled") == 0 then
 | 
				
			||||||
		formspec = formspec.."button[0,1.75;5,1;enable;"..
 | 
							formspec = formspec.."button[0,1;5,1;enable;"..S("%s Disabled"):format(S("%s Forcefield Emitter"):format("HV")).."]"
 | 
				
			||||||
			S("%s Disabled"):format(S("%s Forcefield Emitter"):format("HV")).."]"
 | 
					 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
		formspec = formspec.."button[0,1.75;5,1;disable;"..
 | 
							formspec = formspec.."button[0,1;5,1;disable;"..S("%s Enabled"):format(S("%s Forcefield Emitter"):format("HV")).."]"
 | 
				
			||||||
			S("%s Enabled"):format(S("%s Forcefield Emitter"):format("HV")).."]"
 | 
					 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
	meta:set_string("formspec", formspec)
 | 
						meta:set_string("formspec", formspec)
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local forcefield_receive_fields = function(pos, formname, fields, sender)
 | 
					local forcefield_receive_fields = function(pos, formname, fields, sender)
 | 
				
			||||||
	local player_name = sender:get_player_name()
 | 
					 | 
				
			||||||
	if minetest.is_protected(pos, player_name) then
 | 
					 | 
				
			||||||
		minetest.chat_send_player(player_name, "You are not allowed to edit this!")
 | 
					 | 
				
			||||||
		minetest.record_protection_violation(pos, player_name)
 | 
					 | 
				
			||||||
		return
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	local meta = minetest.get_meta(pos)
 | 
						local meta = minetest.get_meta(pos)
 | 
				
			||||||
	local range = nil
 | 
					 | 
				
			||||||
	if fields.range then
 | 
						if fields.range then
 | 
				
			||||||
		range = tonumber(fields.range) or 0
 | 
							local range = tonumber(fields.range) or 0
 | 
				
			||||||
		-- Smallest field is 5. Anything less is asking for trouble.
 | 
							-- Smallest field is 5. Anything less is asking for trouble.
 | 
				
			||||||
		-- Largest is 20. It is a matter of pratical node handling.
 | 
							-- Largest is 20. It is a matter of pratical node handling.
 | 
				
			||||||
		-- At the maximim range updating the forcefield takes about 0.2s
 | 
							-- At the maximim range updating the forcefield takes about 0.2s
 | 
				
			||||||
		range = math.max(range, 5)
 | 
							range = math.max(range, 5)
 | 
				
			||||||
		range = math.min(range, 20)
 | 
							range = math.min(range, 20)
 | 
				
			||||||
		if range == meta:get_int("range") then range = nil end
 | 
							if meta:get_int("range") ~= range then
 | 
				
			||||||
 | 
								update_forcefield(pos, meta:get_int("range"), false)
 | 
				
			||||||
 | 
								meta:set_int("range", range)
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
	if fields.shape0 or fields.shape1 or range then
 | 
					 | 
				
			||||||
		update_forcefield(pos, meta, false)
 | 
					 | 
				
			||||||
	end
 | 
						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.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
 | 
				
			||||||
	if fields.disable then meta:set_int("enabled", 0) 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_forcefield_formspec(meta)
 | 
						set_forcefield_formspec(meta)
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local mesecons = {
 | 
					local mesecons = {
 | 
				
			||||||
	effector = {
 | 
						effector = {
 | 
				
			||||||
		action_on = function(pos, node)
 | 
							action_on = function(pos, node)
 | 
				
			||||||
			minetest.get_meta(pos):set_int("mesecon_effect", 1)
 | 
								minetest.get_meta(pos):set_int("enabled", 0)
 | 
				
			||||||
		end,
 | 
							end,
 | 
				
			||||||
		action_off = function(pos, node)
 | 
							action_off = function(pos, node)
 | 
				
			||||||
			minetest.get_meta(pos):set_int("mesecon_effect", 0)
 | 
								minetest.get_meta(pos):set_int("enabled", 1)
 | 
				
			||||||
		end
 | 
							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
 | 
					 | 
				
			||||||
			local msgt = type(msg)
 | 
					 | 
				
			||||||
			if msgt == "string" then
 | 
					 | 
				
			||||||
				local smsg = msg:lower()
 | 
					 | 
				
			||||||
				msg = {}
 | 
					 | 
				
			||||||
				if smsg == "get" then
 | 
					 | 
				
			||||||
					msg.command = "get"
 | 
					 | 
				
			||||||
				elseif smsg == "off" then
 | 
					 | 
				
			||||||
					msg.command = "off"
 | 
					 | 
				
			||||||
				elseif smsg == "on" then
 | 
					 | 
				
			||||||
					msg.command = "on"
 | 
					 | 
				
			||||||
				elseif smsg == "toggle" then
 | 
					 | 
				
			||||||
					msg.command = "toggle"
 | 
					 | 
				
			||||||
				elseif smsg:sub(1, 5) == "range" then
 | 
					 | 
				
			||||||
					msg.command = "range"
 | 
					 | 
				
			||||||
					msg.value = tonumber(smsg:sub(7))
 | 
					 | 
				
			||||||
				elseif smsg:sub(1, 5) == "shape" then
 | 
					 | 
				
			||||||
					msg.command = "shape"
 | 
					 | 
				
			||||||
					msg.value = smsg:sub(7):lower()
 | 
					 | 
				
			||||||
					msg.value = tonumber(msg.value) or msg.value
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
			elseif msgt ~= "table" then
 | 
					 | 
				
			||||||
				return
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			if msg.command == "get" then
 | 
					 | 
				
			||||||
				digilines.receptor_send(pos, digilines.rules.default, channel, {
 | 
					 | 
				
			||||||
					enabled = meta:get_int("enabled"),
 | 
					 | 
				
			||||||
					range   = meta:get_int("range"),
 | 
					 | 
				
			||||||
					shape   = meta:get_int("shape")
 | 
					 | 
				
			||||||
				})
 | 
					 | 
				
			||||||
				return
 | 
					 | 
				
			||||||
			elseif msg.command == "off" then
 | 
					 | 
				
			||||||
				meta:set_int("enabled", 0)
 | 
					 | 
				
			||||||
			elseif msg.command == "on" then
 | 
					 | 
				
			||||||
				meta:set_int("enabled", 1)
 | 
					 | 
				
			||||||
			elseif msg.command == "toggle" then
 | 
					 | 
				
			||||||
				local onn = meta:get_int("enabled")
 | 
					 | 
				
			||||||
				onn = 1-onn -- Mirror onn with pivot 0.5, so switch between 1 and 0.
 | 
					 | 
				
			||||||
				meta:set_int("enabled", onn)
 | 
					 | 
				
			||||||
			elseif msg.command == "range" then
 | 
					 | 
				
			||||||
				if type(msg.value) ~= "number" then
 | 
					 | 
				
			||||||
					return
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
				msg.value = math.max(msg.value, 5)
 | 
					 | 
				
			||||||
				msg.value = math.min(msg.value, 20)
 | 
					 | 
				
			||||||
				update_forcefield(pos, meta, false)
 | 
					 | 
				
			||||||
				meta:set_int("range", msg.value)
 | 
					 | 
				
			||||||
			elseif msg.command == "shape" then
 | 
					 | 
				
			||||||
				local valuet = type(msg.value)
 | 
					 | 
				
			||||||
				if valuet == "string" then
 | 
					 | 
				
			||||||
					if msg.value == "sphere" then
 | 
					 | 
				
			||||||
						msg.value = 0
 | 
					 | 
				
			||||||
					elseif msg.value == "cube" then
 | 
					 | 
				
			||||||
						msg.value = 1
 | 
					 | 
				
			||||||
					end
 | 
					 | 
				
			||||||
				elseif valuet ~= "number" then
 | 
					 | 
				
			||||||
					return
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
				if not msg.value then
 | 
					 | 
				
			||||||
					return
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
				update_forcefield(pos, meta, false)
 | 
					 | 
				
			||||||
				meta:set_int("shape", msg.value)
 | 
					 | 
				
			||||||
			else
 | 
					 | 
				
			||||||
				return
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			set_forcefield_formspec(meta)
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
local function run(pos, node)
 | 
					 | 
				
			||||||
	local meta = minetest.get_meta(pos)
 | 
					 | 
				
			||||||
	local eu_input   = meta:get_int("HV_EU_input")
 | 
					 | 
				
			||||||
	local enabled = meta:get_int("enabled") ~= 0 and
 | 
					 | 
				
			||||||
		(meta:get_int("mesecon_mode") == 0 or meta:get_int("mesecon_effect") ~= 0)
 | 
					 | 
				
			||||||
	local machine_name = S("%s Forcefield Emitter"):format("HV")
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	local range = meta:get_int("range")
 | 
					 | 
				
			||||||
	local power_requirement
 | 
					 | 
				
			||||||
	if meta:get_int("shape") == 0 then
 | 
					 | 
				
			||||||
		power_requirement = math.floor(4 * math.pi * range * range)
 | 
					 | 
				
			||||||
	else
 | 
					 | 
				
			||||||
		power_requirement = 24 * range * range
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	power_requirement = power_requirement * forcefield_power_drain
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if not enabled then
 | 
					 | 
				
			||||||
		if node.name == "technic:forcefield_emitter_on" then
 | 
					 | 
				
			||||||
			update_forcefield(pos, meta, false)
 | 
					 | 
				
			||||||
			technic.swap_node(pos, "technic:forcefield_emitter_off")
 | 
					 | 
				
			||||||
			meta:set_string("infotext", S("%s Disabled"):format(machine_name))
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		meta:set_int("HV_EU_demand", 0)
 | 
					 | 
				
			||||||
		return
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	meta:set_int("HV_EU_demand", power_requirement)
 | 
					 | 
				
			||||||
	if eu_input < power_requirement then
 | 
					 | 
				
			||||||
		meta:set_string("infotext", S("%s Unpowered"):format(machine_name))
 | 
					 | 
				
			||||||
		if node.name == "technic:forcefield_emitter_on" then
 | 
					 | 
				
			||||||
			update_forcefield(pos, meta, false)
 | 
					 | 
				
			||||||
			technic.swap_node(pos, "technic:forcefield_emitter_off")
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	elseif eu_input >= power_requirement then
 | 
					 | 
				
			||||||
		if node.name == "technic:forcefield_emitter_off" then
 | 
					 | 
				
			||||||
			technic.swap_node(pos, "technic:forcefield_emitter_on")
 | 
					 | 
				
			||||||
			meta:set_string("infotext", S("%s Active"):format(machine_name))
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		update_forcefield(pos, meta, true)
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
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",
 | 
						groups = {cracky = 1},
 | 
				
			||||||
		"technic_machine_bottom.png"..cable_entry,
 | 
					 | 
				
			||||||
		"technic_forcefield_emitter_off.png",
 | 
					 | 
				
			||||||
		"technic_forcefield_emitter_off.png",
 | 
					 | 
				
			||||||
		"technic_forcefield_emitter_off.png",
 | 
					 | 
				
			||||||
		"technic_forcefield_emitter_off.png"
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	groups = {cracky = 1, technic_machine = 1, technic_hv = 1},
 | 
					 | 
				
			||||||
	on_receive_fields = forcefield_receive_fields,
 | 
						on_receive_fields = forcefield_receive_fields,
 | 
				
			||||||
	on_construct = function(pos)
 | 
						on_construct = function(pos)
 | 
				
			||||||
		local meta = minetest.get_meta(pos)
 | 
							local meta = minetest.get_meta(pos)
 | 
				
			||||||
@@ -303,59 +114,37 @@ minetest.register_node("technic:forcefield_emitter_off", {
 | 
				
			|||||||
		meta:set_int("HV_EU_demand", 0)
 | 
							meta:set_int("HV_EU_demand", 0)
 | 
				
			||||||
		meta:set_int("range", 10)
 | 
							meta:set_int("range", 10)
 | 
				
			||||||
		meta:set_int("enabled", 0)
 | 
							meta:set_int("enabled", 0)
 | 
				
			||||||
		meta:set_int("mesecon_mode", 0)
 | 
					 | 
				
			||||||
		meta:set_int("mesecon_effect", 0)
 | 
					 | 
				
			||||||
		if digilines_path then
 | 
					 | 
				
			||||||
			meta:set_string("channel", "forcefield"..minetest.pos_to_string(pos))
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		meta:set_string("infotext", S("%s Forcefield Emitter"):format("HV"))
 | 
							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,
 | 
					 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
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",
 | 
						groups = {cracky = 1, not_in_creative_inventory=1},
 | 
				
			||||||
		"technic_machine_bottom.png"..cable_entry,
 | 
					 | 
				
			||||||
		"technic_forcefield_emitter_on.png",
 | 
					 | 
				
			||||||
		"technic_forcefield_emitter_on.png",
 | 
					 | 
				
			||||||
		"technic_forcefield_emitter_on.png",
 | 
					 | 
				
			||||||
		"technic_forcefield_emitter_on.png"
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	groups = {cracky = 1, technic_machine = 1, technic_hv = 1,
 | 
					 | 
				
			||||||
			not_in_creative_inventory=1},
 | 
					 | 
				
			||||||
	drop = "technic:forcefield_emitter_off",
 | 
						drop = "technic:forcefield_emitter_off",
 | 
				
			||||||
	on_receive_fields = forcefield_receive_fields,
 | 
						on_receive_fields = forcefield_receive_fields,
 | 
				
			||||||
 | 
						on_construct = function(pos) 
 | 
				
			||||||
 | 
							local meta = minetest.get_meta(pos)
 | 
				
			||||||
 | 
							local range = meta:get_int("range")
 | 
				
			||||||
 | 
							meta:set_string("formspec", get_forcefield_formspec(range))
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
	on_destruct = function(pos)
 | 
						on_destruct = function(pos)
 | 
				
			||||||
		local meta = minetest.get_meta(pos)
 | 
							local meta = minetest.get_meta(pos)
 | 
				
			||||||
		update_forcefield(pos, meta, false)
 | 
							update_forcefield(pos, meta:get_int("range"), false)
 | 
				
			||||||
	end,
 | 
					 | 
				
			||||||
	mesecons = mesecons,
 | 
					 | 
				
			||||||
	digiline = digiline_def,
 | 
					 | 
				
			||||||
	technic_run = run,
 | 
					 | 
				
			||||||
	technic_on_disable = function (pos, node)
 | 
					 | 
				
			||||||
		local meta = minetest.get_meta(pos)
 | 
					 | 
				
			||||||
		update_forcefield(pos, meta, false)
 | 
					 | 
				
			||||||
		technic.swap_node(pos, "technic:forcefield_emitter_off")
 | 
					 | 
				
			||||||
	end,
 | 
					 | 
				
			||||||
	on_blast = function(pos, intensity)
 | 
					 | 
				
			||||||
		minetest.dig_node(pos)
 | 
					 | 
				
			||||||
		return {"technic:forcefield_emitter_off"}
 | 
					 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
 | 
						mesecons = mesecons
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
minetest.register_node("technic:forcefield", {
 | 
					minetest.register_node("technic:forcefield", {
 | 
				
			||||||
	description = S("%s Forcefield"):format("HV"),
 | 
						description = S("%s Forcefield"):format("HV"),
 | 
				
			||||||
	sunlight_propagates = true,
 | 
						sunlight_propagates = true,
 | 
				
			||||||
	drawtype = "glasslike",
 | 
						drawtype = "glasslike",
 | 
				
			||||||
	groups = {not_in_creative_inventory=1},
 | 
						groups = {not_in_creative_inventory=1, unbreakable=1},
 | 
				
			||||||
	paramtype = "light",
 | 
						paramtype = "light",
 | 
				
			||||||
	light_source = default.LIGHT_MAX,
 | 
					        light_source = 15,
 | 
				
			||||||
	diggable = false,
 | 
					 | 
				
			||||||
	drop = '',
 | 
						drop = '',
 | 
				
			||||||
	tiles = {{
 | 
						tiles = {{
 | 
				
			||||||
		name = "technic_forcefield_animated.png",
 | 
							name = "technic_forcefield_animated.png",
 | 
				
			||||||
@@ -366,14 +155,53 @@ minetest.register_node("technic:forcefield", {
 | 
				
			|||||||
			length = 1.0,
 | 
								length = 1.0,
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
	}},
 | 
						}},
 | 
				
			||||||
	on_blast = function(pos, intensity)
 | 
					})
 | 
				
			||||||
	end,
 | 
					minetest.register_abm({
 | 
				
			||||||
 | 
						nodenames = {"technic:forcefield_emitter_on", "technic:forcefield_emitter_off"},
 | 
				
			||||||
 | 
						interval = 1,
 | 
				
			||||||
 | 
						chance = 1,
 | 
				
			||||||
 | 
						action = function(pos, node, active_object_count, active_object_count_wider)
 | 
				
			||||||
 | 
							local meta = minetest.get_meta(pos)
 | 
				
			||||||
 | 
							local eu_input   = meta:get_int("HV_EU_input")
 | 
				
			||||||
 | 
							local eu_demand  = meta:get_int("HV_EU_demand")
 | 
				
			||||||
 | 
							local enabled    = meta:get_int("enabled")
 | 
				
			||||||
 | 
							local machine_name = S("%s Forcefield Emitter"):format("HV")
 | 
				
			||||||
 | 
							-- Power off automatically if no longer connected to a switching station
 | 
				
			||||||
 | 
							technic.switching_station_timeout_count(pos, "HV")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							local power_requirement = math.floor(
 | 
				
			||||||
 | 
									4 * math.pi * math.pow(meta:get_int("range"), 2)
 | 
				
			||||||
 | 
								) * forcefield_power_drain
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if meta:get_int("enabled") == 0 then
 | 
				
			||||||
 | 
								if node.name == "technic:forcefield_emitter_on" then
 | 
				
			||||||
 | 
									meta:set_int("HV_EU_demand", 0)
 | 
				
			||||||
 | 
									update_forcefield(pos, meta:get_int("range"), false)
 | 
				
			||||||
 | 
									technic.swap_node(pos, "technic:forcefield_emitter_off")
 | 
				
			||||||
 | 
									meta:set_string("infotext", S("%s Disabled"):format(machine_name))
 | 
				
			||||||
 | 
									return
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							elseif eu_input < power_requirement then
 | 
				
			||||||
 | 
								meta:set_string("infotext", S("%s Unpowered"):format(machine_name))
 | 
				
			||||||
 | 
								if node.name == "technic:forcefield_emitter_on" then
 | 
				
			||||||
 | 
									update_forcefield(pos, meta:get_int("range"), false)
 | 
				
			||||||
 | 
									technic.swap_node(pos, "technic:forcefield_emitter_off")
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							elseif eu_input >= power_requirement then
 | 
				
			||||||
 | 
								if node.name == "technic:forcefield_emitter_off" then
 | 
				
			||||||
 | 
									technic.swap_node(pos, "technic:forcefield_emitter_on")
 | 
				
			||||||
 | 
									meta:set_string("infotext", S("%s Active"):format(machine_name))
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
								update_forcefield(pos, meta:get_int("range"), true)
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							meta:set_int("HV_EU_demand", power_requirement)
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
if minetest.get_modpath("mesecons_mvps") then
 | 
					if minetest.get_modpath("mesecons_mvps") then
 | 
				
			||||||
	mesecon.register_mvps_stopper("technic:forcefield")
 | 
						mesecon:register_mvps_stopper("technic:forcefield")
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					-- TODO: Register a stopper for frames
 | 
				
			||||||
 | 
					
 | 
				
			||||||
technic.register_machine("HV", "technic:forcefield_emitter_on",  technic.receiver)
 | 
					technic.register_machine("HV", "technic:forcefield_emitter_on",  technic.receiver)
 | 
				
			||||||
technic.register_machine("HV", "technic:forcefield_emitter_off", technic.receiver)
 | 
					technic.register_machine("HV", "technic:forcefield_emitter_off", technic.receiver)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,9 +3,9 @@ minetest.register_alias("hv_generator", "technic:hv_generator")
 | 
				
			|||||||
minetest.register_craft({
 | 
					minetest.register_craft({
 | 
				
			||||||
	output = 'technic:hv_generator',
 | 
						output = 'technic:hv_generator',
 | 
				
			||||||
	recipe = {
 | 
						recipe = {
 | 
				
			||||||
		{'technic:carbon_plate',          'technic:mv_generator',   'technic:composite_plate'},
 | 
							{'technic:stainless_steel_ingot', 'technic:mv_generator',   'technic:stainless_steel_ingot'},
 | 
				
			||||||
		{'pipeworks:tube_1',              'technic:hv_transformer', 'pipeworks:tube_1'},
 | 
							{'pipeworks:tube_1',              'technic:hv_transformer', 'pipeworks:tube_1'},
 | 
				
			||||||
		{'technic:stainless_steel_ingot', 'technic:hv_cable',       'technic:stainless_steel_ingot'},
 | 
							{'technic:stainless_steel_ingot', 'technic:hv_cable0',      'technic:stainless_steel_ingot'},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,492 +1,244 @@
 | 
				
			|||||||
--[[
 | 
					-- The enriched uranium rod driven EU generator.
 | 
				
			||||||
 The enriched uranium rod driven EU generator.
 | 
					-- A very large and advanced machine providing vast amounts of power.
 | 
				
			||||||
A very large and advanced machine providing vast amounts of power.
 | 
					-- Very efficient but also expensive to run as it needs uranium. (10000EU 86400 ticks (one week))
 | 
				
			||||||
Very efficient but also expensive to run as it needs uranium.
 | 
					-- Provides HV EUs that can be down converted as needed.
 | 
				
			||||||
Provides 10000 HV EUs for one week (only counted when loaded).
 | 
					--
 | 
				
			||||||
 | 
					-- The nuclear reactor core needs water and a protective shield to work.
 | 
				
			||||||
 | 
					-- This is checked now and then and if the machine is tampered with... BOOM!
 | 
				
			||||||
 | 
					
 | 
				
			||||||
The nuclear reactor core requires a casing of water and a protective
 | 
					local burn_ticks   = 7 * 24 * 60 * 60       -- (seconds).
 | 
				
			||||||
shield to work.  This is checked now and then and if the casing is not
 | 
					 | 
				
			||||||
intact the reactor will melt down!
 | 
					 | 
				
			||||||
--]]
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
local burn_ticks = 7 * 24 * 60 * 60  -- Seconds
 | 
					 | 
				
			||||||
local power_supply = 100000                 -- EUs
 | 
					local power_supply = 100000                 -- EUs
 | 
				
			||||||
local fuel_type = "technic:uranium_fuel"  -- The reactor burns this
 | 
					local fuel_type    = "technic:uranium_fuel" -- The reactor burns this stuff
 | 
				
			||||||
local digiline_meltdown = technic.config:get_bool("enable_nuclear_reactor_digiline_selfdestruct")
 | 
					 | 
				
			||||||
local digiline_remote_path = minetest.get_modpath("digiline_remote")
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
local S = technic.getter
 | 
					local S = technic.getter
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local reactor_desc = S("@1 Nuclear Reactor Core", S("HV"))
 | 
					-- FIXME: recipe must make more sense like a rod recepticle, steam chamber, HV generator?
 | 
				
			||||||
local cable_entry = "^technic_cable_connection_overlay.png"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- FIXME: Recipe should make more sense like a rod recepticle, steam chamber, HV generator?
 | 
					 | 
				
			||||||
minetest.register_craft({
 | 
					minetest.register_craft({
 | 
				
			||||||
	output = 'technic:hv_nuclear_reactor_core',
 | 
						output = 'technic:hv_nuclear_reactor_core',
 | 
				
			||||||
	recipe = {
 | 
						recipe = {
 | 
				
			||||||
		{'technic:carbon_plate',          'default:obsidian_glass', 'technic:carbon_plate'},
 | 
							{'technic:stainless_steel_ingot', 'technic:stainless_steel_ingot', 'technic:stainless_steel_ingot'},
 | 
				
			||||||
		{'technic:composite_plate',       'technic:machine_casing', 'technic:composite_plate'},
 | 
							{'technic:stainless_steel_ingot',        'technic:machine_casing', 'technic:stainless_steel_ingot'},
 | 
				
			||||||
		{'technic:stainless_steel_ingot', 'technic:hv_cable',       'technic:stainless_steel_ingot'},
 | 
							{'technic:stainless_steel_ingot',             'technic:hv_cable0', 'technic:stainless_steel_ingot'},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local function make_reactor_formspec(meta)
 | 
					local generator_formspec =
 | 
				
			||||||
	local f = "size[8,9]"..
 | 
						"invsize[8,9;]"..
 | 
				
			||||||
	"label[0,0;"..S("Nuclear Reactor Rod Compartment").."]"..
 | 
						"label[0,0;"..S("Nuclear Reactor Rod Compartment").."]"..
 | 
				
			||||||
	"list[current_name;src;2,1;3,2;]"..
 | 
						"list[current_name;src;2,1;3,2;]"..
 | 
				
			||||||
	"list[current_player;main;0,5;8,4;]"..
 | 
						"list[current_player;main;0,5;8,4;]"
 | 
				
			||||||
	"listring[]"..
 | 
					 | 
				
			||||||
	"button[5.5,1.5;2,1;start;Start]"..
 | 
					 | 
				
			||||||
	"checkbox[5.5,2.5;autostart;automatic Start;"..meta:get_string("autostart").."]"
 | 
					 | 
				
			||||||
	if not digiline_remote_path then
 | 
					 | 
				
			||||||
		return f
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	local digiline_enabled = meta:get_string("enable_digiline")
 | 
					 | 
				
			||||||
	f = f.."checkbox[0.5,2.8;enable_digiline;Enable Digiline;"..digiline_enabled.."]"
 | 
					 | 
				
			||||||
	if digiline_enabled ~= "true" then
 | 
					 | 
				
			||||||
		return f
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	return f..
 | 
					 | 
				
			||||||
		"button_exit[4.6,3.69;2,1;save;Save]"..
 | 
					 | 
				
			||||||
		"field[1,4;4,1;remote_channel;Digiline Remote Channel;${remote_channel}]"
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
local SS_OFF = 0
 | 
					-- "Boxy sphere"
 | 
				
			||||||
local SS_DANGER = 1
 | 
					local nodebox = {
 | 
				
			||||||
local SS_CLEAR = 2
 | 
						{ -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 reactor_siren = {}
 | 
					minetest.register_node("technic:hv_nuclear_reactor_core", {
 | 
				
			||||||
local function siren_set_state(pos, state)
 | 
						description = S("Nuclear %s Generator Core"):format("HV"),
 | 
				
			||||||
	local hpos = minetest.hash_node_position(pos)
 | 
						tiles = {"technic_hv_nuclear_reactor_core.png", "technic_hv_nuclear_reactor_core.png",
 | 
				
			||||||
	local siren = reactor_siren[hpos]
 | 
						         "technic_hv_nuclear_reactor_core.png", "technic_hv_nuclear_reactor_core.png",
 | 
				
			||||||
	if not siren then
 | 
						         "technic_hv_nuclear_reactor_core.png", "technic_hv_nuclear_reactor_core.png"},
 | 
				
			||||||
		if state == SS_OFF then return end
 | 
						groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2},
 | 
				
			||||||
		siren = {state=SS_OFF}
 | 
						legacy_facedir_simple = true,
 | 
				
			||||||
		reactor_siren[hpos] = siren
 | 
						sounds = default.node_sound_wood_defaults(),
 | 
				
			||||||
	end
 | 
						drawtype="nodebox",
 | 
				
			||||||
	if state == SS_DANGER and siren.state ~= SS_DANGER then
 | 
						paramtype = "light",
 | 
				
			||||||
		if siren.handle then minetest.sound_stop(siren.handle) end
 | 
						stack_max = 1,
 | 
				
			||||||
		siren.handle = minetest.sound_play("technic_hv_nuclear_reactor_siren_danger_loop",
 | 
						node_box = {
 | 
				
			||||||
				{pos=pos, gain=1.5, loop=true, max_hear_distance=48})
 | 
							type = "fixed",
 | 
				
			||||||
		siren.state = SS_DANGER
 | 
							fixed = nodebox
 | 
				
			||||||
	elseif state == SS_CLEAR then
 | 
						},
 | 
				
			||||||
		if siren.handle then minetest.sound_stop(siren.handle) end
 | 
						on_construct = function(pos)
 | 
				
			||||||
		local clear_handle = minetest.sound_play("technic_hv_nuclear_reactor_siren_clear",
 | 
							local meta = minetest.get_meta(pos)
 | 
				
			||||||
				{pos=pos, gain=1.5, loop=false, max_hear_distance=48})
 | 
							meta:set_string("infotext", S("Nuclear %s Generator Core"):format("HV"))
 | 
				
			||||||
		siren.handle = clear_handle
 | 
							meta:set_int("HV_EU_supply", 0)
 | 
				
			||||||
		siren.state = SS_CLEAR
 | 
							-- Signal to the switching station that this device burns some
 | 
				
			||||||
		minetest.after(10, function()
 | 
							-- sort of fuel and needs special handling
 | 
				
			||||||
			if siren.handle ~= clear_handle then return end
 | 
							meta:set_int("HV_EU_from_fuel", 1)
 | 
				
			||||||
			minetest.sound_stop(clear_handle)
 | 
							meta:set_int("burn_time", 0)
 | 
				
			||||||
			if reactor_siren[hpos] == siren then
 | 
							meta:set_string("formspec", generator_formspec)
 | 
				
			||||||
				reactor_siren[hpos] = nil
 | 
							local inv = meta:get_inventory()
 | 
				
			||||||
			end
 | 
							inv:set_size("src", 6)
 | 
				
			||||||
		end)
 | 
						end,	
 | 
				
			||||||
	elseif state == SS_OFF and siren.state ~= SS_OFF then
 | 
						can_dig = technic.machine_can_dig,
 | 
				
			||||||
		if siren.handle then minetest.sound_stop(siren.handle) end
 | 
						allow_metadata_inventory_put = technic.machine_inventory_put,
 | 
				
			||||||
		reactor_siren[hpos] = nil
 | 
						allow_metadata_inventory_take = technic.machine_inventory_take,
 | 
				
			||||||
	end
 | 
						allow_metadata_inventory_move = technic.machine_inventory_move,
 | 
				
			||||||
end
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local function siren_danger(pos, meta)
 | 
					minetest.register_node("technic:hv_nuclear_reactor_core_active", {
 | 
				
			||||||
	meta:set_int("siren", 1)
 | 
						tiles = {"technic_hv_nuclear_reactor_core.png", "technic_hv_nuclear_reactor_core.png",
 | 
				
			||||||
	siren_set_state(pos, SS_DANGER)
 | 
						         "technic_hv_nuclear_reactor_core.png", "technic_hv_nuclear_reactor_core.png",
 | 
				
			||||||
end
 | 
							 "technic_hv_nuclear_reactor_core.png", "technic_hv_nuclear_reactor_core.png"},
 | 
				
			||||||
 | 
						groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1},
 | 
				
			||||||
 | 
						legacy_facedir_simple = true,
 | 
				
			||||||
 | 
						sounds = default.node_sound_wood_defaults(),
 | 
				
			||||||
 | 
						drop="technic:hv_nuclear_reactor_core",
 | 
				
			||||||
 | 
						drawtype="nodebox",
 | 
				
			||||||
 | 
						light_source = 15,
 | 
				
			||||||
 | 
						paramtype = "light",
 | 
				
			||||||
 | 
						node_box = {
 | 
				
			||||||
 | 
							type = "fixed",
 | 
				
			||||||
 | 
							fixed = nodebox
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						can_dig = technic.machine_can_dig,
 | 
				
			||||||
 | 
						allow_metadata_inventory_put = technic.machine_inventory_put,
 | 
				
			||||||
 | 
						allow_metadata_inventory_take = technic.machine_inventory_take,
 | 
				
			||||||
 | 
						allow_metadata_inventory_move = technic.machine_inventory_move,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local function siren_clear(pos, meta)
 | 
					local check_reactor_structure = function(pos)
 | 
				
			||||||
	if meta:get_int("siren") ~= 0 then
 | 
						-- The reactor consists of a 9x9x9 cube structure
 | 
				
			||||||
		siren_set_state(pos, SS_CLEAR)
 | 
						-- A cross section through the middle:
 | 
				
			||||||
		meta:set_int("siren", 0)
 | 
						--  CCCC CCCC
 | 
				
			||||||
	end
 | 
						--  CBBB BBBC
 | 
				
			||||||
end
 | 
						--  CBSS SSBC
 | 
				
			||||||
 | 
						--  CBSWWWSBC
 | 
				
			||||||
 | 
						--  CBSW#WSBC
 | 
				
			||||||
 | 
						--  CBSW|WSBC
 | 
				
			||||||
 | 
						--  CBSS|SSBC
 | 
				
			||||||
 | 
						--  CBBB|BBBC
 | 
				
			||||||
 | 
						--  CCCC|CCCC
 | 
				
			||||||
 | 
						--  C = Concrete, B = Blast resistant concrete, S = Stainless Steel,
 | 
				
			||||||
 | 
						--  W = water node, # = reactor core, | = HV cable
 | 
				
			||||||
 | 
						--  The man-hole and the HV cable is only in the middle
 | 
				
			||||||
 | 
						--  The man-hole is optional
 | 
				
			||||||
 | 
					
 | 
				
			||||||
--[[
 | 
					 | 
				
			||||||
The standard reactor structure consists of a 9x9x9 cube.  A cross
 | 
					 | 
				
			||||||
section through the middle:
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	CCCC CCCC
 | 
					 | 
				
			||||||
	CBBB BBBC
 | 
					 | 
				
			||||||
	CBLL LLBC
 | 
					 | 
				
			||||||
	CBLWWWLBC
 | 
					 | 
				
			||||||
	CBLW#WLBC
 | 
					 | 
				
			||||||
	CBLW|WLBC
 | 
					 | 
				
			||||||
	CBLL|LLBC
 | 
					 | 
				
			||||||
	CBBB|BBBC
 | 
					 | 
				
			||||||
	CCCC|CCCC
 | 
					 | 
				
			||||||
	C = Concrete, B = Blast-resistant concrete, L = Lead,
 | 
					 | 
				
			||||||
	W = water node, # = reactor core, | = HV cable
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
The man-hole is optional (but necessary for refueling).
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
For the reactor to operate and not melt down, it insists on the inner
 | 
					 | 
				
			||||||
7x7x7 portion (from the core out to the blast-resistant concrete)
 | 
					 | 
				
			||||||
being intact.  Intactness only depends on the number of nodes of the
 | 
					 | 
				
			||||||
right type in each layer.  The water layer must have water in all but
 | 
					 | 
				
			||||||
at most one node; the steel and blast-resistant concrete layers must
 | 
					 | 
				
			||||||
have the right material in all but at most two nodes.  The permitted
 | 
					 | 
				
			||||||
gaps are meant for the cable and man-hole, but can actually be anywhere
 | 
					 | 
				
			||||||
and contain anything.  For the reactor to be useful, a cable must
 | 
					 | 
				
			||||||
connect to the core, but it can go in any direction.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
The outer concrete layer of the standard structure is not required
 | 
					 | 
				
			||||||
for the reactor to operate.  It is noted here because it used to
 | 
					 | 
				
			||||||
be mandatory, and for historical reasons (that it predates the
 | 
					 | 
				
			||||||
implementation of radiation) it needs to continue being adequate
 | 
					 | 
				
			||||||
shielding of legacy reactors.  If it ever ceases to be adequate
 | 
					 | 
				
			||||||
shielding for new reactors, legacy ones should be grandfathered.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
For legacy reasons, if the reactor has a stainless steel layer instead
 | 
					 | 
				
			||||||
of a lead layer it will be converted to a lead layer.
 | 
					 | 
				
			||||||
--]]
 | 
					 | 
				
			||||||
local function reactor_structure_badness(pos)
 | 
					 | 
				
			||||||
	local vm = VoxelManip()
 | 
						local vm = VoxelManip()
 | 
				
			||||||
	local pos1 = vector.subtract(pos, 3)
 | 
						local pos1 = vector.subtract(pos, 4)
 | 
				
			||||||
	local pos2 = vector.add(pos, 3)
 | 
						local pos2 = vector.add(pos, 4)
 | 
				
			||||||
	local MinEdge, MaxEdge = vm:read_from_map(pos1, pos2)
 | 
						local MinEdge, MaxEdge = vm:read_from_map(pos1, pos2)
 | 
				
			||||||
	local data = vm:get_data()
 | 
						local data = vm:get_data()
 | 
				
			||||||
	local area = VoxelArea:new({MinEdge=MinEdge, MaxEdge=MaxEdge})
 | 
						local area = VoxelArea:new({MinEdge=MinEdge, MaxEdge=MaxEdge})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						local c_concrete = minetest.get_content_id("technic:concrete")
 | 
				
			||||||
	local c_blast_concrete = minetest.get_content_id("technic:blast_resistant_concrete")
 | 
						local c_blast_concrete = minetest.get_content_id("technic:blast_resistant_concrete")
 | 
				
			||||||
	local c_lead = minetest.get_content_id("technic:lead_block")
 | 
						local c_stainless_steel = minetest.get_content_id("technic:stainless_steel_block")
 | 
				
			||||||
	local c_steel = minetest.get_content_id("technic:stainless_steel_block")
 | 
					 | 
				
			||||||
	local c_water_source = minetest.get_content_id("default:water_source")
 | 
						local c_water_source = minetest.get_content_id("default:water_source")
 | 
				
			||||||
	local c_water_flowing = minetest.get_content_id("default:water_flowing")
 | 
						local c_water_flowing = minetest.get_content_id("default:water_flowing")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	local blast_layer, steel_layer, lead_layer, water_layer = 0, 0, 0, 0
 | 
						local concretelayer, blastlayer, steellayer, waterlayer = 0, 0, 0, 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for z = pos1.z, pos2.z do
 | 
						for z = pos1.z, pos2.z do
 | 
				
			||||||
	for y = pos1.y, pos2.y do
 | 
						for y = pos1.y, pos2.y do
 | 
				
			||||||
	for x = pos1.x, pos2.x do
 | 
						for x = pos1.x, pos2.x do
 | 
				
			||||||
		local cid = data[area:index(x, y, z)]
 | 
							-- If the position is in the outer layer
 | 
				
			||||||
		if x == pos1.x or x == pos2.x or
 | 
							if x == pos1.x or x == pos2.x or
 | 
				
			||||||
		   y == pos1.y or y == pos2.y or
 | 
							   y == pos1.y or y == pos2.y or
 | 
				
			||||||
		   z == pos1.z or z == pos2.z then
 | 
							   z == pos1.z or z == pos2.z then
 | 
				
			||||||
			if cid == c_blast_concrete then
 | 
								if data[area:index(x, y, z)] == c_concrete then
 | 
				
			||||||
				blast_layer = blast_layer + 1
 | 
									concretelayer = concretelayer + 1
 | 
				
			||||||
			end
 | 
								end
 | 
				
			||||||
		elseif x == pos1.x+1 or x == pos2.x-1 or
 | 
							elseif x == pos1.x+1 or x == pos2.x-1 or
 | 
				
			||||||
		   y == pos1.y+1 or y == pos2.y-1 or
 | 
							   y == pos1.y+1 or y == pos2.y-1 or
 | 
				
			||||||
		   z == pos1.z+1 or z == pos2.z-1 then
 | 
							   z == pos1.z+1 or z == pos2.z-1 then
 | 
				
			||||||
			if cid == c_lead then
 | 
								if data[area:index(x, y, z)] == c_blast_concrete then
 | 
				
			||||||
				lead_layer = lead_layer + 1
 | 
									blastlayer = blastlayer + 1
 | 
				
			||||||
			elseif cid == c_steel then
 | 
					 | 
				
			||||||
				steel_layer = steel_layer + 1
 | 
					 | 
				
			||||||
			end
 | 
								end
 | 
				
			||||||
		elseif x == pos1.x+2 or x == pos2.x-2 or
 | 
							elseif x == pos1.x+2 or x == pos2.x-2 or
 | 
				
			||||||
		   y == pos1.y+2 or y == pos2.y-2 or
 | 
							   y == pos1.y+2 or y == pos2.y-2 or
 | 
				
			||||||
		   z == pos1.z+2 or z == pos2.z-2 then
 | 
							   z == pos1.z+2 or z == pos2.z-2 then
 | 
				
			||||||
 | 
								if data[area:index(x, y, z)] == c_stainless_steel then
 | 
				
			||||||
 | 
									steellayer = steellayer + 1
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							elseif x == pos1.x+3 or x == pos2.x-3 or
 | 
				
			||||||
 | 
							   y == pos1.y+3 or y == pos2.y-3 or
 | 
				
			||||||
 | 
							   z == pos1.z+3 or z == pos2.z-3 then
 | 
				
			||||||
 | 
							   	local cid = data[area:index(x, y, z)]
 | 
				
			||||||
			if cid == c_water_source or cid == c_water_flowing then
 | 
								if cid == c_water_source or cid == c_water_flowing then
 | 
				
			||||||
				water_layer = water_layer + 1
 | 
									waterlayer = waterlayer + 1
 | 
				
			||||||
			end
 | 
								end
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
 | 
						if waterlayer >= 25 and
 | 
				
			||||||
 | 
						   steellayer >= 96 and
 | 
				
			||||||
 | 
						   blastlayer >= 216 and
 | 
				
			||||||
 | 
						   concretelayer >= 384 then
 | 
				
			||||||
 | 
							return true
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local explode_reactor = function(pos)
 | 
				
			||||||
 | 
						print("A reactor exploded at "..minetest.pos_to_string(pos))
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local function damage_nearby_players(pos)
 | 
				
			||||||
 | 
						local objs = minetest.get_objects_inside_radius(pos, 4)
 | 
				
			||||||
 | 
						for _, o in pairs(objs) do
 | 
				
			||||||
 | 
							if o:is_player() then
 | 
				
			||||||
 | 
								o:set_hp(math.max(o:get_hp() - 2, 0))
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if steel_layer >= 96 then
 | 
					minetest.register_abm({
 | 
				
			||||||
		for z = pos1.z+1, pos2.z-1 do
 | 
						nodenames = {"technic:hv_nuclear_reactor_core", "technic:hv_nuclear_reactor_core_active"},
 | 
				
			||||||
		for y = pos1.y+1, pos2.y-1 do
 | 
						interval = 1,
 | 
				
			||||||
		for x = pos1.x+1, pos2.x-1 do
 | 
						chance   = 1,
 | 
				
			||||||
			local vi = area:index(x, y, z)
 | 
						action = function(pos, node, active_object_count, active_object_count_wider)
 | 
				
			||||||
			if x == pos1.x+1 or x == pos2.x-1 or
 | 
							local meta = minetest.get_meta(pos)
 | 
				
			||||||
			   y == pos1.y+1 or y == pos2.y-1 or
 | 
							local machine_name = S("Nuclear %s Generator Core"):format("HV")
 | 
				
			||||||
			   z == pos1.z+1 or z == pos2.z-1 then
 | 
							local burn_time = meta:get_int("burn_time") or 0
 | 
				
			||||||
				if data[vi] == c_steel then
 | 
					 | 
				
			||||||
					data[vi] = c_lead
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		vm:set_data(data)
 | 
					 | 
				
			||||||
		vm:write_to_map()
 | 
					 | 
				
			||||||
		lead_layer = steel_layer
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if water_layer > 25 then water_layer = 25 end
 | 
							if burn_time >= burn_ticks or burn_time == 0 then
 | 
				
			||||||
	if lead_layer > 96 then lead_layer = 96 end
 | 
					 | 
				
			||||||
	if blast_layer > 216 then blast_layer = 216 end
 | 
					 | 
				
			||||||
	return (25 - water_layer) + (96 - lead_layer) + (216 - blast_layer)
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
local function melt_down_reactor(pos)
 | 
					 | 
				
			||||||
	minetest.log("action", "A reactor melted down at "..minetest.pos_to_string(pos))
 | 
					 | 
				
			||||||
	minetest.set_node(pos, {name = "technic:corium_source"})
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
local function start_reactor(pos, meta)
 | 
					 | 
				
			||||||
	local correct_fuel_count = 6
 | 
					 | 
				
			||||||
	local msg_fuel_missing = "Error: You need to insert " .. correct_fuel_count .. " pieces of Uranium Fuel."
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if minetest.get_node(pos).name ~= "technic:hv_nuclear_reactor_core" then
 | 
					 | 
				
			||||||
		return msg_fuel_missing
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
			local inv = meta:get_inventory()
 | 
								local inv = meta:get_inventory()
 | 
				
			||||||
	if inv:is_empty("src") then
 | 
								if not inv:is_empty("src") then 
 | 
				
			||||||
		return msg_fuel_missing
 | 
									local srclist = inv:get_list("src")
 | 
				
			||||||
	end
 | 
									local correct_fuel_count = 0
 | 
				
			||||||
	local src_list = inv:get_list("src")
 | 
									for _, srcstack in pairs(srclist) do
 | 
				
			||||||
	local fuel_count = 0
 | 
										if srcstack then
 | 
				
			||||||
	for _, src_stack in pairs(src_list) do
 | 
											if  srcstack:get_name() == fuel_type then
 | 
				
			||||||
		if src_stack and src_stack:get_name() == fuel_type then
 | 
												correct_fuel_count = correct_fuel_count + 1
 | 
				
			||||||
			fuel_count = fuel_count + 1
 | 
					 | 
				
			||||||
						end
 | 
											end
 | 
				
			||||||
					end
 | 
										end
 | 
				
			||||||
	-- Check that the has the correct fuel
 | 
					 | 
				
			||||||
	if fuel_count ~= correct_fuel_count then
 | 
					 | 
				
			||||||
		return msg_fuel_missing
 | 
					 | 
				
			||||||
				end
 | 
									end
 | 
				
			||||||
 | 
									-- Check that the reactor is complete as well
 | 
				
			||||||
	-- Check that the reactor is complete
 | 
									-- as the correct number of correct fuel
 | 
				
			||||||
	if reactor_structure_badness(pos) ~= 0 then
 | 
									if correct_fuel_count == 6 and
 | 
				
			||||||
		return "Error: The power plant seems to be built incorrectly."
 | 
									   check_reactor_structure(pos) then
 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
					meta:set_int("burn_time", 1)
 | 
										meta:set_int("burn_time", 1)
 | 
				
			||||||
					technic.swap_node(pos, "technic:hv_nuclear_reactor_core_active") 
 | 
										technic.swap_node(pos, "technic:hv_nuclear_reactor_core_active") 
 | 
				
			||||||
					meta:set_int("HV_EU_supply", power_supply)
 | 
										meta:set_int("HV_EU_supply", power_supply)
 | 
				
			||||||
	for idx, src_stack in pairs(src_list) do
 | 
										for idx, srcstack in pairs(srclist) do
 | 
				
			||||||
		src_stack:take_item()
 | 
											srcstack:take_item()
 | 
				
			||||||
		inv:set_stack("src", idx, src_stack)
 | 
											inv:set_stack("src", idx, srcstack)
 | 
				
			||||||
					end
 | 
										end
 | 
				
			||||||
 | 
					 | 
				
			||||||
	return nil
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
minetest.register_abm({
 | 
					 | 
				
			||||||
	label = "Machines: reactor melt-down check",
 | 
					 | 
				
			||||||
	nodenames = {"technic:hv_nuclear_reactor_core_active"},
 | 
					 | 
				
			||||||
	interval = 4,
 | 
					 | 
				
			||||||
	chance = 1,
 | 
					 | 
				
			||||||
	action = function (pos, node)
 | 
					 | 
				
			||||||
		local meta = minetest.get_meta(pos)
 | 
					 | 
				
			||||||
		local badness = reactor_structure_badness(pos)
 | 
					 | 
				
			||||||
		local accum_badness = meta:get_int("structure_accumulated_badness")
 | 
					 | 
				
			||||||
		if badness == 0 then
 | 
					 | 
				
			||||||
			if accum_badness ~= 0 then
 | 
					 | 
				
			||||||
				meta:set_int("structure_accumulated_badness", math.max(accum_badness - 4, 0))
 | 
					 | 
				
			||||||
				siren_clear(pos, meta)
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		else
 | 
					 | 
				
			||||||
			siren_danger(pos, meta)
 | 
					 | 
				
			||||||
			accum_badness = accum_badness + badness
 | 
					 | 
				
			||||||
			if accum_badness >= 25 then
 | 
					 | 
				
			||||||
				melt_down_reactor(pos)
 | 
					 | 
				
			||||||
			else
 | 
					 | 
				
			||||||
				meta:set_int("structure_accumulated_badness", accum_badness)
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	end,
 | 
					 | 
				
			||||||
})
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
local function run(pos, node)
 | 
					 | 
				
			||||||
	local meta = minetest.get_meta(pos)
 | 
					 | 
				
			||||||
	local burn_time = meta:get_int("burn_time") or 0
 | 
					 | 
				
			||||||
	if burn_time >= burn_ticks or burn_time == 0 then
 | 
					 | 
				
			||||||
		if digiline_remote_path and meta:get_int("HV_EU_supply") == power_supply then
 | 
					 | 
				
			||||||
			digiline_remote.send_to_node(pos, meta:get_string("remote_channel"),
 | 
					 | 
				
			||||||
					"fuel used", 6, true)
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		if meta:get_string("autostart") == "true" then
 | 
					 | 
				
			||||||
			if not start_reactor(pos, meta) then
 | 
					 | 
				
			||||||
					return
 | 
										return
 | 
				
			||||||
				end
 | 
									end
 | 
				
			||||||
			end
 | 
								end
 | 
				
			||||||
			meta:set_int("HV_EU_supply", 0)
 | 
								meta:set_int("HV_EU_supply", 0)
 | 
				
			||||||
			meta:set_int("burn_time", 0)
 | 
								meta:set_int("burn_time", 0)
 | 
				
			||||||
		meta:set_string("infotext", S("%s Idle"):format(reactor_desc))
 | 
								meta:set_string("infotext", S("%s Idle"):format(machine_name))
 | 
				
			||||||
			technic.swap_node(pos, "technic:hv_nuclear_reactor_core")
 | 
								technic.swap_node(pos, "technic:hv_nuclear_reactor_core")
 | 
				
			||||||
		meta:set_int("structure_accumulated_badness", 0)
 | 
					 | 
				
			||||||
		siren_clear(pos, meta)
 | 
					 | 
				
			||||||
		elseif burn_time > 0 then
 | 
							elseif burn_time > 0 then
 | 
				
			||||||
 | 
								damage_nearby_players(pos)
 | 
				
			||||||
 | 
								if not check_reactor_structure(pos) then
 | 
				
			||||||
 | 
									explode_reactor(pos)
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
			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_ticks * 100)
 | 
								local percent = math.floor(burn_time / burn_ticks * 100)
 | 
				
			||||||
		meta:set_string("infotext", reactor_desc.." ("..percent.."%)")
 | 
								meta:set_string("infotext", machine_name.." ("..percent.."%)")
 | 
				
			||||||
			meta:set_int("HV_EU_supply", power_supply)
 | 
								meta:set_int("HV_EU_supply", power_supply)
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
 | 
					 | 
				
			||||||
local nuclear_reactor_receive_fields = function(pos, formname, fields, sender)
 | 
					 | 
				
			||||||
	local player_name = sender:get_player_name()
 | 
					 | 
				
			||||||
	if minetest.is_protected(pos, player_name) then
 | 
					 | 
				
			||||||
		minetest.chat_send_player(player_name, "You are not allowed to edit this!")
 | 
					 | 
				
			||||||
		minetest.record_protection_violation(pos, player_name)
 | 
					 | 
				
			||||||
		return
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	local meta = minetest.get_meta(pos)
 | 
					 | 
				
			||||||
	local update_formspec = false
 | 
					 | 
				
			||||||
	if fields.remote_channel then
 | 
					 | 
				
			||||||
		meta:set_string("remote_channel", fields.remote_channel)
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	if fields.start then
 | 
					 | 
				
			||||||
		local start_error_msg = start_reactor(pos, meta)
 | 
					 | 
				
			||||||
		if not start_error_msg then
 | 
					 | 
				
			||||||
			minetest.chat_send_player(player_name, "Start successful")
 | 
					 | 
				
			||||||
		else
 | 
					 | 
				
			||||||
			minetest.chat_send_player(player_name, start_error_msg)
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	if fields.autostart then
 | 
					 | 
				
			||||||
		meta:set_string("autostart", fields.autostart)
 | 
					 | 
				
			||||||
		update_formspec = true
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	if fields.enable_digiline then
 | 
					 | 
				
			||||||
		meta:set_string("enable_digiline", fields.enable_digiline)
 | 
					 | 
				
			||||||
		update_formspec = true
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	if update_formspec then
 | 
					 | 
				
			||||||
		meta:set_string("formspec", make_reactor_formspec(meta))
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
local digiline_remote_def = function(pos, channel, msg)
 | 
					 | 
				
			||||||
	local meta = minetest.get_meta(pos)
 | 
					 | 
				
			||||||
	if meta:get_string("enable_digiline") ~= "true" or
 | 
					 | 
				
			||||||
			channel ~= meta:get_string("remote_channel") then
 | 
					 | 
				
			||||||
		return
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	-- Convert string messages to tables:
 | 
					 | 
				
			||||||
	local msgt = type(msg)
 | 
					 | 
				
			||||||
	if msgt == "string" then
 | 
					 | 
				
			||||||
		local smsg = msg:lower()
 | 
					 | 
				
			||||||
		msg = {}
 | 
					 | 
				
			||||||
		if smsg == "get" then
 | 
					 | 
				
			||||||
			msg.command = "get"
 | 
					 | 
				
			||||||
		elseif smsg:sub(1, 13) == "self_destruct" then
 | 
					 | 
				
			||||||
			msg.command = "self_destruct"
 | 
					 | 
				
			||||||
			msg.timer = tonumber(smsg:sub(15)) or 0
 | 
					 | 
				
			||||||
		elseif smsg == "start" then
 | 
					 | 
				
			||||||
			msg.command = "start"
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	elseif msgt ~= "table" then
 | 
					 | 
				
			||||||
		return
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if msg.command == "get" then
 | 
					 | 
				
			||||||
		local inv = meta:get_inventory()
 | 
					 | 
				
			||||||
		local invtable = {}
 | 
					 | 
				
			||||||
		for i = 1, 6 do
 | 
					 | 
				
			||||||
			local stack = inv:get_stack("src", i)
 | 
					 | 
				
			||||||
			if stack:is_empty() then
 | 
					 | 
				
			||||||
				invtable[i] = 0
 | 
					 | 
				
			||||||
			elseif stack:get_name() == fuel_type then
 | 
					 | 
				
			||||||
				invtable[i] = stack:get_count()
 | 
					 | 
				
			||||||
			else
 | 
					 | 
				
			||||||
				invtable[i] = -stack:get_count()
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		digiline_remote.send_to_node(pos, channel, {
 | 
					 | 
				
			||||||
			burn_time = meta:get_int("burn_time"),
 | 
					 | 
				
			||||||
			enabled   = meta:get_int("HV_EU_supply") == power_supply,
 | 
					 | 
				
			||||||
			siren     = meta:get_int("siren") == 1,
 | 
					 | 
				
			||||||
			structure_accumulated_badness = meta:get_int("structure_accumulated_badness"),
 | 
					 | 
				
			||||||
			rods = invtable
 | 
					 | 
				
			||||||
		}, 6, true)
 | 
					 | 
				
			||||||
	elseif digiline_meltdown and msg.command == "self_destruct" and
 | 
					 | 
				
			||||||
			minetest.get_node(pos).name == "technic:hv_nuclear_reactor_core_active" then
 | 
					 | 
				
			||||||
		if msg.timer ~= 0 and type(msg.timer) == "number" then
 | 
					 | 
				
			||||||
			siren_danger(pos, meta)
 | 
					 | 
				
			||||||
			minetest.after(msg.timer, melt_down_reactor, pos)
 | 
					 | 
				
			||||||
		else
 | 
					 | 
				
			||||||
			melt_down_reactor(pos)
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	elseif msg.command == "start" then
 | 
					 | 
				
			||||||
		local start_error_msg = start_reactor(pos, meta)
 | 
					 | 
				
			||||||
		if not start_error_msg then
 | 
					 | 
				
			||||||
			digiline_remote.send_to_node(pos, channel, "Start successful", 6, true)
 | 
					 | 
				
			||||||
		else
 | 
					 | 
				
			||||||
			digiline_remote.send_to_node(pos, channel, start_error_msg, 6, true)
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
minetest.register_node("technic:hv_nuclear_reactor_core", {
 | 
					 | 
				
			||||||
	description = reactor_desc,
 | 
					 | 
				
			||||||
	tiles = {
 | 
					 | 
				
			||||||
		"technic_hv_nuclear_reactor_core.png",
 | 
					 | 
				
			||||||
		"technic_hv_nuclear_reactor_core.png"..cable_entry
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	drawtype = "mesh",
 | 
					 | 
				
			||||||
	mesh = "technic_reactor.obj",
 | 
					 | 
				
			||||||
	groups = {cracky = 1, technic_machine = 1, technic_hv = 1, digiline_remote_receive = 1},
 | 
					 | 
				
			||||||
	legacy_facedir_simple = true,
 | 
					 | 
				
			||||||
	sounds = default.node_sound_wood_defaults(),
 | 
					 | 
				
			||||||
	paramtype = "light",
 | 
					 | 
				
			||||||
	paramtype2 = "facedir",
 | 
					 | 
				
			||||||
	stack_max = 1,
 | 
					 | 
				
			||||||
	on_receive_fields = nuclear_reactor_receive_fields,
 | 
					 | 
				
			||||||
	on_construct = function(pos)
 | 
					 | 
				
			||||||
		local meta = minetest.get_meta(pos)
 | 
					 | 
				
			||||||
		meta:set_string("infotext", reactor_desc)
 | 
					 | 
				
			||||||
		meta:set_string("formspec", make_reactor_formspec(meta))
 | 
					 | 
				
			||||||
		if digiline_remote_path then
 | 
					 | 
				
			||||||
			meta:set_string("remote_channel",
 | 
					 | 
				
			||||||
					"nucelear_reactor"..minetest.pos_to_string(pos))
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		local inv = meta:get_inventory()
 | 
					 | 
				
			||||||
		inv:set_size("src", 6)
 | 
					 | 
				
			||||||
	end,
 | 
					 | 
				
			||||||
	_on_digiline_remote_receive = digiline_remote_def,
 | 
					 | 
				
			||||||
	can_dig = technic.machine_can_dig,
 | 
					 | 
				
			||||||
	on_destruct = function(pos) siren_set_state(pos, SS_OFF) end,
 | 
					 | 
				
			||||||
	allow_metadata_inventory_put = technic.machine_inventory_put,
 | 
					 | 
				
			||||||
	allow_metadata_inventory_take = technic.machine_inventory_take,
 | 
					 | 
				
			||||||
	allow_metadata_inventory_move = technic.machine_inventory_move,
 | 
					 | 
				
			||||||
	technic_run = run,
 | 
					 | 
				
			||||||
})
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
minetest.register_node("technic:hv_nuclear_reactor_core_active", {
 | 
					 | 
				
			||||||
	tiles = {
 | 
					 | 
				
			||||||
		"technic_hv_nuclear_reactor_core.png",
 | 
					 | 
				
			||||||
		"technic_hv_nuclear_reactor_core.png"..cable_entry
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	drawtype = "mesh",
 | 
					 | 
				
			||||||
	mesh = "technic_reactor.obj",
 | 
					 | 
				
			||||||
	groups = {cracky = 1, technic_machine = 1, technic_hv = 1, radioactive = 4,
 | 
					 | 
				
			||||||
		not_in_creative_inventory = 1, digiline_remote_receive = 1},
 | 
					 | 
				
			||||||
	legacy_facedir_simple = true,
 | 
					 | 
				
			||||||
	sounds = default.node_sound_wood_defaults(),
 | 
					 | 
				
			||||||
	drop = "technic:hv_nuclear_reactor_core",
 | 
					 | 
				
			||||||
	light_source = 14,
 | 
					 | 
				
			||||||
	paramtype = "light",
 | 
					 | 
				
			||||||
	paramtype2 = "facedir",
 | 
					 | 
				
			||||||
	on_receive_fields = nuclear_reactor_receive_fields,
 | 
					 | 
				
			||||||
	_on_digiline_remote_receive = digiline_remote_def,
 | 
					 | 
				
			||||||
	can_dig = technic.machine_can_dig,
 | 
					 | 
				
			||||||
	after_dig_node = melt_down_reactor,
 | 
					 | 
				
			||||||
	on_destruct = function(pos) siren_set_state(pos, SS_OFF) end,
 | 
					 | 
				
			||||||
	allow_metadata_inventory_put = technic.machine_inventory_put,
 | 
					 | 
				
			||||||
	allow_metadata_inventory_take = technic.machine_inventory_take,
 | 
					 | 
				
			||||||
	allow_metadata_inventory_move = technic.machine_inventory_move,
 | 
					 | 
				
			||||||
	technic_run = run,
 | 
					 | 
				
			||||||
	technic_on_disable = function(pos, node)
 | 
					 | 
				
			||||||
		local timer = minetest.get_node_timer(pos)
 | 
					 | 
				
			||||||
		timer:start(1)
 | 
					 | 
				
			||||||
        end,
 | 
					 | 
				
			||||||
	on_timer = function(pos, node)
 | 
					 | 
				
			||||||
		local meta = minetest.get_meta(pos)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		-- Connected back?
 | 
					 | 
				
			||||||
		if meta:get_int("HV_EU_timeout") > 0 then return false end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		local burn_time = meta:get_int("burn_time") or 0
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		if burn_time >= burn_ticks or burn_time == 0 then
 | 
					 | 
				
			||||||
			meta:set_int("HV_EU_supply", 0)
 | 
					 | 
				
			||||||
			meta:set_int("burn_time", 0)
 | 
					 | 
				
			||||||
			technic.swap_node(pos, "technic:hv_nuclear_reactor_core")
 | 
					 | 
				
			||||||
			meta:set_int("structure_accumulated_badness", 0)
 | 
					 | 
				
			||||||
			siren_clear(pos, meta)
 | 
					 | 
				
			||||||
			return false
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		meta:set_int("burn_time", burn_time + 1)
 | 
					 | 
				
			||||||
		return true
 | 
					 | 
				
			||||||
	end,
 | 
					 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
technic.register_machine("HV", "technic:hv_nuclear_reactor_core",        technic.producer)
 | 
					technic.register_machine("HV", "technic:hv_nuclear_reactor_core",        technic.producer)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,279 +1,193 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
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_steel_block", "pipeworks:filter",       "technic:carbon_steel_block"},
 | 
				
			||||||
		{"basic_materials:motor",              "technic:machine_casing", "technic:diamond_drill_head"},
 | 
							{"technic:motor",              "technic:machine_casing", "technic:diamond_drill_head"},
 | 
				
			||||||
		{"technic:carbon_steel_block", "technic:hv_cable",       "technic:carbon_steel_block"}},
 | 
							{"technic:carbon_steel_block", "technic:hv_cable0",      "technic:carbon_steel_block"}},
 | 
				
			||||||
	output = "technic:quarry",
 | 
						output = "technic:quarry",
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
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_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 formspec = "size[3,1.5]"..
 | 
				
			||||||
	local formspec = "size[6,4.3]"..
 | 
							"field[1,0.5;2,1;size;Radius;"..meta:get_int("size").."]"
 | 
				
			||||||
		"list[context;cache;0,1;4,3;]"..
 | 
					 | 
				
			||||||
		"item_image[4.8,0;1,1;technic:quarry]"..
 | 
					 | 
				
			||||||
		"label[0,0.2;"..S("%s Quarry"):format("HV").."]"..
 | 
					 | 
				
			||||||
		"field[4.3,3.5;2,1;size;"..S("Radius:")..";"..radius.."]"
 | 
					 | 
				
			||||||
	if meta:get_int("enabled") == 0 then
 | 
						if meta:get_int("enabled") == 0 then
 | 
				
			||||||
		formspec = formspec.."button[4,1;2,1;enable;"..S("Disabled").."]"
 | 
							formspec = formspec.."button[0,1;3,1;enable;"..S("%s Disabled"):format(S("%s Quarry"):format("HV")).."]"
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
		formspec = formspec.."button[4,1;2,1;disable;"..S("Enabled").."]"
 | 
							formspec = formspec.."button[0,1;3,1;disable;"..S("%s Enabled"):format(S("%s Quarry"):format("HV")).."]"
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
	local diameter = radius*2 + 1
 | 
					 | 
				
			||||||
	local nd = meta:get_int("dug")
 | 
					 | 
				
			||||||
	local rel_y = quarry_dig_above_nodes - math.floor(nd / (diameter*diameter))
 | 
					 | 
				
			||||||
	formspec = formspec.."label[0,4;"..minetest.formspec_escape(
 | 
					 | 
				
			||||||
			nd == 0 and S("Digging not started") or
 | 
					 | 
				
			||||||
			(rel_y < -quarry_max_depth and S("Digging finished") or
 | 
					 | 
				
			||||||
				(meta:get_int("purge_on") == 1 and S("Purging cache") or
 | 
					 | 
				
			||||||
				S("Digging %d m "..(rel_y > 0 and "above" or "below").." machine")
 | 
					 | 
				
			||||||
					:format(math.abs(rel_y))))
 | 
					 | 
				
			||||||
			).."]"
 | 
					 | 
				
			||||||
	formspec = formspec.."button[4,2;2,1;restart;"..S("Restart").."]"
 | 
					 | 
				
			||||||
	meta:set_string("formspec", formspec)
 | 
						meta:set_string("formspec", formspec)
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local function set_quarry_demand(meta)
 | 
					 | 
				
			||||||
	local radius = meta:get_int("size")
 | 
					 | 
				
			||||||
	local diameter = radius*2 + 1
 | 
					 | 
				
			||||||
	local machine_name = S("%s Quarry"):format("HV")
 | 
					 | 
				
			||||||
	local do_purge = meta:get_int("purge_on") == 1
 | 
					 | 
				
			||||||
	if meta:get_int("enabled") == 0 or do_purge then
 | 
					 | 
				
			||||||
		local infotext = do_purge and
 | 
					 | 
				
			||||||
			S("%s purging cache") or S("%s Disabled")
 | 
					 | 
				
			||||||
		meta:set_string("infotext", infotext:format(machine_name))
 | 
					 | 
				
			||||||
		meta:set_int("HV_EU_demand", 0)
 | 
					 | 
				
			||||||
	elseif meta:get_int("dug") == diameter*diameter * (quarry_dig_above_nodes+1+quarry_max_depth) then
 | 
					 | 
				
			||||||
		meta:set_string("infotext", S("%s Finished"):format(machine_name))
 | 
					 | 
				
			||||||
		meta:set_int("HV_EU_demand", 0)
 | 
					 | 
				
			||||||
	else
 | 
					 | 
				
			||||||
		local infotext = meta:get_int("HV_EU_input") >= quarry_demand
 | 
					 | 
				
			||||||
			and S("%s Active") or S("%s Unpowered")
 | 
					 | 
				
			||||||
		meta:set_string("infotext", infotext:format(machine_name))
 | 
					 | 
				
			||||||
		meta:set_int("HV_EU_demand", quarry_demand)
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
local function quarry_receive_fields(pos, formname, fields, sender)
 | 
					local function quarry_receive_fields(pos, formname, fields, sender)
 | 
				
			||||||
	local player_name = sender:get_player_name()
 | 
					 | 
				
			||||||
	if minetest.is_protected(pos, player_name) then
 | 
					 | 
				
			||||||
		minetest.chat_send_player(player_name, "You are not allowed to edit this!")
 | 
					 | 
				
			||||||
		minetest.record_protection_violation(pos, player_name)
 | 
					 | 
				
			||||||
		return
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	local meta = minetest.get_meta(pos)
 | 
						local meta = minetest.get_meta(pos)
 | 
				
			||||||
	if fields.size and string.find(fields.size, "^[0-9]+$") then
 | 
						if fields.size then
 | 
				
			||||||
		local size = tonumber(fields.size)
 | 
							local size = tonumber(fields.size) or 0
 | 
				
			||||||
		if size >= 2 and size <= 8 and size ~= meta:get_int("size") then
 | 
							size = math.max(size, 2)
 | 
				
			||||||
 | 
							size = math.min(size, 8)
 | 
				
			||||||
		meta:set_int("size", size)
 | 
							meta:set_int("size", size)
 | 
				
			||||||
			meta:set_int("dug", 0)
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
	if fields.enable then meta:set_int("enabled", 1) end
 | 
						if fields.enable then meta:set_int("enabled", 1) end
 | 
				
			||||||
	if fields.disable then meta:set_int("enabled", 0) end
 | 
						if fields.disable then meta:set_int("enabled", 0) end
 | 
				
			||||||
	if fields.restart then
 | 
					 | 
				
			||||||
		meta:set_int("dug", 0)
 | 
					 | 
				
			||||||
		meta:set_int("purge_on", 1)
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	set_quarry_formspec(meta)
 | 
						set_quarry_formspec(meta)
 | 
				
			||||||
	set_quarry_demand(meta)
 | 
					 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local function quarry_handle_purge(pos)
 | 
					local function get_quarry_center(pos, size)
 | 
				
			||||||
 | 
						local node     = minetest.get_node(pos)
 | 
				
			||||||
 | 
						local back_dir = minetest.facedir_to_dir(node.param2)
 | 
				
			||||||
 | 
						local relative_center = vector.multiply(back_dir, size + 1)
 | 
				
			||||||
 | 
						local center = vector.add(pos, relative_center)
 | 
				
			||||||
 | 
						return center
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local function gen_next_digpos(center, digpos, size)
 | 
				
			||||||
 | 
						digpos.x = digpos.x + 1
 | 
				
			||||||
 | 
						if digpos.x > center.x + size then
 | 
				
			||||||
 | 
							digpos.x = center.x - size
 | 
				
			||||||
 | 
							digpos.z = digpos.z + 1
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if digpos.z > center.z + size then
 | 
				
			||||||
 | 
							digpos.x = center.x - size
 | 
				
			||||||
 | 
							digpos.z = center.z - size
 | 
				
			||||||
 | 
							digpos.y = digpos.y - 1
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local function find_next_digpos(data, area, center, dig_y, size)
 | 
				
			||||||
 | 
						local c_air = minetest.get_content_id("air")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						for y = center.y + quarry_dig_above_nodes, dig_y - 1, -1 do
 | 
				
			||||||
 | 
						for z = center.z - size, center.z + size do
 | 
				
			||||||
 | 
						for x = center.x - size, center.x + size do
 | 
				
			||||||
 | 
							if data[area:index(x, y, z)] ~= c_air then
 | 
				
			||||||
 | 
								return vector.new(x, y, z)
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local function quarry_dig(pos, center, size)
 | 
				
			||||||
	local meta = minetest.get_meta(pos)
 | 
						local meta = minetest.get_meta(pos)
 | 
				
			||||||
	local inv = meta:get_inventory()
 | 
						local drops = {}
 | 
				
			||||||
	local i = 0
 | 
						local dig_y = meta:get_int("dig_y")
 | 
				
			||||||
	for _,stack in ipairs(inv:get_list("cache")) do
 | 
					 | 
				
			||||||
		i = i + 1
 | 
					 | 
				
			||||||
		if stack then
 | 
					 | 
				
			||||||
			local item = stack:to_table()
 | 
					 | 
				
			||||||
			if item then
 | 
					 | 
				
			||||||
				technic.tube_inject_item(pos, pos, quarry_eject_dir, item)
 | 
					 | 
				
			||||||
				stack:clear()
 | 
					 | 
				
			||||||
				inv:set_stack("cache", i, stack)
 | 
					 | 
				
			||||||
				break
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	if inv:is_empty("cache") then
 | 
					 | 
				
			||||||
		meta:set_int("purge_on", 0)
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
local function quarry_run(pos, node)
 | 
					 | 
				
			||||||
	local meta = minetest.get_meta(pos)
 | 
					 | 
				
			||||||
	local inv = meta:get_inventory()
 | 
					 | 
				
			||||||
	-- initialize cache for the case we load an older world
 | 
					 | 
				
			||||||
	inv:set_size("cache", 12)
 | 
					 | 
				
			||||||
	-- toss a coin whether we do an automatic purge. Chance 1:200
 | 
					 | 
				
			||||||
	local purge_rand = math.random()
 | 
					 | 
				
			||||||
	if purge_rand <= 0.005 then
 | 
					 | 
				
			||||||
		meta:set_int("purge_on", 1)
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if meta:get_int("enabled") and meta:get_int("HV_EU_input") >= quarry_demand and meta:get_int("purge_on") == 0 then
 | 
					 | 
				
			||||||
		local pdir = minetest.facedir_to_dir(node.param2)
 | 
					 | 
				
			||||||
		if pdir.y ~= 0 then
 | 
					 | 
				
			||||||
			-- faces up or down, not valid, otherwise depth-check would run endless and hang up the server
 | 
					 | 
				
			||||||
			return
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		local qdir = pdir.x == 1 and vector.new(0,0,-1) or
 | 
					 | 
				
			||||||
			(pdir.z == -1 and vector.new(-1,0,0) or
 | 
					 | 
				
			||||||
			(pdir.x == -1 and vector.new(0,0,1) or
 | 
					 | 
				
			||||||
			vector.new(1,0,0)))
 | 
					 | 
				
			||||||
		local radius = meta:get_int("size")
 | 
					 | 
				
			||||||
		local diameter = radius*2 + 1
 | 
					 | 
				
			||||||
		local startpos = vector.add(vector.add(vector.add(pos,
 | 
					 | 
				
			||||||
			vector.new(0, quarry_dig_above_nodes, 0)),
 | 
					 | 
				
			||||||
			pdir),
 | 
					 | 
				
			||||||
			vector.multiply(qdir, -radius))
 | 
					 | 
				
			||||||
	local owner = meta:get_string("owner")
 | 
						local owner = meta:get_string("owner")
 | 
				
			||||||
		local nd = meta:get_int("dug")
 | 
					 | 
				
			||||||
		while nd < diameter*diameter * (quarry_dig_above_nodes+1+quarry_max_depth) do
 | 
					 | 
				
			||||||
			local ry = math.floor(nd / (diameter*diameter))
 | 
					 | 
				
			||||||
			local ndl = nd % (diameter*diameter)
 | 
					 | 
				
			||||||
			if ry % 2 == 1 then
 | 
					 | 
				
			||||||
				ndl = diameter*diameter - 1 - ndl
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			local rq = math.floor(ndl / diameter)
 | 
					 | 
				
			||||||
			local rp = ndl % diameter
 | 
					 | 
				
			||||||
			if rq % 2 == 1 then rp = diameter - 1 - rp end
 | 
					 | 
				
			||||||
			local digpos = vector.add(vector.add(vector.add(startpos,
 | 
					 | 
				
			||||||
				vector.new(0, -ry, 0)),
 | 
					 | 
				
			||||||
				vector.multiply(pdir, rp)),
 | 
					 | 
				
			||||||
				vector.multiply(qdir, rq))
 | 
					 | 
				
			||||||
			local can_dig = true
 | 
					 | 
				
			||||||
			if can_dig and minetest.is_protected and minetest.is_protected(digpos, owner) then
 | 
					 | 
				
			||||||
				can_dig = false
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			local dignode
 | 
					 | 
				
			||||||
			if can_dig then
 | 
					 | 
				
			||||||
				dignode = technic.get_or_load_node(digpos) or minetest.get_node(digpos)
 | 
					 | 
				
			||||||
				local dignodedef = minetest.registered_nodes[dignode.name] or {diggable=false}
 | 
					 | 
				
			||||||
				-- doors mod among other thing does NOT like a nil digger...
 | 
					 | 
				
			||||||
				local fakedigger = pipeworks.create_fake_player({
 | 
					 | 
				
			||||||
					name = owner
 | 
					 | 
				
			||||||
				})
 | 
					 | 
				
			||||||
				if not dignodedef.diggable or (dignodedef.can_dig and not dignodedef.can_dig(digpos, fakedigger)) then
 | 
					 | 
				
			||||||
					can_dig = false
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
			if can_dig then
 | 
						local vm = VoxelManip()
 | 
				
			||||||
				for ay = startpos.y, digpos.y+1, -1 do
 | 
						local p1 = vector.new(
 | 
				
			||||||
					local checkpos = {x=digpos.x, y=ay, z=digpos.z}
 | 
								center.x - size,
 | 
				
			||||||
					local checknode = technic.get_or_load_node(checkpos) or minetest.get_node(checkpos)
 | 
								center.y + quarry_dig_above_nodes,
 | 
				
			||||||
					if checknode.name ~= "air" then
 | 
								center.z - size)
 | 
				
			||||||
						can_dig = false
 | 
						local p2 = vector.new(
 | 
				
			||||||
						break
 | 
								center.x + size,
 | 
				
			||||||
					end
 | 
								dig_y - 1, -- One node lower in case we have finished the current layer
 | 
				
			||||||
				end
 | 
								center.z + size)
 | 
				
			||||||
			end
 | 
						local e1, e2 = vm:read_from_map(p1, p2)
 | 
				
			||||||
			nd = nd + 1
 | 
						local area = VoxelArea:new({MinEdge=e1, MaxEdge=e2})
 | 
				
			||||||
			if can_dig then
 | 
						local data = vm:get_data()
 | 
				
			||||||
				minetest.remove_node(digpos)
 | 
					
 | 
				
			||||||
				local drops = minetest.get_node_drops(dignode.name, "")
 | 
						local digpos = find_next_digpos(data, area, center, dig_y, size)
 | 
				
			||||||
				for _, dropped_item in ipairs(drops) do
 | 
					
 | 
				
			||||||
					local left = inv:add_item("cache", dropped_item)
 | 
						if digpos then
 | 
				
			||||||
					while not left:is_empty() do
 | 
							if digpos.y < pos.y - quarry_max_depth then
 | 
				
			||||||
						meta:set_int("purge_on", 1)
 | 
								meta:set_int("dig_y", digpos.y)
 | 
				
			||||||
						quarry_handle_purge(pos)
 | 
								return drops
 | 
				
			||||||
						left = inv:add_item("cache", left)
 | 
					 | 
				
			||||||
					end
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
				break
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		if nd == diameter*diameter * (quarry_dig_above_nodes+1+quarry_max_depth) then
 | 
					 | 
				
			||||||
			-- if a quarry is finished, we enable purge mode
 | 
					 | 
				
			||||||
			meta:set_int("purge_on", 1)
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		meta:set_int("dug", nd)
 | 
					 | 
				
			||||||
	else
 | 
					 | 
				
			||||||
		-- if a quarry is disabled or has no power, we enable purge mode
 | 
					 | 
				
			||||||
		meta:set_int("purge_on", 1)
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	-- if something triggered a purge, we handle it
 | 
					 | 
				
			||||||
	if meta:get_int("purge_on") == 1 then
 | 
					 | 
				
			||||||
		quarry_handle_purge(pos)
 | 
					 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
 | 
							if minetest.is_protected and minetest.is_protected(digpos, owner) then
 | 
				
			||||||
 | 
								meta:set_int("enabled", 0)
 | 
				
			||||||
			set_quarry_formspec(meta)
 | 
								set_quarry_formspec(meta)
 | 
				
			||||||
	set_quarry_demand(meta)
 | 
								return {}
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							dig_y = digpos.y
 | 
				
			||||||
 | 
							local node = minetest.get_node(digpos)
 | 
				
			||||||
 | 
							local node_def = minetest.registered_nodes[node.name] or { diggable = false }
 | 
				
			||||||
 | 
							if node_def.diggable and ((not node_def.can_dig) or node_def.can_dig(digpos, nil)) then
 | 
				
			||||||
 | 
								minetest.remove_node(digpos)
 | 
				
			||||||
 | 
								drops = minetest.get_node_drops(node.name, "")
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						elseif not (dig_y < pos.y - quarry_max_depth) then
 | 
				
			||||||
 | 
							dig_y = dig_y - 16
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local function send_move_error(player)
 | 
						meta:set_int("dig_y", dig_y)
 | 
				
			||||||
	minetest.chat_send_player(player:get_player_name(),
 | 
						return drops
 | 
				
			||||||
		S("Manually taking/removing from cache by hand is not possible. "..
 | 
					end
 | 
				
			||||||
		"If you can't wait, restart or disable the quarry to start automatic purge."))
 | 
					
 | 
				
			||||||
	return 0
 | 
					local function send_items(items, pos, node)
 | 
				
			||||||
 | 
						for _, item in pairs(items) do
 | 
				
			||||||
 | 
							local tube_item = pipeworks.tube_item(vector.new(pos), item)
 | 
				
			||||||
 | 
							tube_item:get_luaentity().start_pos = vector.new(pos)
 | 
				
			||||||
 | 
							tube_item:setvelocity(vector.new(0, 1, 0))
 | 
				
			||||||
 | 
							tube_item:setacceleration({x=0, y=0, z=0})
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
end
 | 
					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,
 | 
					 | 
				
			||||||
		"technic_carbon_steel_block.png"..cable_entry,
 | 
					 | 
				
			||||||
		"technic_carbon_steel_block.png^default_tool_mesepick.png",
 | 
					 | 
				
			||||||
		"technic_carbon_steel_block.png"..cable_entry
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	paramtype2 = "facedir",
 | 
						paramtype2 = "facedir",
 | 
				
			||||||
	groups = {cracky=2, tubedevice=1, technic_machine=1, technic_hv=1},
 | 
						groups = {cracky=2, tubedevice=1},
 | 
				
			||||||
	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)
 | 
				
			||||||
		meta:set_string("infotext", S("%s Quarry"):format("HV"))
 | 
							meta:set_string("infotext", S("%s Quarry"):format("HV"))
 | 
				
			||||||
		meta:set_int("size", 4)
 | 
							meta:set_int("size", 4)
 | 
				
			||||||
		set_quarry_formspec(meta)
 | 
							set_quarry_formspec(meta)
 | 
				
			||||||
		set_quarry_demand(meta)
 | 
							meta:set_int("dig_y", pos.y)
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
	after_place_node = function(pos, placer, itemstack)
 | 
						after_place_node = function(pos, placer, itemstack)
 | 
				
			||||||
		local meta = minetest.get_meta(pos)
 | 
							local meta = minetest.get_meta(pos)
 | 
				
			||||||
		meta:set_string("owner", placer:get_player_name())
 | 
							meta:set_string("owner", placer:get_player_name())
 | 
				
			||||||
		pipeworks.scan_for_tube_objects(pos)
 | 
							pipeworks.scan_for_tube_objects(pos)
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
	can_dig = function(pos,player)
 | 
					 | 
				
			||||||
		local meta = minetest.get_meta(pos);
 | 
					 | 
				
			||||||
		local inv = meta:get_inventory()
 | 
					 | 
				
			||||||
		return inv:is_empty("cache")
 | 
					 | 
				
			||||||
	end,
 | 
					 | 
				
			||||||
	after_dig_node = pipeworks.scan_for_tube_objects,
 | 
						after_dig_node = pipeworks.scan_for_tube_objects,
 | 
				
			||||||
	on_receive_fields = quarry_receive_fields,
 | 
						on_receive_fields = quarry_receive_fields,
 | 
				
			||||||
	technic_run = quarry_run,
 | 
					})
 | 
				
			||||||
	allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
 | 
					
 | 
				
			||||||
		return send_move_error(player)
 | 
					minetest.register_abm({
 | 
				
			||||||
	end,
 | 
						nodenames = {"technic:quarry"},
 | 
				
			||||||
	allow_metadata_inventory_put = function(pos, listname, index, stack, player)
 | 
						interval = 1,
 | 
				
			||||||
		return send_move_error(player)
 | 
						chance = 1,
 | 
				
			||||||
	end,
 | 
						action = function(pos, node, active_object_count, active_object_count_wider)
 | 
				
			||||||
	allow_metadata_inventory_take = function(pos, listname, index, stack, player)
 | 
							local meta = minetest.get_meta(pos)
 | 
				
			||||||
		return send_move_error(player)
 | 
							local size = meta:get_int("size")
 | 
				
			||||||
 | 
							local eu_input = meta:get_int("HV_EU_input")
 | 
				
			||||||
 | 
							local demand = 10000
 | 
				
			||||||
 | 
							local center = get_quarry_center(pos, size)
 | 
				
			||||||
 | 
							local dig_y = meta:get_int("dig_y")
 | 
				
			||||||
 | 
							local machine_name = S("%s Quarry"):format("HV")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							technic.switching_station_timeout_count(pos, "HV")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if meta:get_int("enabled") == 0 then
 | 
				
			||||||
 | 
								meta:set_string("infotext", S("%s Disabled"):format(machine_name))
 | 
				
			||||||
 | 
								meta:set_int("HV_EU_demand", 0)
 | 
				
			||||||
 | 
								return
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if eu_input < demand then
 | 
				
			||||||
 | 
								meta:set_string("infotext", S("%s Unpowered"):format(machine_name))
 | 
				
			||||||
 | 
							elseif eu_input >= demand then
 | 
				
			||||||
 | 
								meta:set_string("infotext", S("%s Active"):format(machine_name))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								local items = quarry_dig(pos, center, size)
 | 
				
			||||||
 | 
								send_items(items, pos, node)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								if dig_y < pos.y - quarry_max_depth then
 | 
				
			||||||
 | 
									meta:set_string("infotext", S("%s Finished"):format(machine_name))
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							meta:set_int("HV_EU_demand", demand)
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
technic.register_machine("HV", "technic:quarry", technic.receiver)
 | 
					technic.register_machine("HV", "technic:quarry", technic.receiver)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,8 +5,8 @@ minetest.register_craft({
 | 
				
			|||||||
	output = 'technic:solar_array_hv 1',
 | 
						output = 'technic:solar_array_hv 1',
 | 
				
			||||||
	recipe = {
 | 
						recipe = {
 | 
				
			||||||
		{'technic:solar_array_mv',     'technic:solar_array_mv', 'technic:solar_array_mv'},
 | 
							{'technic:solar_array_mv',     'technic:solar_array_mv', 'technic:solar_array_mv'},
 | 
				
			||||||
		{'technic:carbon_plate',       'technic:hv_transformer', 'technic:composite_plate'},
 | 
							{'technic:carbon_steel_ingot', 'technic:hv_transformer', 'technic:carbon_steel_ingot'},
 | 
				
			||||||
		{'',                           'technic:hv_cable',       ''},
 | 
							{'',                           'technic:hv_cable0',      ''},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -6,7 +6,7 @@ minetest.register_craft({
 | 
				
			|||||||
	recipe = {
 | 
						recipe = {
 | 
				
			||||||
		{'default:brick',           'default:brick',          'default:brick'},
 | 
							{'default:brick',           'default:brick',          'default:brick'},
 | 
				
			||||||
		{'default:brick',           'technic:machine_casing', 'default:brick'},
 | 
							{'default:brick',           'technic:machine_casing', 'default:brick'},
 | 
				
			||||||
		{'default:brick', 'technic:lv_cable',       'default:brick'},
 | 
							{'default:brick',           'technic:lv_cable0',      'default:brick'},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,11 +1,10 @@
 | 
				
			|||||||
-- LV Battery box
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
minetest.register_craft({
 | 
					minetest.register_craft({
 | 
				
			||||||
	output = 'technic:lv_battery_box0',
 | 
						output = 'technic:lv_battery_box0',
 | 
				
			||||||
	recipe = {
 | 
						recipe = {
 | 
				
			||||||
		{'group:wood',              'group:wood',              'group:wood'},
 | 
							{'group:wood',              'group:wood',              'group:wood'},
 | 
				
			||||||
		{'technic:battery',         'technic:machine_casing',  'technic:battery'},
 | 
							{'technic:battery',         'technic:machine_casing',  'technic:battery'},
 | 
				
			||||||
		{'technic:battery', 'technic:lv_cable',       'technic:battery'},
 | 
							{'technic:battery',         'technic:lv_cable0',       'technic:battery'},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,12 +1,10 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
minetest.register_alias("lv_cable", "technic:lv_cable")
 | 
					minetest.register_alias("lv_cable", "technic:lv_cable0")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
minetest.register_craft({
 | 
					minetest.register_craft({
 | 
				
			||||||
	output = 'technic:lv_cable 6',
 | 
						output = 'technic:lv_cable0 6',
 | 
				
			||||||
	recipe = {
 | 
						recipe = {
 | 
				
			||||||
		{'default:paper',        'default:paper',        'default:paper'},
 | 
					 | 
				
			||||||
		{'default:copper_ingot', 'default:copper_ingot', 'default:copper_ingot'},
 | 
							{'default:copper_ingot', 'default:copper_ingot', 'default:copper_ingot'},
 | 
				
			||||||
		{'default:paper',        'default:paper',        'default:paper'},
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}) 
 | 
					}) 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										236
									
								
								technic/machines/LV/cnc.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,236 @@
 | 
				
			|||||||
 | 
					-- Technic CNC v1.0 by kpoppel
 | 
				
			||||||
 | 
					-- Based on the NonCubic Blocks MOD v1.4 by yves_de_beck
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Idea:
 | 
				
			||||||
 | 
					--   Somehow have a tabbed/paged panel if the number of shapes should expand
 | 
				
			||||||
 | 
					--   beyond what is available in the panel today.
 | 
				
			||||||
 | 
					--   I could imagine some form of API allowing modders to come with their own node
 | 
				
			||||||
 | 
					--   box definitions and easily stuff it in the this machine for production.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local S = technic.getter
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local shape = {}
 | 
				
			||||||
 | 
					local onesize_products = {
 | 
				
			||||||
 | 
						slope                    = 2,
 | 
				
			||||||
 | 
						slope_edge               = 1,
 | 
				
			||||||
 | 
						slope_inner_edge         = 1,
 | 
				
			||||||
 | 
						pyramid                  = 2,
 | 
				
			||||||
 | 
						spike                    = 1,
 | 
				
			||||||
 | 
						cylinder                 = 2,
 | 
				
			||||||
 | 
						sphere                   = 1,
 | 
				
			||||||
 | 
						stick                    = 8,
 | 
				
			||||||
 | 
						slope_upsdown            = 2,
 | 
				
			||||||
 | 
						slope_edge_upsdown       = 1,
 | 
				
			||||||
 | 
						slope_inner_edge_upsdown = 1,
 | 
				
			||||||
 | 
						cylinder_horizontal      = 2,
 | 
				
			||||||
 | 
						slope_lying              = 2,
 | 
				
			||||||
 | 
						onecurvededge            = 1,
 | 
				
			||||||
 | 
						twocurvededge            = 1,
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					local twosize_products = {
 | 
				
			||||||
 | 
						element_straight         = 4,
 | 
				
			||||||
 | 
						element_end              = 2,
 | 
				
			||||||
 | 
						element_cross            = 1,
 | 
				
			||||||
 | 
						element_t                = 1,
 | 
				
			||||||
 | 
						element_edge             = 2,
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local cnc_formspec =
 | 
				
			||||||
 | 
						"invsize[9,11;]"..
 | 
				
			||||||
 | 
						"label[1,0;"..S("Choose Milling Program:").."]"..
 | 
				
			||||||
 | 
						"image_button[1,0.5;1,1;technic_cnc_slope.png;slope; ]"..
 | 
				
			||||||
 | 
						"image_button[2,0.5;1,1;technic_cnc_slope_edge.png;slope_edge; ]"..
 | 
				
			||||||
 | 
						"image_button[3,0.5;1,1;technic_cnc_slope_inner_edge.png;slope_inner_edge; ]"..
 | 
				
			||||||
 | 
						"image_button[4,0.5;1,1;technic_cnc_pyramid.png;pyramid; ]"..
 | 
				
			||||||
 | 
						"image_button[5,0.5;1,1;technic_cnc_spike.png;spike; ]"..
 | 
				
			||||||
 | 
						"image_button[6,0.5;1,1;technic_cnc_cylinder.png;cylinder; ]"..
 | 
				
			||||||
 | 
						"image_button[7,0.5;1,1;technic_cnc_sphere.png;sphere; ]"..
 | 
				
			||||||
 | 
						"image_button[8,0.5;1,1;technic_cnc_stick.png;stick; ]"..
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"image_button[1,1.5;1,1;technic_cnc_slope_upsdwn.png;slope_upsdown; ]"..
 | 
				
			||||||
 | 
						"image_button[2,1.5;1,1;technic_cnc_slope_edge_upsdwn.png;slope_edge_upsdown; ]"..
 | 
				
			||||||
 | 
						"image_button[3,1.5;1,1;technic_cnc_slope_inner_edge_upsdwn.png;slope_inner_edge_upsdown; ]"..
 | 
				
			||||||
 | 
						"image_button[4,1.5;1,1;technic_cnc_cylinder_horizontal.png;cylinder_horizontal; ]"..
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"image_button[1,2.5;1,1;technic_cnc_slope_lying.png;slope_lying; ]"..
 | 
				
			||||||
 | 
						"image_button[2,2.5;1,1;technic_cnc_onecurvededge.png;onecurvededge; ]"..
 | 
				
			||||||
 | 
						"image_button[3,2.5;1,1;technic_cnc_twocurvededge.png;twocurvededge; ]"..
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"label[1,3.5;"..S("Slim Elements half / normal height:").."]"..
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"image_button[1,4;1,0.5;technic_cnc_full.png;full; ]"..
 | 
				
			||||||
 | 
						"image_button[1,4.5;1,0.5;technic_cnc_half.png;half; ]"..
 | 
				
			||||||
 | 
						"image_button[2,4;1,1;technic_cnc_element_straight.png;element_straight; ]"..
 | 
				
			||||||
 | 
						"image_button[3,4;1,1;technic_cnc_element_end.png;element_end; ]"..
 | 
				
			||||||
 | 
						"image_button[4,4;1,1;technic_cnc_element_cross.png;element_cross; ]"..
 | 
				
			||||||
 | 
						"image_button[5,4;1,1;technic_cnc_element_t.png;element_t; ]"..
 | 
				
			||||||
 | 
						"image_button[6,4;1,1;technic_cnc_element_edge.png;element_edge; ]"..
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"label[0, 5.5;"..S("In:").."]"..
 | 
				
			||||||
 | 
						"list[current_name;src;0.5,5.5;1,1;]"..
 | 
				
			||||||
 | 
						"label[4, 5.5;"..S("Out:").."]"..
 | 
				
			||||||
 | 
						"list[current_name;dst;5,5.5;4,1;]"..
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"list[current_player;main;0,7;8,4;]"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local size = 1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- The form handler is declared here because we need it in both the inactive and active modes
 | 
				
			||||||
 | 
					-- in order to be able to change programs wile it is running.
 | 
				
			||||||
 | 
					local function form_handler(pos, formname, fields, sender)
 | 
				
			||||||
 | 
						-- REGISTER MILLING PROGRAMS AND OUTPUTS:
 | 
				
			||||||
 | 
						------------------------------------------
 | 
				
			||||||
 | 
						-- Program for half/full size
 | 
				
			||||||
 | 
						if fields["full"] then
 | 
				
			||||||
 | 
							size = 1
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if fields["half"] then
 | 
				
			||||||
 | 
							size = 2
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						-- Resolve the node name and the number of items to make
 | 
				
			||||||
 | 
						local meta       = minetest.get_meta(pos)
 | 
				
			||||||
 | 
						local inv        = meta:get_inventory()
 | 
				
			||||||
 | 
						local inputstack = inv:get_stack("src", 1)
 | 
				
			||||||
 | 
						local inputname  = inputstack:get_name()
 | 
				
			||||||
 | 
						local multiplier = 0
 | 
				
			||||||
 | 
						for k, _ in pairs(fields) do
 | 
				
			||||||
 | 
							-- Set a multipier for the half/full size capable blocks
 | 
				
			||||||
 | 
							if twosize_products[k] ~= nil then
 | 
				
			||||||
 | 
								multiplier = size * twosize_products[k]
 | 
				
			||||||
 | 
							else
 | 
				
			||||||
 | 
								multiplier = onesize_products[k]
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if onesize_products[k] ~= nil or twosize_products[k] ~= nil then
 | 
				
			||||||
 | 
								meta:set_float( "cnc_multiplier", multiplier)
 | 
				
			||||||
 | 
								meta:set_string("cnc_user", sender:get_player_name())
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if onesize_products[k] ~= nil or (twosize_products[k] ~= nil and size==2) then
 | 
				
			||||||
 | 
								meta:set_string("cnc_product",  inputname .. "_technic_cnc_" .. k)
 | 
				
			||||||
 | 
								--print(inputname .. "_technic_cnc_" .. k)
 | 
				
			||||||
 | 
								break
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if twosize_products[k] ~= nil and size==1 then
 | 
				
			||||||
 | 
								meta:set_string("cnc_product",  inputname .. "_technic_cnc_" .. k .. "_double")
 | 
				
			||||||
 | 
								--print(inputname .. "_technic_cnc_" .. k .. "_double")
 | 
				
			||||||
 | 
								break
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						return
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- The actual block inactive state
 | 
				
			||||||
 | 
					minetest.register_node("technic:cnc", {
 | 
				
			||||||
 | 
						description = S("%s CNC Machine"):format("LV"),
 | 
				
			||||||
 | 
						tiles       = {"technic_cnc_top.png", "technic_cnc_bottom.png", "technic_cnc_side.png",
 | 
				
			||||||
 | 
						               "technic_cnc_side.png", "technic_cnc_side.png", "technic_cnc_front.png"},
 | 
				
			||||||
 | 
						drawtype    = "nodebox",
 | 
				
			||||||
 | 
						paramtype   = "light",
 | 
				
			||||||
 | 
						paramtype2  = "facedir",
 | 
				
			||||||
 | 
						node_box    = {
 | 
				
			||||||
 | 
							type  = "fixed",
 | 
				
			||||||
 | 
							fixed = {
 | 
				
			||||||
 | 
								{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						groups = {cracky=2},
 | 
				
			||||||
 | 
						legacy_facedir_simple = true,
 | 
				
			||||||
 | 
						on_construct = function(pos)
 | 
				
			||||||
 | 
							local meta = minetest.get_meta(pos)
 | 
				
			||||||
 | 
							meta:set_string("infotext", S("%s CNC Machine"):format("LV"))
 | 
				
			||||||
 | 
							meta:set_float("technic_power_machine", 1)
 | 
				
			||||||
 | 
							meta:set_string("formspec", cnc_formspec)
 | 
				
			||||||
 | 
							local inv = meta:get_inventory()
 | 
				
			||||||
 | 
							inv:set_size("src", 1)
 | 
				
			||||||
 | 
							inv:set_size("dst", 4)
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
						can_dig = technic.machine_can_dig,
 | 
				
			||||||
 | 
						allow_metadata_inventory_put = technic.machine_inventory_put,
 | 
				
			||||||
 | 
						allow_metadata_inventory_take = technic.machine_inventory_take,
 | 
				
			||||||
 | 
						allow_metadata_inventory_move = technic.machine_inventory_move,
 | 
				
			||||||
 | 
						on_receive_fields = form_handler,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Active state block
 | 
				
			||||||
 | 
					minetest.register_node("technic:cnc_active", {
 | 
				
			||||||
 | 
						description = S("%s CNC Machine"):format("LV"),
 | 
				
			||||||
 | 
						tiles       = {"technic_cnc_top_active.png", "technic_cnc_bottom.png", "technic_cnc_side.png",
 | 
				
			||||||
 | 
						               "technic_cnc_side.png",       "technic_cnc_side.png",   "technic_cnc_front_active.png"},
 | 
				
			||||||
 | 
						paramtype2 = "facedir",
 | 
				
			||||||
 | 
						drop = "technic:cnc",
 | 
				
			||||||
 | 
						groups = {cracky=2, not_in_creative_inventory=1},
 | 
				
			||||||
 | 
						legacy_facedir_simple = true,
 | 
				
			||||||
 | 
						can_dig = technic.machine_can_dig,
 | 
				
			||||||
 | 
						allow_metadata_inventory_put = technic.machine_inventory_put,
 | 
				
			||||||
 | 
						allow_metadata_inventory_take = technic.machine_inventory_take,
 | 
				
			||||||
 | 
						allow_metadata_inventory_move = technic.machine_inventory_move,
 | 
				
			||||||
 | 
						on_receive_fields = form_handler,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Action code performing the transformation
 | 
				
			||||||
 | 
					minetest.register_abm({
 | 
				
			||||||
 | 
						nodenames = {"technic:cnc","technic:cnc_active"},
 | 
				
			||||||
 | 
						interval = 1,
 | 
				
			||||||
 | 
						chance   = 1,
 | 
				
			||||||
 | 
						action = function(pos, node, active_object_count, active_object_count_wider)
 | 
				
			||||||
 | 
							local meta         = minetest.get_meta(pos)
 | 
				
			||||||
 | 
							local inv          = meta:get_inventory()
 | 
				
			||||||
 | 
							local eu_input     = meta:get_int("LV_EU_input")
 | 
				
			||||||
 | 
							local machine_name = S("%s CNC Machine"):format("LV")
 | 
				
			||||||
 | 
							local machine_node = "technic:cnc"
 | 
				
			||||||
 | 
							local demand       = 450
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							-- Power off automatically if no longer connected to a switching station
 | 
				
			||||||
 | 
							technic.switching_station_timeout_count(pos, "LV")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							local result = meta:get_string("cnc_product")
 | 
				
			||||||
 | 
							if inv:is_empty("src") or 
 | 
				
			||||||
 | 
							   (not minetest.registered_nodes[result]) or
 | 
				
			||||||
 | 
							   (not inv:room_for_item("dst", result)) then
 | 
				
			||||||
 | 
								technic.swap_node(pos, machine_node)
 | 
				
			||||||
 | 
								meta:set_string("infotext", S("%s Idle"):format(machine_name))
 | 
				
			||||||
 | 
								meta:set_string("cnc_product", "")
 | 
				
			||||||
 | 
								meta:set_int("LV_EU_demand", 0)
 | 
				
			||||||
 | 
								return
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if eu_input < demand then
 | 
				
			||||||
 | 
								technic.swap_node(pos, machine_node)
 | 
				
			||||||
 | 
								meta:set_string("infotext", S("%s Unpowered"):format(machine_name))
 | 
				
			||||||
 | 
							elseif eu_input >= demand then
 | 
				
			||||||
 | 
								technic.swap_node(pos, machine_node.."_active")
 | 
				
			||||||
 | 
								meta:set_string("infotext", S("%s Active"):format(machine_name))
 | 
				
			||||||
 | 
								meta:set_int("src_time", meta:get_int("src_time") + 1)
 | 
				
			||||||
 | 
								if meta:get_int("src_time") >= 3 then -- 3 ticks per output
 | 
				
			||||||
 | 
									meta:set_int("src_time", 0)
 | 
				
			||||||
 | 
									srcstack = inv:get_stack("src", 1)
 | 
				
			||||||
 | 
									srcstack:take_item()
 | 
				
			||||||
 | 
									inv:set_stack("src", 1, srcstack)
 | 
				
			||||||
 | 
									inv:add_item("dst", result.." "..meta:get_int("cnc_multiplier"))
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							meta:set_int("LV_EU_demand", demand)
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					}) 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					technic.register_machine("LV", "technic:cnc",        technic.receiver)
 | 
				
			||||||
 | 
					technic.register_machine("LV", "technic:cnc_active", technic.receiver)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-------------------------
 | 
				
			||||||
 | 
					-- CNC Machine Recipe
 | 
				
			||||||
 | 
					-------------------------
 | 
				
			||||||
 | 
					minetest.register_craft({
 | 
				
			||||||
 | 
						output = 'technic:cnc',
 | 
				
			||||||
 | 
						recipe = {
 | 
				
			||||||
 | 
							{'default:glass',              'technic:diamond_drill_head', 'default:glass'},
 | 
				
			||||||
 | 
							{'technic:control_logic_unit', 'technic:machine_casing',     'technic:motor'},
 | 
				
			||||||
 | 
							{'technic:carbon_steel_ingot', 'technic:lv_cable0',          'technic:carbon_steel_ingot'},         
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
							
								
								
									
										356
									
								
								technic/machines/LV/cnc_api.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,356 @@
 | 
				
			|||||||
 | 
					-- API for the technic CNC machine
 | 
				
			||||||
 | 
					-- Again code is adapted from the NonCubic Blocks MOD v1.4 by yves_de_beck
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local S = technic.getter
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					technic.cnc = {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					technic.cnc.detail_level = 16
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- REGISTER NONCUBIC FORMS, CREATE MODELS AND RECIPES:
 | 
				
			||||||
 | 
					------------------------------------------------------
 | 
				
			||||||
 | 
					local function cnc_sphere()
 | 
				
			||||||
 | 
						local nodebox = {}
 | 
				
			||||||
 | 
						local detail = technic.cnc.detail_level
 | 
				
			||||||
 | 
						local sehne
 | 
				
			||||||
 | 
						for i = 1, detail - 1 do
 | 
				
			||||||
 | 
							sehne = math.sqrt(0.25 - (((i / detail) - 0.5) ^ 2))
 | 
				
			||||||
 | 
							nodebox[i]={-sehne, (i/detail) - 0.5, -sehne, sehne, (i/detail)+(1/detail)-0.5, sehne}
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						return nodebox
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local function cnc_cylinder_horizontal()
 | 
				
			||||||
 | 
						local nodebox = {}
 | 
				
			||||||
 | 
						local detail = technic.cnc.detail_level
 | 
				
			||||||
 | 
						local sehne
 | 
				
			||||||
 | 
						for i = 1, detail - 1 do
 | 
				
			||||||
 | 
							sehne = math.sqrt(0.25 - (((i / detail) - 0.5) ^ 2))
 | 
				
			||||||
 | 
							nodebox[i]={-0.5, (i/detail)-0.5, -sehne, 0.5, (i/detail)+(1/detail)-0.5, sehne}
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						return nodebox
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local function cnc_cylinder()
 | 
				
			||||||
 | 
						local nodebox = {}
 | 
				
			||||||
 | 
						local detail = technic.cnc.detail_level
 | 
				
			||||||
 | 
						local sehne
 | 
				
			||||||
 | 
						for i = 1, detail - 1 do
 | 
				
			||||||
 | 
							sehne = math.sqrt(0.25 - (((i / detail) - 0.5) ^ 2))
 | 
				
			||||||
 | 
							nodebox[i]={(i/detail) - 0.5, -0.5, -sehne, (i/detail)+(1/detail)-0.5, 0.5, sehne}
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						return nodebox
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local function cnc_twocurvededge()
 | 
				
			||||||
 | 
						local nodebox = {}
 | 
				
			||||||
 | 
						local detail = technic.cnc.detail_level * 2
 | 
				
			||||||
 | 
						local sehne
 | 
				
			||||||
 | 
						for i = (detail / 2) - 1, detail - 1 do
 | 
				
			||||||
 | 
							sehne = math.sqrt(0.25 - (((i / detail) - 0.5) ^ 2))
 | 
				
			||||||
 | 
							nodebox[i]={-sehne, -0.5, -sehne, 0.5, (i/detail)+(1/detail)-0.5, 0.5}
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						return nodebox
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local function cnc_onecurvededge()
 | 
				
			||||||
 | 
						local nodebox = {}
 | 
				
			||||||
 | 
						local detail = technic.cnc.detail_level * 2
 | 
				
			||||||
 | 
						local sehne
 | 
				
			||||||
 | 
						for i = (detail / 2) - 1, detail - 1 do
 | 
				
			||||||
 | 
							sehne = math.sqrt(0.25 - (((i / detail) - 0.5) ^ 2))
 | 
				
			||||||
 | 
							nodebox[i]={-0.5, -0.5, -sehne, 0.5, (i/detail)+(1/detail)-0.5, 0.5}
 | 
				
			||||||
 | 
						end 
 | 
				
			||||||
 | 
						return nodebox
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local function cnc_spike()
 | 
				
			||||||
 | 
						local nodebox = {}
 | 
				
			||||||
 | 
						local detail = technic.cnc.detail_level
 | 
				
			||||||
 | 
						for i = 0, detail - 1 do
 | 
				
			||||||
 | 
							nodebox[i+1] = {(i/detail/2)-0.5, (i/detail/2)-0.5, (i/detail/2)-0.5,
 | 
				
			||||||
 | 
									0.5-(i/detail/2), (i/detail)-0.5+(1/detail), 0.5-(i/detail/2)}
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						return nodebox
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local function cnc_pyramid()
 | 
				
			||||||
 | 
						local nodebox = {}
 | 
				
			||||||
 | 
						local detail = technic.cnc.detail_level / 2
 | 
				
			||||||
 | 
						for i = 0, detail - 1 do
 | 
				
			||||||
 | 
							nodebox[i+1] = {(i/detail/2)-0.5, (i/detail/2)-0.5, (i/detail/2)-0.5, 0.5-(i/detail/2), (i/detail/2)-0.5+(1/detail), 0.5-(i/detail/2)}
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						return nodebox
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local function cnc_slope_inner_edge_upsdown()
 | 
				
			||||||
 | 
						local nodebox = {}
 | 
				
			||||||
 | 
						local detail = technic.cnc.detail_level
 | 
				
			||||||
 | 
						for i = 0, detail-1 do
 | 
				
			||||||
 | 
							nodebox[i+1] = {0.5-(i/detail)-(1/detail), (i/detail)-0.5, -0.5, 0.5, (i/detail)-0.5+(1/detail), 0.5}
 | 
				
			||||||
 | 
							nodebox[i+detail+1] = {-0.5, (i/detail)-0.5, 0.5-(i/detail)-(1/detail), 0.5, (i/detail)-0.5+(1/detail), 0.5}
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						return nodebox
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local function cnc_slope_edge_upsdown()
 | 
				
			||||||
 | 
						local nodebox = {}
 | 
				
			||||||
 | 
						local detail = technic.cnc.detail_level
 | 
				
			||||||
 | 
						for i = 0, detail-1 do
 | 
				
			||||||
 | 
							nodebox[i+1] = {(-1*(i/detail))+0.5-(1/detail), (i/detail)-0.5, (-1*(i/detail))+0.5-(1/detail), 0.5, (i/detail)-0.5+(1/detail), 0.5}
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						return nodebox
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local function cnc_slope_inner_edge()
 | 
				
			||||||
 | 
						local nodebox = {}
 | 
				
			||||||
 | 
						local detail = technic.cnc.detail_level
 | 
				
			||||||
 | 
						for i = 0, detail-1 do
 | 
				
			||||||
 | 
							nodebox[i+1] = {(i/detail)-0.5, -0.5, -0.5, 0.5, (i/detail)-0.5+(1/detail), 0.5}
 | 
				
			||||||
 | 
							nodebox[i+detail+1] = {-0.5, -0.5, (i/detail)-0.5, 0.5, (i/detail)-0.5+(1/detail), 0.5}
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						return nodebox
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local function cnc_slope_edge()
 | 
				
			||||||
 | 
						local nodebox = {}
 | 
				
			||||||
 | 
						local detail = technic.cnc.detail_level
 | 
				
			||||||
 | 
						for i = 0, detail-1 do
 | 
				
			||||||
 | 
							nodebox[i+1] = {(i/detail)-0.5, -0.5, (i/detail)-0.5, 0.5, (i/detail)-0.5+(1/detail), 0.5}
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						return nodebox
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local function cnc_slope_upsdown()
 | 
				
			||||||
 | 
						local nodebox = {}
 | 
				
			||||||
 | 
						local detail = technic.cnc.detail_level
 | 
				
			||||||
 | 
						for i = 0, detail-1 do
 | 
				
			||||||
 | 
							nodebox[i+1] = {-0.5, (i/detail)-0.5, (-1*(i/detail))+0.5-(1/detail), 0.5, (i/detail)-0.5+(1/detail), 0.5}
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						return nodebox
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local function cnc_slope_lying()
 | 
				
			||||||
 | 
						local nodebox = {}
 | 
				
			||||||
 | 
						local detail = technic.cnc.detail_level
 | 
				
			||||||
 | 
						for i = 0, detail-1 do
 | 
				
			||||||
 | 
							nodebox[i+1] = {(i/detail)-0.5, -0.5, (i/detail)-0.5, (i/detail)-0.5+(1/detail), 0.5 , 0.5}
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						return nodebox
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local function cnc_slope()
 | 
				
			||||||
 | 
						local nodebox = {}
 | 
				
			||||||
 | 
						local detail = technic.cnc.detail_level
 | 
				
			||||||
 | 
						for i = 0, detail-1 do
 | 
				
			||||||
 | 
							nodebox[i+1] = {-0.5, (i/detail)-0.5, (i/detail)-0.5, 0.5, (i/detail)-0.5+(1/detail), 0.5}
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						return nodebox
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Define slope boxes for the various nodes
 | 
				
			||||||
 | 
					-------------------------------------------
 | 
				
			||||||
 | 
					technic.cnc.programs = {
 | 
				
			||||||
 | 
						{suffix  = "technic_cnc_stick",
 | 
				
			||||||
 | 
						nodebox = {-0.15, -0.5, -0.15, 0.15, 0.5, 0.15},
 | 
				
			||||||
 | 
						desc    = S("Stick")},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						{suffix  = "technic_cnc_element_end_double",
 | 
				
			||||||
 | 
						nodebox = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.5},
 | 
				
			||||||
 | 
						desc    = S("Element End Double")},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						{suffix  = "technic_cnc_element_cross_double",
 | 
				
			||||||
 | 
						nodebox = {
 | 
				
			||||||
 | 
							{0.3, -0.5, -0.3, 0.5, 0.5, 0.3},
 | 
				
			||||||
 | 
							{-0.3, -0.5, -0.5, 0.3, 0.5, 0.5},
 | 
				
			||||||
 | 
							{-0.5, -0.5, -0.3, -0.3, 0.5, 0.3}},
 | 
				
			||||||
 | 
						desc    = S("Element Cross Double")},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						{suffix  = "technic_cnc_element_t_double",
 | 
				
			||||||
 | 
						nodebox = {
 | 
				
			||||||
 | 
							{-0.3, -0.5, -0.5, 0.3, 0.5, 0.3},
 | 
				
			||||||
 | 
							{-0.5, -0.5, -0.3, -0.3, 0.5, 0.3},
 | 
				
			||||||
 | 
							{0.3, -0.5, -0.3, 0.5, 0.5, 0.3}},
 | 
				
			||||||
 | 
						desc    = S("Element T Double")},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						{suffix  = "technic_cnc_element_edge_double",
 | 
				
			||||||
 | 
						nodebox = {
 | 
				
			||||||
 | 
							{-0.3, -0.5, -0.5, 0.3, 0.5, 0.3},
 | 
				
			||||||
 | 
							{-0.5, -0.5, -0.3, -0.3, 0.5, 0.3}},
 | 
				
			||||||
 | 
						desc    = S("Element Edge Double")},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						{suffix  = "technic_cnc_element_straight_double",
 | 
				
			||||||
 | 
						nodebox = {-0.3, -0.5, -0.5, 0.3, 0.5, 0.5},
 | 
				
			||||||
 | 
						desc    = S("Element Straight Double")},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						{suffix  = "technic_cnc_element_end",
 | 
				
			||||||
 | 
						nodebox = {-0.3, -0.5, -0.3, 0.3, 0, 0.5},
 | 
				
			||||||
 | 
						desc    = S("Element End")},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						{suffix  = "technic_cnc_element_cross",
 | 
				
			||||||
 | 
						nodebox = {
 | 
				
			||||||
 | 
							{0.3, -0.5, -0.3, 0.5, 0, 0.3},
 | 
				
			||||||
 | 
							{-0.3, -0.5, -0.5, 0.3, 0, 0.5},
 | 
				
			||||||
 | 
							{-0.5, -0.5, -0.3, -0.3, 0, 0.3}},
 | 
				
			||||||
 | 
						desc    = S("Element Cross")},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						{suffix  = "technic_cnc_element_t",
 | 
				
			||||||
 | 
						nodebox = {
 | 
				
			||||||
 | 
							{-0.3, -0.5, -0.5, 0.3, 0, 0.3},
 | 
				
			||||||
 | 
							{-0.5, -0.5, -0.3, -0.3, 0, 0.3},
 | 
				
			||||||
 | 
							{0.3, -0.5, -0.3, 0.5, 0, 0.3}},
 | 
				
			||||||
 | 
						desc    = S("Element T")},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						{suffix  = "technic_cnc_element_edge",
 | 
				
			||||||
 | 
						nodebox = {
 | 
				
			||||||
 | 
							{-0.3, -0.5, -0.5, 0.3, 0, 0.3},
 | 
				
			||||||
 | 
							{-0.5, -0.5, -0.3, -0.3, 0, 0.3}},
 | 
				
			||||||
 | 
						desc    = S("Element Edge")},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						{suffix  = "technic_cnc_element_straight",
 | 
				
			||||||
 | 
						nodebox = {-0.3, -0.5, -0.5, 0.3, 0, 0.5},
 | 
				
			||||||
 | 
						desc    = S("Element Straight")},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						{suffix  = "technic_cnc_sphere",
 | 
				
			||||||
 | 
						nodebox = cnc_sphere(),
 | 
				
			||||||
 | 
						desc    = S("Sphere")},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						{suffix  = "technic_cnc_cylinder_horizontal",
 | 
				
			||||||
 | 
						nodebox = cnc_cylinder_horizontal(),
 | 
				
			||||||
 | 
						desc    = S("Horizontal Cylinder")},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						{suffix  = "technic_cnc_cylinder",
 | 
				
			||||||
 | 
						nodebox = cnc_cylinder(),
 | 
				
			||||||
 | 
						desc    = S("Cylinder")},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						{suffix  = "technic_cnc_twocurvededge",
 | 
				
			||||||
 | 
						nodebox = cnc_twocurvededge(),
 | 
				
			||||||
 | 
						desc    = S("Two Curved Edge Block")},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						{suffix  = "technic_cnc_onecurvededge",
 | 
				
			||||||
 | 
						nodebox = cnc_onecurvededge(),
 | 
				
			||||||
 | 
						desc    = S("One Curved Edge Block")},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						{suffix  = "technic_cnc_spike",
 | 
				
			||||||
 | 
						nodebox = cnc_spike(),
 | 
				
			||||||
 | 
						desc    = S("Spike")},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						{suffix  = "technic_cnc_pyramid",
 | 
				
			||||||
 | 
						nodebox = cnc_pyramid(),
 | 
				
			||||||
 | 
						desc    = S("Pyramid")},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						{suffix  = "technic_cnc_slope_inner_edge_upsdown",
 | 
				
			||||||
 | 
						nodebox = cnc_slope_inner_edge_upsdown(),
 | 
				
			||||||
 | 
						desc    = S("Slope Upside Down Inner Edge")},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						{suffix  = "technic_cnc_slope_edge_upsdown",
 | 
				
			||||||
 | 
						nodebox = cnc_slope_edge_upsdown(),
 | 
				
			||||||
 | 
						desc    = S("Slope Upside Down Edge")},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						{suffix  = "technic_cnc_slope_inner_edge",
 | 
				
			||||||
 | 
						nodebox = cnc_slope_inner_edge(),
 | 
				
			||||||
 | 
						desc    = S("Slope Inner Edge")},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						{suffix  = "technic_cnc_slope_edge",
 | 
				
			||||||
 | 
						nodebox = cnc_slope_edge(),
 | 
				
			||||||
 | 
						desc    = S("Slope Edge")},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						{suffix  = "technic_cnc_slope_upsdown",
 | 
				
			||||||
 | 
						nodebox = cnc_slope_upsdown(),
 | 
				
			||||||
 | 
						desc    = S("Slope Upside Down")},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						{suffix  = "technic_cnc_slope_lying",
 | 
				
			||||||
 | 
						nodebox = cnc_slope_lying(),
 | 
				
			||||||
 | 
						desc    = S("Slope Lying")},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						{suffix  = "technic_cnc_slope",
 | 
				
			||||||
 | 
						nodebox = cnc_slope(),
 | 
				
			||||||
 | 
						desc    = S("Slope")},
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Allow disabling certain programs for some node. Default is allowing all types for all nodes
 | 
				
			||||||
 | 
					technic.cnc.programs_disable = {
 | 
				
			||||||
 | 
						-- ["default:brick"] = {"technic_cnc_stick"}, -- Example: Disallow the stick for brick
 | 
				
			||||||
 | 
						-- ...
 | 
				
			||||||
 | 
						["default:dirt"] = {"technic_cnc_sphere", "technic_cnc_slope_upsdown", "technic_cnc_edge",
 | 
				
			||||||
 | 
						                    "technic_cnc_inner_edge", "technic_cnc_slope_edge_upsdown",
 | 
				
			||||||
 | 
						                    "technic_cnc_slope_inner_edge_upsdown", "technic_cnc_stick",
 | 
				
			||||||
 | 
						                    "technic_cnc_cylinder_horizontal"}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Generic function for registering all the different node types
 | 
				
			||||||
 | 
					function technic.cnc.register_program(recipeitem, suffix, nodebox, groups, images, description)
 | 
				
			||||||
 | 
						minetest.register_node(":"..recipeitem.."_"..suffix, {
 | 
				
			||||||
 | 
							description   = description,
 | 
				
			||||||
 | 
							drawtype      = "nodebox",
 | 
				
			||||||
 | 
							tiles         = images,
 | 
				
			||||||
 | 
							paramtype     = "light",
 | 
				
			||||||
 | 
							paramtype2    = "facedir",
 | 
				
			||||||
 | 
							walkable      = true,
 | 
				
			||||||
 | 
							node_box = {
 | 
				
			||||||
 | 
								type  = "fixed",
 | 
				
			||||||
 | 
								fixed = nodebox
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							groups        = groups,
 | 
				
			||||||
 | 
						})
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- function to iterate over all the programs the CNC machine knows
 | 
				
			||||||
 | 
					function technic.cnc.register_all(recipeitem, groups, images, description)
 | 
				
			||||||
 | 
						for _, data in ipairs(technic.cnc.programs) do
 | 
				
			||||||
 | 
							-- Disable node creation for disabled node types for some material
 | 
				
			||||||
 | 
							local do_register = true
 | 
				
			||||||
 | 
							if technic.cnc.programs_disable[recipeitem] ~= nil then
 | 
				
			||||||
 | 
								for __, disable in ipairs(technic.cnc.programs_disable[recipeitem]) do
 | 
				
			||||||
 | 
									if disable == data.suffix then
 | 
				
			||||||
 | 
										do_register = false
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							-- Create the node if it passes the test
 | 
				
			||||||
 | 
							if do_register then
 | 
				
			||||||
 | 
								technic.cnc.register_program(recipeitem, data.suffix, data.nodebox, groups, images, description.." "..data.desc)
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- REGISTER NEW TECHNIC_CNC_API's PART 2: technic.cnc..register_element_end(subname, recipeitem, groups, images, desc_element_xyz)
 | 
				
			||||||
 | 
					-----------------------------------------------------------------------------------------------------------------------
 | 
				
			||||||
 | 
					function technic.cnc.register_slope_edge_etc(recipeitem, groups, images, desc_slope, desc_slope_lying, desc_slope_upsdown, desc_slope_edge, desc_slope_inner_edge, desc_slope_upsdwn_edge, desc_slope_upsdwn_inner_edge, desc_pyramid, desc_spike, desc_onecurvededge, desc_twocurvededge, desc_cylinder, desc_cylinder_horizontal, desc_sphere, desc_element_straight, desc_element_edge, desc_element_t, desc_element_cross, desc_element_end)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					         technic.cnc.register_slope(recipeitem, groups, images, desc_slope)
 | 
				
			||||||
 | 
					         technic.cnc.register_slope_lying(recipeitem, groups, images, desc_slope_lying)
 | 
				
			||||||
 | 
					         technic.cnc.register_slope_upsdown(recipeitem, groups, images, desc_slope_upsdown)
 | 
				
			||||||
 | 
					         technic.cnc.register_slope_edge(recipeitem, groups, images, desc_slope_edge)
 | 
				
			||||||
 | 
					         technic.cnc.register_slope_inner_edge(recipeitem, groups, images, desc_slope_inner_edge)
 | 
				
			||||||
 | 
					         technic.cnc.register_slope_edge_upsdown(recipeitem, groups, images, desc_slope_upsdwn_edge)
 | 
				
			||||||
 | 
					         technic.cnc.register_slope_inner_edge_upsdown(recipeitem, groups, images, desc_slope_upsdwn_inner_edge)
 | 
				
			||||||
 | 
					         technic.cnc.register_pyramid(recipeitem, groups, images, desc_pyramid)
 | 
				
			||||||
 | 
					         technic.cnc.register_spike(recipeitem, groups, images, desc_spike)
 | 
				
			||||||
 | 
					         technic.cnc.register_onecurvededge(recipeitem, groups, images, desc_onecurvededge)
 | 
				
			||||||
 | 
					         technic.cnc.register_twocurvededge(recipeitem, groups, images, desc_twocurvededge)
 | 
				
			||||||
 | 
					         technic.cnc.register_cylinder(recipeitem, groups, images, desc_cylinder)
 | 
				
			||||||
 | 
					         technic.cnc.register_cylinder_horizontal(recipeitem, groups, images, desc_cylinder_horizontal)
 | 
				
			||||||
 | 
					         technic.cnc.register_sphere(recipeitem, groups, images, desc_sphere)
 | 
				
			||||||
 | 
					         technic.cnc.register_element_straight(recipeitem, groups, images, desc_element_straight)
 | 
				
			||||||
 | 
					         technic.cnc.register_element_edge(recipeitem, groups, images, desc_element_edge)
 | 
				
			||||||
 | 
					         technic.cnc.register_element_t(recipeitem, groups, images, desc_element_t)
 | 
				
			||||||
 | 
					         technic.cnc.register_element_cross(recipeitem, groups, images, desc_element_cross)
 | 
				
			||||||
 | 
					         technic.cnc.register_element_end(recipeitem, groups, images, desc_element_end)
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- REGISTER STICKS: noncubic.register_xyz(recipeitem, groups, images, desc_element_xyz)
 | 
				
			||||||
 | 
					------------------------------------------------------------------------------------------------------------
 | 
				
			||||||
 | 
					function technic.cnc.register_stick_etc(recipeitem, groups, images, desc_stick)
 | 
				
			||||||
 | 
					         technic.cnc.register_stick(recipeitem, groups, images, desc_stick)
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function technic.cnc.register_elements(recipeitem, groups, images, desc_element_straight_double, desc_element_edge_double, desc_element_t_double, desc_element_cross_double, desc_element_end_double)
 | 
				
			||||||
 | 
					         technic.cnc.register_element_straight_double(recipeitem, groups, images, desc_element_straight_double)
 | 
				
			||||||
 | 
					         technic.cnc.register_element_edge_double(recipeitem, groups, images, desc_element_edge_double)
 | 
				
			||||||
 | 
					         technic.cnc.register_element_t_double(recipeitem, groups, images, desc_element_t_double)
 | 
				
			||||||
 | 
					         technic.cnc.register_element_cross_double(recipeitem, groups, images, desc_element_cross_double)
 | 
				
			||||||
 | 
					         technic.cnc.register_element_end_double(recipeitem, groups, images, desc_element_end_double)
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
							
								
								
									
										96
									
								
								technic/machines/LV/cnc_nodes.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,96 @@
 | 
				
			|||||||
 | 
					-- REGISTER MATERIALS AND PROPERTIES FOR NONCUBIC ELEMENTS:
 | 
				
			||||||
 | 
					-----------------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local S = technic.getter
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- DIRT
 | 
				
			||||||
 | 
					-------
 | 
				
			||||||
 | 
					technic.cnc.register_all("default:dirt",
 | 
				
			||||||
 | 
					                {snappy=2,choppy=2,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
 | 
				
			||||||
 | 
					                {"default_grass.png", "default_dirt.png", "default_grass.png"},
 | 
				
			||||||
 | 
					                S("Dirt"))
 | 
				
			||||||
 | 
					technic.cnc.programs_disable["default:dirt"] = {"technic_cnc_sphere", "technic_cnc_slope_upsdown",
 | 
				
			||||||
 | 
							"technic_cnc_edge",   "technic_cnc_inner_edge",
 | 
				
			||||||
 | 
							"technic_cnc_slope_edge_upsdown", "technic_cnc_slope_inner_edge_upsdown",
 | 
				
			||||||
 | 
							"technic_cnc_stick", "technic_cnc_cylinder_horizontal"}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- WOOD
 | 
				
			||||||
 | 
					-------
 | 
				
			||||||
 | 
					technic.cnc.register_all("default:wood",
 | 
				
			||||||
 | 
					                {snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1},
 | 
				
			||||||
 | 
					                {"default_wood.png"},
 | 
				
			||||||
 | 
					                S("Wooden"))
 | 
				
			||||||
 | 
					-- STONE
 | 
				
			||||||
 | 
					--------
 | 
				
			||||||
 | 
					technic.cnc.register_all("default:stone",
 | 
				
			||||||
 | 
					                {cracky=3, not_in_creative_inventory=1},
 | 
				
			||||||
 | 
					                {"default_stone.png"},
 | 
				
			||||||
 | 
					                S("Stone"))
 | 
				
			||||||
 | 
					-- COBBLE
 | 
				
			||||||
 | 
					---------
 | 
				
			||||||
 | 
					technic.cnc.register_all("default:cobble",
 | 
				
			||||||
 | 
					                {cracky=3, not_in_creative_inventory=1},
 | 
				
			||||||
 | 
					                {"default_cobble.png"},
 | 
				
			||||||
 | 
					                S("Cobble"))
 | 
				
			||||||
 | 
					-- BRICK
 | 
				
			||||||
 | 
					--------
 | 
				
			||||||
 | 
					technic.cnc.register_all("default:brick",
 | 
				
			||||||
 | 
					                {cracky=3, not_in_creative_inventory=1},
 | 
				
			||||||
 | 
					                {"default_brick.png"},
 | 
				
			||||||
 | 
					                S("Brick"))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- SANDSTONE
 | 
				
			||||||
 | 
					------------
 | 
				
			||||||
 | 
					technic.cnc.register_all("default:sandstone",
 | 
				
			||||||
 | 
					                {crumbly=2, cracky=2, not_in_creative_inventory=1},
 | 
				
			||||||
 | 
					                {"default_sandstone.png"},
 | 
				
			||||||
 | 
					                S("Sandstone"))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- LEAVES
 | 
				
			||||||
 | 
					---------
 | 
				
			||||||
 | 
					technic.cnc.register_all("default:leaves",
 | 
				
			||||||
 | 
					                {snappy=2, choppy=2, oddly_breakable_by_hand=3, not_in_creative_inventory=1},
 | 
				
			||||||
 | 
					                {"default_leaves.png"},
 | 
				
			||||||
 | 
					                S("Leaves"))
 | 
				
			||||||
 | 
					-- TREE
 | 
				
			||||||
 | 
					-------
 | 
				
			||||||
 | 
					technic.cnc.register_all("default:tree",
 | 
				
			||||||
 | 
					                {snappy=1, choppy=2, oddly_breakable_by_hand=2, flammable=3, wood=1, not_in_creative_inventory=1},
 | 
				
			||||||
 | 
					                {"default_tree.png"},
 | 
				
			||||||
 | 
					                S("Tree"))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- WROUGHT IRON
 | 
				
			||||||
 | 
					---------------
 | 
				
			||||||
 | 
					technic.cnc.register_all("default:steelblock",
 | 
				
			||||||
 | 
					                {cracky=1, level=2, not_in_creative_inventory=1},
 | 
				
			||||||
 | 
					                {"technic_wrought_iron_block.png"},
 | 
				
			||||||
 | 
					                S("Wrought Iron"))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Bronze
 | 
				
			||||||
 | 
					--------
 | 
				
			||||||
 | 
					technic.cnc.register_all("default:bronzeblock",
 | 
				
			||||||
 | 
					                {cracky=1, level=2, not_in_creative_inventory=1},
 | 
				
			||||||
 | 
					                {"default_bronze_block.png"},
 | 
				
			||||||
 | 
					                S("Bronze"))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Stainless Steel
 | 
				
			||||||
 | 
					--------
 | 
				
			||||||
 | 
					technic.cnc.register_all("technic:stainless_steel_block",
 | 
				
			||||||
 | 
					                {cracky=1, level=2, not_in_creative_inventory=1},
 | 
				
			||||||
 | 
					                {"technic_stainless_steel_block.png"},
 | 
				
			||||||
 | 
					                S("Stainless Steel"))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Marble
 | 
				
			||||||
 | 
					------------
 | 
				
			||||||
 | 
					technic.cnc.register_all("technic:marble",
 | 
				
			||||||
 | 
					                {cracky=3, not_in_creative_inventory=1},
 | 
				
			||||||
 | 
					                {"technic_marble.png"},
 | 
				
			||||||
 | 
					                S("Marble"))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Granite
 | 
				
			||||||
 | 
					------------
 | 
				
			||||||
 | 
					technic.cnc.register_all("technic:granite",
 | 
				
			||||||
 | 
					                {cracky=3, not_in_creative_inventory=1},
 | 
				
			||||||
 | 
					                {"technic_granite.png"},
 | 
				
			||||||
 | 
					                S("Granite"))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -20,13 +20,7 @@ local formspec =
 | 
				
			|||||||
	"list[current_name;fuel;2,3;1,1;]"..
 | 
						"list[current_name;fuel;2,3;1,1;]"..
 | 
				
			||||||
	"list[current_name;src;2,1;2,1;]"..
 | 
						"list[current_name;src;2,1;2,1;]"..
 | 
				
			||||||
	"list[current_name;dst;5,1;2,2;]"..
 | 
						"list[current_name;dst;5,1;2,2;]"..
 | 
				
			||||||
	"list[current_player;main;0,5;8,4;]"..
 | 
						"list[current_player;main;0,5;8,4;]"
 | 
				
			||||||
	"listring[current_name;dst]"..
 | 
					 | 
				
			||||||
	"listring[current_player;main]"..
 | 
					 | 
				
			||||||
	"listring[current_name;src]"..
 | 
					 | 
				
			||||||
	"listring[current_player;main]"..
 | 
					 | 
				
			||||||
	"listring[current_name;fuel]"..
 | 
					 | 
				
			||||||
	"listring[current_player;main]"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
minetest.register_node("technic:coal_alloy_furnace", {
 | 
					minetest.register_node("technic:coal_alloy_furnace", {
 | 
				
			||||||
	description = machine_name,
 | 
						description = machine_name,
 | 
				
			||||||
@@ -38,7 +32,7 @@ minetest.register_node("technic:coal_alloy_furnace", {
 | 
				
			|||||||
	legacy_facedir_simple = true,
 | 
						legacy_facedir_simple = true,
 | 
				
			||||||
	sounds = default.node_sound_stone_defaults(),
 | 
						sounds = default.node_sound_stone_defaults(),
 | 
				
			||||||
	on_construct = function(pos)
 | 
						on_construct = function(pos)
 | 
				
			||||||
		local meta = minetest.get_meta(pos)
 | 
							local meta = minetest.env:get_meta(pos)
 | 
				
			||||||
		meta:set_string("formspec", formspec)
 | 
							meta:set_string("formspec", formspec)
 | 
				
			||||||
		meta:set_string("infotext", machine_name)
 | 
							meta:set_string("infotext", machine_name)
 | 
				
			||||||
		local inv = meta:get_inventory()
 | 
							local inv = meta:get_inventory()
 | 
				
			||||||
@@ -70,7 +64,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,
 | 
				
			||||||
@@ -84,6 +77,8 @@ minetest.register_abm({
 | 
				
			|||||||
			inv:set_size("src2", 0)
 | 
								inv:set_size("src2", 0)
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
 | 
							local recipe = nil
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		for i, name in pairs({
 | 
							for i, name in pairs({
 | 
				
			||||||
				"fuel_totaltime",
 | 
									"fuel_totaltime",
 | 
				
			||||||
				"fuel_time",
 | 
									"fuel_time",
 | 
				
			||||||
@@ -130,13 +125,7 @@ minetest.register_abm({
 | 
				
			|||||||
					"list[current_name;fuel;2,3;1,1;]"..
 | 
										"list[current_name;fuel;2,3;1,1;]"..
 | 
				
			||||||
					"list[current_name;src;2,1;2,1;]"..
 | 
										"list[current_name;src;2,1;2,1;]"..
 | 
				
			||||||
					"list[current_name;dst;5,1;2,2;]"..
 | 
										"list[current_name;dst;5,1;2,2;]"..
 | 
				
			||||||
					"list[current_player;main;0,5;8,4;]"..
 | 
										"list[current_player;main;0,5;8,4;]")
 | 
				
			||||||
					"listring[current_name;dst]"..
 | 
					 | 
				
			||||||
					"listring[current_player;main]"..
 | 
					 | 
				
			||||||
					"listring[current_name;src]"..
 | 
					 | 
				
			||||||
					"listring[current_player;main]"..
 | 
					 | 
				
			||||||
					"listring[current_name;fuel]"..
 | 
					 | 
				
			||||||
					"listring[current_player;main]")
 | 
					 | 
				
			||||||
			return
 | 
								return
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -153,11 +142,10 @@ minetest.register_abm({
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
		-- Next take a hard look at the fuel situation
 | 
							-- Next take a hard look at the fuel situation
 | 
				
			||||||
		local fuel = nil
 | 
							local fuel = nil
 | 
				
			||||||
		local afterfuel
 | 
					 | 
				
			||||||
		local fuellist = inv:get_list("fuel")
 | 
							local fuellist = inv:get_list("fuel")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if fuellist then
 | 
							if fuellist then
 | 
				
			||||||
			fuel, afterfuel = minetest.get_craft_result({method = "fuel", width = 1, items = fuellist})
 | 
								fuel = minetest.get_craft_result({method = "fuel", width = 1, items = fuellist})
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if fuel.time <= 0 then
 | 
							if fuel.time <= 0 then
 | 
				
			||||||
@@ -170,7 +158,9 @@ minetest.register_abm({
 | 
				
			|||||||
		meta:set_string("fuel_totaltime", fuel.time)
 | 
							meta:set_string("fuel_totaltime", fuel.time)
 | 
				
			||||||
		meta:set_string("fuel_time", 0)
 | 
							meta:set_string("fuel_time", 0)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		inv:set_stack("fuel", 1, afterfuel.items[1])
 | 
							local stack = inv:get_stack("fuel", 1)
 | 
				
			||||||
 | 
							stack:take_item()
 | 
				
			||||||
 | 
							inv:set_stack("fuel", 1, stack)
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -4,14 +4,10 @@ minetest.register_alias("compressor", "technic:lv_compressor")
 | 
				
			|||||||
minetest.register_craft({
 | 
					minetest.register_craft({
 | 
				
			||||||
	output = 'technic:lv_compressor',
 | 
						output = 'technic:lv_compressor',
 | 
				
			||||||
	recipe = {
 | 
						recipe = {
 | 
				
			||||||
		{'default:stone',            'basic_materials:motor',          'default:stone'},
 | 
							{'default:stone',	'technic:motor',		'default:stone'},
 | 
				
			||||||
		{'mesecons:piston',	'technic:machine_casing',	'mesecons:piston'},
 | 
							{'mesecons:piston',	'technic:machine_casing',	'mesecons:piston'},
 | 
				
			||||||
		{'basic_materials:silver_wire', 'technic:lv_cable',       'basic_materials:silver_wire'},
 | 
							{'default:stone',	'technic:lv_cable0',		'default:stone'},
 | 
				
			||||||
	},
 | 
						}
 | 
				
			||||||
	replacements = {
 | 
					 | 
				
			||||||
		{"basic_materials:silver_wire", "basic_materials:empty_spool"},
 | 
					 | 
				
			||||||
		{"basic_materials:silver_wire", "basic_materials:empty_spool"}
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
technic.register_compressor({tier = "LV", demand = {300}, speed = 1})
 | 
					technic.register_compressor({tier = "LV", demand = {300}, speed = 1})
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -7,7 +7,7 @@ minetest.register_craft({
 | 
				
			|||||||
	recipe = {
 | 
						recipe = {
 | 
				
			||||||
		{'default:cobble', 'default:cobble',         'default:cobble'},
 | 
							{'default:cobble', 'default:cobble',         'default:cobble'},
 | 
				
			||||||
		{'default:cobble', 'technic:machine_casing', 'default:cobble'},
 | 
							{'default:cobble', 'technic:machine_casing', 'default:cobble'},
 | 
				
			||||||
		{'default:cobble', 'technic:lv_cable',       'default:cobble'},
 | 
							{'default:cobble', 'technic:lv_cable0',      'default:cobble'},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,9 +4,9 @@ minetest.register_alias("extractor", "technic:lv_extractor")
 | 
				
			|||||||
minetest.register_craft({
 | 
					minetest.register_craft({
 | 
				
			||||||
	output = 'technic:lv_extractor',
 | 
						output = 'technic:lv_extractor',
 | 
				
			||||||
	recipe = {
 | 
						recipe = {
 | 
				
			||||||
		{'technic:treetap', 'basic_materials:motor',          'technic:treetap'},
 | 
							{'technic:treetap', 'technic:motor',          'technic:treetap'},
 | 
				
			||||||
		{'technic:treetap', 'technic:machine_casing', 'technic:treetap'},
 | 
							{'technic:treetap', 'technic:machine_casing', 'technic:treetap'},
 | 
				
			||||||
		{'',                'technic:lv_cable',       ''},
 | 
							{'',                'technic:lv_cable0',      ''},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,9 +8,9 @@ minetest.register_alias("lv_generator", "technic:lv_generator")
 | 
				
			|||||||
minetest.register_craft({
 | 
					minetest.register_craft({
 | 
				
			||||||
	output = 'technic:lv_generator',
 | 
						output = 'technic:lv_generator',
 | 
				
			||||||
	recipe = {
 | 
						recipe = {
 | 
				
			||||||
		{'default:stone', 'default:furnace',        'default:stone'},
 | 
							{'default:stone', 'default:stone',          'default:stone'},
 | 
				
			||||||
		{'default:stone', 'technic:machine_casing', 'default:stone'},
 | 
							{'default:stone', 'technic:machine_casing', 'default:stone'},
 | 
				
			||||||
		{'default:stone', 'technic:lv_cable',       'default:stone'},
 | 
							{'default:stone', 'technic:lv_cable0',      'default:stone'},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -10,20 +10,42 @@ local S = technic.getter
 | 
				
			|||||||
minetest.register_craft({
 | 
					minetest.register_craft({
 | 
				
			||||||
	output = 'technic:geothermal',
 | 
						output = 'technic:geothermal',
 | 
				
			||||||
	recipe = {
 | 
						recipe = {
 | 
				
			||||||
		{'technic:granite',          'default:diamond',        'technic:granite'},
 | 
							{'default:stone', 'default:diamond', 'default:stone'},
 | 
				
			||||||
		{'basic_materials:copper_wire', 'technic:machine_casing', 'basic_materials:copper_wire'},
 | 
							{'default:copper_ingot', 'technic:machine_casing', 'default:copper_ingot'},
 | 
				
			||||||
		{'technic:granite',          'technic:lv_cable',       'technic:granite'},
 | 
							{'default:stone', 'technic:lv_cable0', 'default:stone'},
 | 
				
			||||||
	},
 | 
						}
 | 
				
			||||||
	replacements = {
 | 
					 | 
				
			||||||
		{"basic_materials:copper_wire", "basic_materials:empty_spool"},
 | 
					 | 
				
			||||||
		{"basic_materials:copper_wire", "basic_materials:empty_spool"}
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
minetest.register_craftitem("technic:geothermal", {
 | 
					minetest.register_craftitem("technic:geothermal", {
 | 
				
			||||||
	description = S("Geothermal %s Generator"):format("LV"),
 | 
						description = S("Geothermal %s Generator"):format("LV"),
 | 
				
			||||||
}) 
 | 
					}) 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					minetest.register_node("technic:geothermal", {
 | 
				
			||||||
 | 
						description = S("Geothermal %s Generator"):format("LV"),
 | 
				
			||||||
 | 
						tiles = {"technic_geothermal_top.png", "technic_machine_bottom.png", "technic_geothermal_side.png",
 | 
				
			||||||
 | 
						         "technic_geothermal_side.png", "technic_geothermal_side.png", "technic_geothermal_side.png"},
 | 
				
			||||||
 | 
						paramtype2 = "facedir",
 | 
				
			||||||
 | 
						groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2},
 | 
				
			||||||
 | 
						legacy_facedir_simple = true,
 | 
				
			||||||
 | 
						sounds = default.node_sound_wood_defaults(),
 | 
				
			||||||
 | 
						on_construct = function(pos)
 | 
				
			||||||
 | 
							local meta = minetest.get_meta(pos)
 | 
				
			||||||
 | 
							meta:set_string("infotext", S("Geothermal %s Generator"):format("LV"))
 | 
				
			||||||
 | 
							meta:set_int("LV_EU_supply", 0)
 | 
				
			||||||
 | 
						end,	
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					minetest.register_node("technic:geothermal_active", {
 | 
				
			||||||
 | 
						description = S("Geothermal %s Generator"):format("LV"),
 | 
				
			||||||
 | 
						tiles = {"technic_geothermal_top_active.png", "technic_machine_bottom.png", "technic_geothermal_side.png",
 | 
				
			||||||
 | 
						         "technic_geothermal_side.png", "technic_geothermal_side.png", "technic_geothermal_side.png"},
 | 
				
			||||||
 | 
						paramtype2 = "facedir",
 | 
				
			||||||
 | 
						groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1},
 | 
				
			||||||
 | 
						legacy_facedir_simple = true,
 | 
				
			||||||
 | 
						sounds = default.node_sound_wood_defaults(),
 | 
				
			||||||
 | 
						drop = "technic:geothermal",
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local check_node_around = function(pos)
 | 
					local check_node_around = function(pos)
 | 
				
			||||||
	local node = minetest.get_node(pos)
 | 
						local node = minetest.get_node(pos)
 | 
				
			||||||
	if node.name == "default:water_source" or node.name == "default:water_flowing" then return 1 end
 | 
						if node.name == "default:water_source" or node.name == "default:water_flowing" then return 1 end
 | 
				
			||||||
@@ -31,7 +53,11 @@ local check_node_around = function(pos)
 | 
				
			|||||||
	return 0
 | 
						return 0
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local run = function(pos, node)
 | 
					minetest.register_abm({
 | 
				
			||||||
 | 
						nodenames = {"technic:geothermal","technic:geothermal_active"},
 | 
				
			||||||
 | 
						interval = 1,
 | 
				
			||||||
 | 
						chance   = 1,
 | 
				
			||||||
 | 
						action = function(pos, node, active_object_count, active_object_count_wider)
 | 
				
			||||||
		local meta             = minetest.get_meta(pos)
 | 
							local meta             = minetest.get_meta(pos)
 | 
				
			||||||
		local water_nodes      = 0
 | 
							local water_nodes      = 0
 | 
				
			||||||
		local lava_nodes       = 0
 | 
							local lava_nodes       = 0
 | 
				
			||||||
@@ -81,35 +107,6 @@ local run = function(pos, node)
 | 
				
			|||||||
			meta:set_int("LV_EU_supply", 0)
 | 
								meta:set_int("LV_EU_supply", 0)
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
 | 
					 | 
				
			||||||
minetest.register_node("technic:geothermal", {
 | 
					 | 
				
			||||||
	description = S("Geothermal %s Generator"):format("LV"),
 | 
					 | 
				
			||||||
	tiles = {"technic_geothermal_top.png", "technic_machine_bottom.png", "technic_geothermal_side.png",
 | 
					 | 
				
			||||||
	         "technic_geothermal_side.png", "technic_geothermal_side.png", "technic_geothermal_side.png"},
 | 
					 | 
				
			||||||
	groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
 | 
					 | 
				
			||||||
		technic_machine=1, technic_lv=1},
 | 
					 | 
				
			||||||
	paramtype2 = "facedir",
 | 
					 | 
				
			||||||
	legacy_facedir_simple = true,
 | 
					 | 
				
			||||||
	sounds = default.node_sound_wood_defaults(),
 | 
					 | 
				
			||||||
	on_construct = function(pos)
 | 
					 | 
				
			||||||
		local meta = minetest.get_meta(pos)
 | 
					 | 
				
			||||||
		meta:set_string("infotext", S("Geothermal %s Generator"):format("LV"))
 | 
					 | 
				
			||||||
		meta:set_int("LV_EU_supply", 0)
 | 
					 | 
				
			||||||
	end,
 | 
					 | 
				
			||||||
	technic_run = run,
 | 
					 | 
				
			||||||
})
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
minetest.register_node("technic:geothermal_active", {
 | 
					 | 
				
			||||||
	description = S("Geothermal %s Generator"):format("LV"),
 | 
					 | 
				
			||||||
	tiles = {"technic_geothermal_top_active.png", "technic_machine_bottom.png", "technic_geothermal_side.png",
 | 
					 | 
				
			||||||
	         "technic_geothermal_side.png", "technic_geothermal_side.png", "technic_geothermal_side.png"},
 | 
					 | 
				
			||||||
	paramtype2 = "facedir",
 | 
					 | 
				
			||||||
	groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
 | 
					 | 
				
			||||||
		technic_machine=1, technic_lv=1, not_in_creative_inventory=1},
 | 
					 | 
				
			||||||
	legacy_facedir_simple = true,
 | 
					 | 
				
			||||||
	sounds = default.node_sound_wood_defaults(),
 | 
					 | 
				
			||||||
	drop = "technic:geothermal",
 | 
					 | 
				
			||||||
	technic_run = run,
 | 
					 | 
				
			||||||
}) 
 | 
					}) 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
technic.register_machine("LV", "technic:geothermal",        technic.producer)
 | 
					technic.register_machine("LV", "technic:geothermal",        technic.producer)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,11 +1,11 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
minetest.register_alias("grinder", "technic:lv_grinder")
 | 
					minetest.register_alias("grinder", "technic:grinder")
 | 
				
			||||||
minetest.register_craft({
 | 
					minetest.register_craft({
 | 
				
			||||||
	output = 'technic:lv_grinder',
 | 
						output = 'technic:grinder',
 | 
				
			||||||
	recipe = {
 | 
						recipe = {
 | 
				
			||||||
		{'default:desert_stone', 'default:diamond',        'default:desert_stone'},
 | 
							{'default:desert_stone', 'default:diamond',        'default:desert_stone'},
 | 
				
			||||||
		{'default:desert_stone', 'technic:machine_casing', 'default:desert_stone'},
 | 
							{'default:desert_stone', 'technic:machine_casing', 'default:desert_stone'},
 | 
				
			||||||
		{'technic:granite',      'technic:lv_cable',       'technic:granite'},
 | 
							{'default:stone',        'technic:lv_cable0',      'default:stone'},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -14,6 +14,10 @@ dofile(path.."/geothermal.lua")
 | 
				
			|||||||
dofile(path.."/water_mill.lua")
 | 
					dofile(path.."/water_mill.lua")
 | 
				
			||||||
dofile(path.."/generator.lua")
 | 
					dofile(path.."/generator.lua")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Coal-powered machines (TODO -> move to somewhere else?)
 | 
				
			||||||
 | 
					dofile(path.."/coal_alloy_furnace.lua")
 | 
				
			||||||
 | 
					dofile(path.."/coal_furnace.lua")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- Machines
 | 
					-- Machines
 | 
				
			||||||
dofile(path.."/alloy_furnace.lua")
 | 
					dofile(path.."/alloy_furnace.lua")
 | 
				
			||||||
dofile(path.."/electric_furnace.lua")
 | 
					dofile(path.."/electric_furnace.lua")
 | 
				
			||||||
@@ -22,3 +26,8 @@ dofile(path.."/extractor.lua")
 | 
				
			|||||||
dofile(path.."/compressor.lua")
 | 
					dofile(path.."/compressor.lua")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
dofile(path.."/music_player.lua")
 | 
					dofile(path.."/music_player.lua")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					dofile(path.."/cnc.lua")
 | 
				
			||||||
 | 
					dofile(path.."/cnc_api.lua")
 | 
				
			||||||
 | 
					dofile(path.."/cnc_nodes.lua")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -7,23 +7,105 @@ minetest.register_alias("music_player", "technic:music_player")
 | 
				
			|||||||
minetest.register_craft({
 | 
					minetest.register_craft({
 | 
				
			||||||
	output = 'technic:music_player',
 | 
						output = 'technic:music_player',
 | 
				
			||||||
	recipe = {
 | 
						recipe = {
 | 
				
			||||||
		{'technic:chromium_ingot', 'default:diamond',        'technic:chromium_ingot'},
 | 
							{'group:wood',      'default:diamond',        'group:wood'},
 | 
				
			||||||
		{'default:diamond', 'technic:machine_casing', 'default:diamond'},
 | 
							{'default:diamond', 'technic:machine_casing', 'default:diamond'},
 | 
				
			||||||
		{'default:mossycobble',    'technic:lv_cable',       'default:mossycobble'},
 | 
							{'default:stone',   'technic:lv_cable0',      'default:stone'},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local music_handles = {}
 | 
					local music_handles = {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local music_player_formspec =
 | 
				
			||||||
 | 
						"invsize[8,9;]"..
 | 
				
			||||||
 | 
						"label[0,0;"..S("%s Music Player"):format("LV").."]"..
 | 
				
			||||||
 | 
						"button[4,1;1,1;track1;1]"..
 | 
				
			||||||
 | 
						"button[5,1;1,1;track2;2]"..
 | 
				
			||||||
 | 
						"button[6,1;1,1;track3;3]"..
 | 
				
			||||||
 | 
						"button[4,2;1,1;track4;4]"..
 | 
				
			||||||
 | 
						"button[5,2;1,1;track5;5]"..
 | 
				
			||||||
 | 
						"button[6,2;1,1;track6;6]"..
 | 
				
			||||||
 | 
						"button[4,3;1,1;track7;7]"..
 | 
				
			||||||
 | 
						"button[5,3;1,1;track8;8]"..
 | 
				
			||||||
 | 
						"button[6,3;1,1;track9;9]"..
 | 
				
			||||||
 | 
						"button[4,4;1,2;play;Play]"..
 | 
				
			||||||
 | 
						"button[6,4;1,2;stop;Stop]"..
 | 
				
			||||||
 | 
						"label[4,0;"..S("Current track %s"):format("--").."]"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local function play_track(pos, track)
 | 
					local function play_track(pos, track)
 | 
				
			||||||
	return minetest.sound_play("technic_track"..tostring(track),
 | 
						return minetest.sound_play("technic_track"..tostring(track),
 | 
				
			||||||
			{pos = pos, gain = 1.0, loop = true, max_hear_distance = 72,})
 | 
								{pos = pos, gain = 1.0, loop = true, max_hear_distance = 72,})
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local run = function(pos, node)
 | 
					minetest.register_node("technic:music_player", {
 | 
				
			||||||
 | 
						description = S("%s Music Player"):format("LV"),
 | 
				
			||||||
 | 
						tiles = {"technic_music_player_top.png", "technic_machine_bottom.png", "technic_music_player_side.png",
 | 
				
			||||||
 | 
						         "technic_music_player_side.png", "technic_music_player_side.png", "technic_music_player_side.png"},
 | 
				
			||||||
 | 
						groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
 | 
				
			||||||
 | 
						sounds = default.node_sound_wood_defaults(),
 | 
				
			||||||
 | 
						on_construct = function(pos)
 | 
				
			||||||
 | 
							local meta = minetest.get_meta(pos)
 | 
				
			||||||
 | 
							meta:set_string("infotext", S("%s Music Player"):format("LV"))
 | 
				
			||||||
 | 
							meta:set_int("active", 0)
 | 
				
			||||||
 | 
							meta:set_int("current_track", 1)
 | 
				
			||||||
 | 
							meta:set_string("formspec", music_player_formspec)
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
						on_receive_fields = function(pos, formanme, fields, sender)
 | 
				
			||||||
 | 
							local meta          = minetest.get_meta(pos)
 | 
				
			||||||
 | 
							local pos_hash      = minetest.hash_node_position(pos)
 | 
				
			||||||
 | 
							local music_handle  = music_handles[pos_hash]
 | 
				
			||||||
 | 
							local current_track = meta:get_int("current_track")
 | 
				
			||||||
 | 
							if fields.track1 then current_track = 1 end
 | 
				
			||||||
 | 
							if fields.track2 then current_track = 2 end
 | 
				
			||||||
 | 
							if fields.track3 then current_track = 3 end
 | 
				
			||||||
 | 
							if fields.track4 then current_track = 4 end
 | 
				
			||||||
 | 
							if fields.track5 then current_track = 5 end
 | 
				
			||||||
 | 
							if fields.track6 then current_track = 6 end
 | 
				
			||||||
 | 
							if fields.track7 then current_track = 7 end
 | 
				
			||||||
 | 
							if fields.track8 then current_track = 8 end
 | 
				
			||||||
 | 
							if fields.track9 then current_track = 9 end
 | 
				
			||||||
 | 
							meta:set_int("current_track", current_track)
 | 
				
			||||||
 | 
							meta:set_string("formspec",
 | 
				
			||||||
 | 
									"invsize[8,9;]"..
 | 
				
			||||||
 | 
									"label[0,0;"..S("%s Music Player"):format("LV").."]"..
 | 
				
			||||||
 | 
									"button[4,1;1,1;track1;1]"..
 | 
				
			||||||
 | 
									"button[5,1;1,1;track2;2]"..
 | 
				
			||||||
 | 
									"button[6,1;1,1;track3;3]"..
 | 
				
			||||||
 | 
									"button[4,2;1,1;track4;4]"..
 | 
				
			||||||
 | 
									"button[5,2;1,1;track5;5]"..
 | 
				
			||||||
 | 
									"button[6,2;1,1;track6;6]"..
 | 
				
			||||||
 | 
									"button[4,3;1,1;track7;7]"..
 | 
				
			||||||
 | 
									"button[5,3;1,1;track8;8]"..
 | 
				
			||||||
 | 
									"button[6,3;1,1;track9;9]"..
 | 
				
			||||||
 | 
									"button[4,4;1,2;play;Play]"..
 | 
				
			||||||
 | 
									"button[6,4;1,2;stop;Stop]"..
 | 
				
			||||||
 | 
									"label[4,0;"..S("Current track %s")
 | 
				
			||||||
 | 
										:format(current_track).."]")
 | 
				
			||||||
 | 
							if fields.play then
 | 
				
			||||||
 | 
								if music_handle then
 | 
				
			||||||
 | 
									minetest.sound_stop(music_handle)
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
								music_handle = play_track(pos, current_track)
 | 
				
			||||||
 | 
								meta:set_int("active", 1)
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							if fields.stop then
 | 
				
			||||||
 | 
								meta:set_int("active", 0)
 | 
				
			||||||
 | 
								if music_handle then
 | 
				
			||||||
 | 
									minetest.sound_stop(music_handle)
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							music_handles[pos_hash] = music_handle
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					minetest.register_abm({
 | 
				
			||||||
 | 
						nodenames = {"technic:music_player"},
 | 
				
			||||||
 | 
						interval = 1,
 | 
				
			||||||
 | 
						chance   = 1,
 | 
				
			||||||
 | 
						action = function(pos, node, active_object_count, active_object_count_wider)
 | 
				
			||||||
		local meta         = minetest.get_meta(pos)
 | 
							local meta         = minetest.get_meta(pos)
 | 
				
			||||||
		local eu_input     = meta:get_int("LV_EU_input")
 | 
							local eu_input     = meta:get_int("LV_EU_input")
 | 
				
			||||||
		local machine_name = S("%s Music Player"):format("LV")
 | 
							local machine_name = S("%s Music Player"):format("LV")
 | 
				
			||||||
 | 
							local machine_node = "technic:music_player"
 | 
				
			||||||
		local demand       = 150
 | 
							local demand       = 150
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		local current_track = meta:get_int("current_track")
 | 
							local current_track = meta:get_int("current_track")
 | 
				
			||||||
@@ -37,6 +119,9 @@ local run = function(pos, node)
 | 
				
			|||||||
			return
 | 
								return
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							-- Power off automatically if no longer connected to a switching station
 | 
				
			||||||
 | 
							technic.switching_station_timeout_count(pos, "LV")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if meta:get_int("active") == 0 then
 | 
							if meta:get_int("active") == 0 then
 | 
				
			||||||
			meta:set_string("infotext", S("%s Idle"):format(machine_name))
 | 
								meta:set_string("infotext", S("%s Idle"):format(machine_name))
 | 
				
			||||||
			meta:set_int("LV_EU_demand", 0)
 | 
								meta:set_int("LV_EU_demand", 0)
 | 
				
			||||||
@@ -58,73 +143,6 @@ local run = function(pos, node)
 | 
				
			|||||||
		music_handles[pos_hash] = music_handle
 | 
							music_handles[pos_hash] = music_handle
 | 
				
			||||||
		meta:set_int("LV_EU_demand", demand)
 | 
							meta:set_int("LV_EU_demand", demand)
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
 | 
					 | 
				
			||||||
local function stop_player(pos, node)
 | 
					 | 
				
			||||||
	local pos_hash = minetest.hash_node_position(pos)
 | 
					 | 
				
			||||||
	local music_handle = music_handles[pos_hash]
 | 
					 | 
				
			||||||
	if music_handle then
 | 
					 | 
				
			||||||
		minetest.sound_stop(music_handle)
 | 
					 | 
				
			||||||
		music_handles[pos_hash] = nil
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
local function set_display(meta)
 | 
					 | 
				
			||||||
	meta:set_string("formspec",
 | 
					 | 
				
			||||||
			"size[4,4.5]"..
 | 
					 | 
				
			||||||
			"item_image[0,0;1,1;technic:music_player]"..
 | 
					 | 
				
			||||||
			"label[1,0;"..S("%s Music Player"):format("LV").."]"..
 | 
					 | 
				
			||||||
			"button[0,1;1,1;track1;1]"..
 | 
					 | 
				
			||||||
			"button[1,1;1,1;track2;2]"..
 | 
					 | 
				
			||||||
			"button[2,1;1,1;track3;3]"..
 | 
					 | 
				
			||||||
			"button[0,2;1,1;track4;4]"..
 | 
					 | 
				
			||||||
			"button[1,2;1,1;track5;5]"..
 | 
					 | 
				
			||||||
			"button[2,2;1,1;track6;6]"..
 | 
					 | 
				
			||||||
			"button[0,3;1,1;track7;7]"..
 | 
					 | 
				
			||||||
			"button[1,3;1,1;track8;8]"..
 | 
					 | 
				
			||||||
			"button[2,3;1,1;track9;9]"..
 | 
					 | 
				
			||||||
			"button[3,1;1,1;stop;Stop]"..
 | 
					 | 
				
			||||||
			"label[0,4;"..minetest.formspec_escape(
 | 
					 | 
				
			||||||
				meta:get_int("active") == 0 and
 | 
					 | 
				
			||||||
					S("Stopped") or
 | 
					 | 
				
			||||||
					S("Current track %s"):format(meta:get_int("current_track"))).."]")
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
minetest.register_node("technic:music_player", {
 | 
					 | 
				
			||||||
	description = S("%s Music Player"):format("LV"),
 | 
					 | 
				
			||||||
	tiles = {"technic_music_player_top.png", "technic_machine_bottom.png", "technic_music_player_side.png",
 | 
					 | 
				
			||||||
	         "technic_music_player_side.png", "technic_music_player_side.png", "technic_music_player_side.png"},
 | 
					 | 
				
			||||||
	groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
 | 
					 | 
				
			||||||
		technic_machine=1, technic_lv=1},
 | 
					 | 
				
			||||||
	connect_sides = {"bottom"},
 | 
					 | 
				
			||||||
	sounds = default.node_sound_wood_defaults(),
 | 
					 | 
				
			||||||
	on_construct = function(pos)
 | 
					 | 
				
			||||||
		local meta = minetest.get_meta(pos)
 | 
					 | 
				
			||||||
		meta:set_string("infotext", S("%s Music Player"):format("LV"))
 | 
					 | 
				
			||||||
		set_display(meta)
 | 
					 | 
				
			||||||
	end,
 | 
					 | 
				
			||||||
	on_receive_fields = function(pos, formanme, fields, sender)
 | 
					 | 
				
			||||||
		local new_track = nil
 | 
					 | 
				
			||||||
		if fields.stop then new_track = 0 end
 | 
					 | 
				
			||||||
		if fields.track1 then new_track = 1 end
 | 
					 | 
				
			||||||
		if fields.track2 then new_track = 2 end
 | 
					 | 
				
			||||||
		if fields.track3 then new_track = 3 end
 | 
					 | 
				
			||||||
		if fields.track4 then new_track = 4 end
 | 
					 | 
				
			||||||
		if fields.track5 then new_track = 5 end
 | 
					 | 
				
			||||||
		if fields.track6 then new_track = 6 end
 | 
					 | 
				
			||||||
		if fields.track7 then new_track = 7 end
 | 
					 | 
				
			||||||
		if fields.track8 then new_track = 8 end
 | 
					 | 
				
			||||||
		if fields.track9 then new_track = 9 end
 | 
					 | 
				
			||||||
		if new_track then
 | 
					 | 
				
			||||||
			stop_player(pos)
 | 
					 | 
				
			||||||
			local meta = minetest.get_meta(pos)
 | 
					 | 
				
			||||||
			meta:set_int("active", new_track == 0 and 0 or 1)
 | 
					 | 
				
			||||||
			meta:set_int("current_track", new_track)
 | 
					 | 
				
			||||||
			set_display(meta)
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	end,
 | 
					 | 
				
			||||||
	on_destruct = stop_player,
 | 
					 | 
				
			||||||
	technic_run = run,
 | 
					 | 
				
			||||||
	technic_on_disable = stop_player,
 | 
					 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
technic.register_machine("LV", "technic:music_player", technic.receiver)
 | 
					technic.register_machine("LV", "technic:music_player", technic.receiver)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -10,7 +10,7 @@ minetest.register_craft({
 | 
				
			|||||||
	recipe = {
 | 
						recipe = {
 | 
				
			||||||
		{'technic:solar_panel',        'technic:solar_panel',    'technic:solar_panel'},
 | 
							{'technic:solar_panel',        'technic:solar_panel',    'technic:solar_panel'},
 | 
				
			||||||
		{'technic:carbon_steel_ingot', 'technic:lv_transformer', 'technic:carbon_steel_ingot'},
 | 
							{'technic:carbon_steel_ingot', 'technic:lv_transformer', 'technic:carbon_steel_ingot'},
 | 
				
			||||||
		{'',                           'technic:lv_cable',       ''},
 | 
							{'',                           'technic:lv_cable0',      ''},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,52 +4,10 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
local S = technic.getter
 | 
					local S = technic.getter
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
minetest.register_craft({
 | 
					 | 
				
			||||||
	output = 'technic:solar_panel',
 | 
					 | 
				
			||||||
	recipe = {
 | 
					 | 
				
			||||||
		{'technic:doped_silicon_wafer', 'technic:doped_silicon_wafer', 'technic:doped_silicon_wafer'},
 | 
					 | 
				
			||||||
		{'basic_materials:silver_wire',    'technic:lv_cable',            'mesecons_materials:glue'},
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	replacements = { {"basic_materials:silver_wire", "basic_materials:empty_spool"}, },
 | 
					 | 
				
			||||||
})
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
local run = function(pos, node)
 | 
					 | 
				
			||||||
	-- The action here is to make the solar panel prodice power
 | 
					 | 
				
			||||||
	-- Power is dependent on the light level and the height above ground
 | 
					 | 
				
			||||||
	-- There are many ways to cheat by using other light sources like lamps.
 | 
					 | 
				
			||||||
	-- As there is no way to determine if light is sunlight that is just a shame.
 | 
					 | 
				
			||||||
	-- To take care of some of it solar panels do not work outside daylight hours or if
 | 
					 | 
				
			||||||
	-- built below 0m
 | 
					 | 
				
			||||||
	local pos1 = {x=pos.x, y=pos.y+1, z=pos.z}
 | 
					 | 
				
			||||||
	local machine_name = S("Small Solar %s Generator"):format("LV")
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	local light = minetest.get_node_light(pos1, nil)
 | 
					 | 
				
			||||||
	local time_of_day = minetest.get_timeofday()
 | 
					 | 
				
			||||||
	local meta = minetest.get_meta(pos)
 | 
					 | 
				
			||||||
	if light == nil then light = 0 end
 | 
					 | 
				
			||||||
	-- turn on panel only during day time and if sufficient light
 | 
					 | 
				
			||||||
        -- I know this is counter intuitive when cheating by using other light sources underground.
 | 
					 | 
				
			||||||
	if light >= 12 and time_of_day >= 0.24 and time_of_day <= 0.76 and pos.y > -10 then
 | 
					 | 
				
			||||||
		local charge_to_give = math.floor((light + pos1.y) * 3)
 | 
					 | 
				
			||||||
		charge_to_give = math.max(charge_to_give, 0)
 | 
					 | 
				
			||||||
		charge_to_give = math.min(charge_to_give, 200)
 | 
					 | 
				
			||||||
		meta:set_string("infotext", S("@1 Active (@2)", machine_name,
 | 
					 | 
				
			||||||
			technic.EU_string(charge_to_give)))
 | 
					 | 
				
			||||||
		meta:set_int("LV_EU_supply", charge_to_give)
 | 
					 | 
				
			||||||
	else
 | 
					 | 
				
			||||||
		meta:set_string("infotext", S("%s Idle"):format(machine_name))
 | 
					 | 
				
			||||||
		meta:set_int("LV_EU_supply", 0)
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
minetest.register_node("technic:solar_panel", {
 | 
					minetest.register_node("technic:solar_panel", {
 | 
				
			||||||
	tiles = {"technic_solar_panel_top.png",  "technic_solar_panel_bottom.png", "technic_solar_panel_side.png",
 | 
						tiles = {"technic_solar_panel_top.png",  "technic_solar_panel_bottom.png", "technic_solar_panel_side.png",
 | 
				
			||||||
	         "technic_solar_panel_side.png", "technic_solar_panel_side.png",   "technic_solar_panel_side.png"},
 | 
						         "technic_solar_panel_side.png", "technic_solar_panel_side.png",   "technic_solar_panel_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_lv=1},
 | 
					 | 
				
			||||||
	connect_sides = {"bottom"},
 | 
					 | 
				
			||||||
	sounds = default.node_sound_wood_defaults(),
 | 
						sounds = default.node_sound_wood_defaults(),
 | 
				
			||||||
    	description = S("Small Solar %s Generator"):format("LV"),
 | 
					    	description = S("Small Solar %s Generator"):format("LV"),
 | 
				
			||||||
	active = false,
 | 
						active = false,
 | 
				
			||||||
@@ -65,7 +23,50 @@ minetest.register_node("technic:solar_panel", {
 | 
				
			|||||||
		meta:set_int("LV_EU_supply", 0)
 | 
							meta:set_int("LV_EU_supply", 0)
 | 
				
			||||||
		meta:set_string("infotext", S("Small Solar %s Generator"):format("LV"))
 | 
							meta:set_string("infotext", S("Small Solar %s Generator"):format("LV"))
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
	technic_run = run,
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					minetest.register_craft({
 | 
				
			||||||
 | 
						output = 'technic:solar_panel',
 | 
				
			||||||
 | 
						recipe = {
 | 
				
			||||||
 | 
							{'technic:doped_silicon_wafer', 'technic:doped_silicon_wafer', 'technic:doped_silicon_wafer'},
 | 
				
			||||||
 | 
							{'technic:wrought_iron_ingot',  'technic:lv_cable0',           'technic:wrought_iron_ingot'},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					minetest.register_abm({
 | 
				
			||||||
 | 
						nodenames = {"technic:solar_panel"},
 | 
				
			||||||
 | 
						interval   = 1,
 | 
				
			||||||
 | 
						chance     = 1,
 | 
				
			||||||
 | 
						action = function(pos, node, active_object_count, active_object_count_wider)
 | 
				
			||||||
 | 
							-- The action here is to make the solar panel prodice power
 | 
				
			||||||
 | 
							-- Power is dependent on the light level and the height above ground
 | 
				
			||||||
 | 
							-- 130m and above is optimal as it would be above cloud level.
 | 
				
			||||||
 | 
							-- Height gives 1/4 of the effect, light 3/4. Max. effect is 26EU.
 | 
				
			||||||
 | 
							-- There are many ways to cheat by using other light sources like lamps.
 | 
				
			||||||
 | 
							-- As there is no way to determine if light is sunlight that is just a shame.
 | 
				
			||||||
 | 
							-- To take care of some of it solar panels do not work outside daylight hours or if
 | 
				
			||||||
 | 
							-- built below -10m
 | 
				
			||||||
 | 
							local pos1 = {x=pos.x, y=pos.y+1, z=pos.z}
 | 
				
			||||||
 | 
							local machine_name = S("Small Solar %s Generator"):format("LV")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							local light = minetest.get_node_light(pos1, nil)
 | 
				
			||||||
 | 
							local time_of_day = minetest.get_timeofday()
 | 
				
			||||||
 | 
							local meta = minetest.get_meta(pos)
 | 
				
			||||||
 | 
							if light == nil then light = 0 end
 | 
				
			||||||
 | 
							-- turn on panel only during day time and if sufficient light
 | 
				
			||||||
 | 
					                -- I know this is counter intuitive when cheating by using other light sources underground.
 | 
				
			||||||
 | 
							if light >= 12 and time_of_day >= 0.24 and time_of_day <= 0.76 and pos.y > -10 then
 | 
				
			||||||
 | 
								local charge_to_give = math.floor((light + pos1.y) * 3)
 | 
				
			||||||
 | 
								charge_to_give = math.max(charge_to_give, 0)
 | 
				
			||||||
 | 
								charge_to_give = math.min(charge_to_give, 200)
 | 
				
			||||||
 | 
								meta:set_string("infotext", S("%s Active"):format(machine_name).." ("..charge_to_give.."EU)")
 | 
				
			||||||
 | 
								meta:set_int("LV_EU_supply", charge_to_give)
 | 
				
			||||||
 | 
							else
 | 
				
			||||||
 | 
								meta:set_string("infotext", S("%s Idle"):format(machine_name))
 | 
				
			||||||
 | 
								meta:set_int("LV_EU_supply", 0)
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
}) 
 | 
					}) 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
technic.register_machine("LV", "technic:solar_panel", technic.producer)
 | 
					technic.register_machine("LV", "technic:solar_panel", technic.producer)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,37 +1,67 @@
 | 
				
			|||||||
-- A water mill produces LV EUs by exploiting flowing water across it
 | 
					-- A water mill produces LV EUs by exploiting flowing water across it
 | 
				
			||||||
-- It is a LV EU supplier and fairly low yield (max 180EUs)
 | 
					-- It is a LV EU supplyer and fairly low yield (max 120EUs)
 | 
				
			||||||
-- It is a little over half as good as the thermal generator.
 | 
					-- It is a little under half as good as the thermal generator.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
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({
 | 
				
			||||||
	output = 'technic:water_mill',
 | 
						output = 'technic:water_mill',
 | 
				
			||||||
	recipe = {
 | 
						recipe = {
 | 
				
			||||||
		{'technic:marble', 'default:diamond',        'technic:marble'},
 | 
							{'default:stone', 'default:diamond',        'default:stone'},
 | 
				
			||||||
		{'group:wood',    'technic:machine_casing', 'group:wood'},
 | 
							{'group:wood',    'technic:machine_casing', 'group:wood'},
 | 
				
			||||||
		{'technic:marble', 'technic:lv_cable',       'technic:marble'},
 | 
							{'default:stone', 'technic:lv_cable0',      'default:stone'},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					minetest.register_node("technic:water_mill", {
 | 
				
			||||||
 | 
						description = S("Hydro %s Generator"):format("LV"),
 | 
				
			||||||
 | 
						tiles = {"technic_water_mill_top.png",  "technic_machine_bottom.png",
 | 
				
			||||||
 | 
						         "technic_water_mill_side.png", "technic_water_mill_side.png",
 | 
				
			||||||
 | 
						         "technic_water_mill_side.png", "technic_water_mill_side.png"},
 | 
				
			||||||
 | 
						paramtype2 = "facedir",
 | 
				
			||||||
 | 
						groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2},
 | 
				
			||||||
 | 
						legacy_facedir_simple = true,
 | 
				
			||||||
 | 
						sounds = default.node_sound_wood_defaults(),
 | 
				
			||||||
 | 
						on_construct = function(pos)
 | 
				
			||||||
 | 
							local meta = minetest.get_meta(pos)
 | 
				
			||||||
 | 
							meta:set_string("infotext", S("Hydro %s Generator"):format("LV"))
 | 
				
			||||||
 | 
							meta:set_int("LV_EU_supply", 0)
 | 
				
			||||||
 | 
						end,	
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					minetest.register_node("technic:water_mill_active", {
 | 
				
			||||||
 | 
						description = S("Hydro %s Generator"):format("LV"),
 | 
				
			||||||
 | 
						tiles = {"technic_water_mill_top_active.png", "technic_machine_bottom.png",
 | 
				
			||||||
 | 
						         "technic_water_mill_side.png",       "technic_water_mill_side.png",
 | 
				
			||||||
 | 
						         "technic_water_mill_side.png",       "technic_water_mill_side.png"},
 | 
				
			||||||
 | 
						paramtype2 = "facedir",
 | 
				
			||||||
 | 
						groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1},
 | 
				
			||||||
 | 
						legacy_facedir_simple = true,
 | 
				
			||||||
 | 
						sounds = default.node_sound_wood_defaults(),
 | 
				
			||||||
 | 
						drop = "technic:water_mill",
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local function check_node_around_mill(pos)
 | 
					local function check_node_around_mill(pos)
 | 
				
			||||||
	local node = minetest.get_node(pos)
 | 
						local node = minetest.get_node(pos)
 | 
				
			||||||
	if node.name == "default:water_flowing"
 | 
						if node.name == "default:water_flowing" or
 | 
				
			||||||
	  or node.name == "default:river_water_flowing" then
 | 
						   node.name == "default:water_source" then
 | 
				
			||||||
		return node.param2 -- returns approx. water flow, if any
 | 
							return true
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
	return false
 | 
						return false
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local run = function(pos, node)
 | 
					minetest.register_abm({
 | 
				
			||||||
 | 
						nodenames = {"technic:water_mill", "technic:water_mill_active"},
 | 
				
			||||||
 | 
						interval = 1,
 | 
				
			||||||
 | 
						chance   = 1,
 | 
				
			||||||
 | 
						action = function(pos, node, active_object_count, active_object_count_wider)
 | 
				
			||||||
		local meta             = minetest.get_meta(pos)
 | 
							local meta             = minetest.get_meta(pos)
 | 
				
			||||||
	local water_flow       = 0
 | 
							local water_nodes      = 0
 | 
				
			||||||
	local production_level
 | 
							local lava_nodes       = 0
 | 
				
			||||||
	local eu_supply
 | 
							local production_level = 0
 | 
				
			||||||
	local max_output       = 4 * 45 -- keeping it around 180, little more than previous 150 :)
 | 
							local eu_supply        = 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		local positions = {
 | 
							local positions = {
 | 
				
			||||||
			{x=pos.x+1, y=pos.y, z=pos.z},
 | 
								{x=pos.x+1, y=pos.y, z=pos.z},
 | 
				
			||||||
@@ -43,14 +73,16 @@ local run = function(pos, node)
 | 
				
			|||||||
		for _, p in pairs(positions) do
 | 
							for _, p in pairs(positions) do
 | 
				
			||||||
			local check = check_node_around_mill(p)
 | 
								local check = check_node_around_mill(p)
 | 
				
			||||||
			if check then
 | 
								if check then
 | 
				
			||||||
			water_flow = water_flow + check
 | 
									water_nodes = water_nodes + 1
 | 
				
			||||||
			end
 | 
								end
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	eu_supply = math.min(4 * water_flow, max_output)
 | 
							production_level = 25 * water_nodes
 | 
				
			||||||
	production_level = math.floor(100 * eu_supply / max_output)
 | 
							eu_supply = 30 * water_nodes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							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.."%)")
 | 
				
			||||||
@@ -65,43 +97,6 @@ local run = function(pos, node)
 | 
				
			|||||||
			technic.swap_node(pos, "technic:water_mill")
 | 
								technic.swap_node(pos, "technic:water_mill")
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
 | 
					 | 
				
			||||||
minetest.register_node("technic:water_mill", {
 | 
					 | 
				
			||||||
	description = S("Hydro %s Generator"):format("LV"),
 | 
					 | 
				
			||||||
	tiles = {
 | 
					 | 
				
			||||||
		"technic_water_mill_top.png",
 | 
					 | 
				
			||||||
		"technic_machine_bottom.png"..cable_entry,
 | 
					 | 
				
			||||||
		"technic_water_mill_side.png",
 | 
					 | 
				
			||||||
		"technic_water_mill_side.png",
 | 
					 | 
				
			||||||
		"technic_water_mill_side.png",
 | 
					 | 
				
			||||||
		"technic_water_mill_side.png"
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	paramtype2 = "facedir",
 | 
					 | 
				
			||||||
	groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
 | 
					 | 
				
			||||||
		technic_machine=1, technic_lv=1},
 | 
					 | 
				
			||||||
	legacy_facedir_simple = true,
 | 
					 | 
				
			||||||
	sounds = default.node_sound_wood_defaults(),
 | 
					 | 
				
			||||||
	on_construct = function(pos)
 | 
					 | 
				
			||||||
		local meta = minetest.get_meta(pos)
 | 
					 | 
				
			||||||
		meta:set_string("infotext", S("Hydro %s Generator"):format("LV"))
 | 
					 | 
				
			||||||
		meta:set_int("LV_EU_supply", 0)
 | 
					 | 
				
			||||||
	end,
 | 
					 | 
				
			||||||
	technic_run = run,
 | 
					 | 
				
			||||||
})
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
minetest.register_node("technic:water_mill_active", {
 | 
					 | 
				
			||||||
	description = S("Hydro %s Generator"):format("LV"),
 | 
					 | 
				
			||||||
	tiles = {"technic_water_mill_top_active.png", "technic_machine_bottom.png",
 | 
					 | 
				
			||||||
	         "technic_water_mill_side.png",       "technic_water_mill_side.png",
 | 
					 | 
				
			||||||
	         "technic_water_mill_side.png",       "technic_water_mill_side.png"},
 | 
					 | 
				
			||||||
	paramtype2 = "facedir",
 | 
					 | 
				
			||||||
	groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
 | 
					 | 
				
			||||||
		technic_machine=1, technic_lv=1, not_in_creative_inventory=1},
 | 
					 | 
				
			||||||
	legacy_facedir_simple = true,
 | 
					 | 
				
			||||||
	sounds = default.node_sound_wood_defaults(),
 | 
					 | 
				
			||||||
	drop = "technic:water_mill",
 | 
					 | 
				
			||||||
	technic_run = run,
 | 
					 | 
				
			||||||
	technic_disabled_machine_name = "technic:water_mill",
 | 
					 | 
				
			||||||
}) 
 | 
					}) 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
technic.register_machine("LV", "technic:water_mill",        technic.producer)
 | 
					technic.register_machine("LV", "technic:water_mill",        technic.producer)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,7 +5,7 @@ minetest.register_craft({
 | 
				
			|||||||
	recipe = {
 | 
						recipe = {
 | 
				
			||||||
		{'technic:stainless_steel_ingot', 'technic:lv_alloy_furnace', 'technic:stainless_steel_ingot'},
 | 
							{'technic:stainless_steel_ingot', 'technic:lv_alloy_furnace', 'technic:stainless_steel_ingot'},
 | 
				
			||||||
		{'pipeworks:tube_1',              'technic:mv_transformer',   'pipeworks:tube_1'},
 | 
							{'pipeworks:tube_1',              'technic:mv_transformer',   'pipeworks:tube_1'},
 | 
				
			||||||
		{'technic:stainless_steel_ingot', 'technic:mv_cable',         'technic:stainless_steel_ingot'},
 | 
							{'technic:stainless_steel_ingot', 'technic:mv_cable0',        'technic:stainless_steel_ingot'},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,7 +5,7 @@ minetest.register_craft({
 | 
				
			|||||||
	recipe = {
 | 
						recipe = {
 | 
				
			||||||
		{'technic:lv_battery_box0', 'technic:lv_battery_box0', 'technic:lv_battery_box0'},
 | 
							{'technic:lv_battery_box0', 'technic:lv_battery_box0', 'technic:lv_battery_box0'},
 | 
				
			||||||
		{'technic:lv_battery_box0', 'technic:mv_transformer',  'technic:lv_battery_box0'},
 | 
							{'technic:lv_battery_box0', 'technic:mv_transformer',  'technic:lv_battery_box0'},
 | 
				
			||||||
		{'',                        'technic:mv_cable',        ''},
 | 
							{'',                        'technic:mv_cable0',       ''},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,11 +1,11 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
minetest.register_alias("mv_cable", "technic:mv_cable")
 | 
					minetest.register_alias("mv_cable", "technic:mv_cable0")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
minetest.register_craft({
 | 
					minetest.register_craft({
 | 
				
			||||||
	output = 'technic:mv_cable 3',
 | 
						output = 'technic:mv_cable0 3',
 | 
				
			||||||
	recipe ={
 | 
						recipe ={
 | 
				
			||||||
		{'technic:rubber',    'technic:rubber',    'technic:rubber'},
 | 
							{'technic:rubber',    'technic:rubber',    'technic:rubber'},
 | 
				
			||||||
		{'technic:lv_cable', 'technic:lv_cable', 'technic:lv_cable'},
 | 
							{'technic:lv_cable0', 'technic:lv_cable0', 'technic:lv_cable0'},
 | 
				
			||||||
		{'technic:rubber',    'technic:rubber',    'technic:rubber'},
 | 
							{'technic:rubber',    'technic:rubber',    'technic:rubber'},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}) 
 | 
					}) 
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,16 +0,0 @@
 | 
				
			|||||||
minetest.register_craft({
 | 
					 | 
				
			||||||
	output = "technic:mv_centrifuge",
 | 
					 | 
				
			||||||
	recipe = {
 | 
					 | 
				
			||||||
		{"basic_materials:motor",          "technic:copper_plate",   "technic:diamond_drill_head"},
 | 
					 | 
				
			||||||
		{"technic:copper_plate",   "technic:machine_casing", "technic:copper_plate"      },
 | 
					 | 
				
			||||||
		{"pipeworks:one_way_tube", "technic:mv_cable",       "pipeworks:mese_filter"     },
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
})
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
technic.register_centrifuge({
 | 
					 | 
				
			||||||
	tier = "MV",
 | 
					 | 
				
			||||||
	demand = { 8000, 7000, 6000 },
 | 
					 | 
				
			||||||
	speed = 2,
 | 
					 | 
				
			||||||
	upgrade = 1,
 | 
					 | 
				
			||||||
	tube = 1,
 | 
					 | 
				
			||||||
})
 | 
					 | 
				
			||||||
@@ -5,7 +5,7 @@ minetest.register_craft({
 | 
				
			|||||||
	recipe = {
 | 
						recipe = {
 | 
				
			||||||
		{'technic:stainless_steel_ingot', 'technic:lv_compressor',  'technic:stainless_steel_ingot'},
 | 
							{'technic:stainless_steel_ingot', 'technic:lv_compressor',  'technic:stainless_steel_ingot'},
 | 
				
			||||||
		{'pipeworks:tube_1',              'technic:mv_transformer', 'pipeworks:tube_1'},
 | 
							{'pipeworks:tube_1',              'technic:mv_transformer', 'pipeworks:tube_1'},
 | 
				
			||||||
		{'technic:stainless_steel_ingot', 'technic:mv_cable',       'technic:stainless_steel_ingot'},
 | 
							{'technic:stainless_steel_ingot', 'technic:mv_cable0',      'technic:stainless_steel_ingot'},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -10,7 +10,7 @@ minetest.register_craft({
 | 
				
			|||||||
	recipe = {
 | 
						recipe = {
 | 
				
			||||||
		{'technic:stainless_steel_ingot', 'technic:lv_electric_furnace', 'technic:stainless_steel_ingot'},
 | 
							{'technic:stainless_steel_ingot', 'technic:lv_electric_furnace', 'technic:stainless_steel_ingot'},
 | 
				
			||||||
		{'pipeworks:tube_1',         'technic:mv_transformer',      'pipeworks:tube_1'},
 | 
							{'pipeworks:tube_1',         'technic:mv_transformer',      'pipeworks:tube_1'},
 | 
				
			||||||
		{'technic:stainless_steel_ingot', 'technic:mv_cable',            'technic:stainless_steel_ingot'},
 | 
							{'technic:stainless_steel_ingot', 'technic:mv_cable0',           'technic:stainless_steel_ingot'},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,7 +5,7 @@ minetest.register_craft({
 | 
				
			|||||||
	recipe = {
 | 
						recipe = {
 | 
				
			||||||
		{'technic:stainless_steel_ingot', 'technic:lv_extractor',   'technic:stainless_steel_ingot'},
 | 
							{'technic:stainless_steel_ingot', 'technic:lv_extractor',   'technic:stainless_steel_ingot'},
 | 
				
			||||||
		{'pipeworks:tube_1',              'technic:mv_transformer', 'pipeworks:tube_1'},
 | 
							{'pipeworks:tube_1',              'technic:mv_transformer', 'pipeworks:tube_1'},
 | 
				
			||||||
		{'technic:stainless_steel_ingot', 'technic:mv_cable',       'technic:stainless_steel_ingot'},
 | 
							{'technic:stainless_steel_ingot', 'technic:mv_cable0',      'technic:stainless_steel_ingot'},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,12 +0,0 @@
 | 
				
			|||||||
-- MV freezer
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
minetest.register_craft({
 | 
					 | 
				
			||||||
	output = 'technic:mv_freezer',
 | 
					 | 
				
			||||||
	recipe = {
 | 
					 | 
				
			||||||
		{'technic:stainless_steel_ingot', 'technic:motor',          'technic:stainless_steel_ingot'},
 | 
					 | 
				
			||||||
		{'pipeworks:pipe_1_empty',        'technic:mv_transformer', 'pipeworks:pipe_1_empty'},
 | 
					 | 
				
			||||||
		{'technic:stainless_steel_ingot', 'technic:mv_cable',       'technic:stainless_steel_ingot'},
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
})
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
technic.register_freezer({tier = "MV", demand = {800, 600, 400}, speed = 0.5, upgrade = 1, tube = 1})
 | 
					 | 
				
			||||||
@@ -5,7 +5,7 @@ minetest.register_craft({
 | 
				
			|||||||
	recipe = {
 | 
						recipe = {
 | 
				
			||||||
		{'technic:stainless_steel_ingot', 'technic:lv_generator',   'technic:stainless_steel_ingot'},
 | 
							{'technic:stainless_steel_ingot', 'technic:lv_generator',   'technic:stainless_steel_ingot'},
 | 
				
			||||||
		{'pipeworks:tube_1',              'technic:mv_transformer', 'pipeworks:tube_1'},
 | 
							{'pipeworks:tube_1',              'technic:mv_transformer', 'pipeworks:tube_1'},
 | 
				
			||||||
		{'technic:stainless_steel_ingot', 'technic:mv_cable',       'technic:stainless_steel_ingot'},
 | 
							{'technic:stainless_steel_ingot', 'technic:mv_cable0',      'technic:stainless_steel_ingot'},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,7 +5,7 @@ minetest.register_craft({
 | 
				
			|||||||
	recipe = {
 | 
						recipe = {
 | 
				
			||||||
		{'technic:stainless_steel_ingot', 'technic:lv_grinder',     'technic:stainless_steel_ingot'},
 | 
							{'technic:stainless_steel_ingot', 'technic:lv_grinder',     'technic:stainless_steel_ingot'},
 | 
				
			||||||
		{'pipeworks:tube_1',         'technic:mv_transformer', 'pipeworks:tube_1'},
 | 
							{'pipeworks:tube_1',         'technic:mv_transformer', 'pipeworks:tube_1'},
 | 
				
			||||||
		{'technic:stainless_steel_ingot', 'technic:mv_cable',       'technic:stainless_steel_ingot'},
 | 
							{'technic:stainless_steel_ingot', 'technic:mv_cable0',      'technic:stainless_steel_ingot'},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,105 +0,0 @@
 | 
				
			|||||||
-- A Hydro Turbine produces MV EUs by exploiting flowing water across it
 | 
					 | 
				
			||||||
-- It is a MV EU supplier and fairly high yield (max 1800EUs)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
local S = technic.getter
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
local cable_entry = "^technic_cable_connection_overlay.png"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
minetest.register_alias("hydro_turbine", "technic:hydro_turbine")
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
minetest.register_craft({
 | 
					 | 
				
			||||||
	output = 'technic:hydro_turbine',
 | 
					 | 
				
			||||||
	recipe = {
 | 
					 | 
				
			||||||
		{'technic:stainless_steel_ingot', 'technic:water_mill', 'technic:stainless_steel_ingot'},
 | 
					 | 
				
			||||||
		{'technic:water_mill', 'technic:mv_transformer', 'technic:water_mill'},
 | 
					 | 
				
			||||||
		{'technic:stainless_steel_ingot', 'technic:mv_cable', 'technic:stainless_steel_ingot'},
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
})
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
local function get_water_flow(pos)
 | 
					 | 
				
			||||||
	local node = minetest.get_node(pos)
 | 
					 | 
				
			||||||
	if minetest.get_item_group(node.name, "water") == 3 and string.find(node.name, "flowing") then
 | 
					 | 
				
			||||||
		return node.param2 -- returns approx. water flow, if any
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	return 0
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
---
 | 
					 | 
				
			||||||
-- 10 times better than LV hydro because of 2 extra water mills and 4 stainless steel, a transformer and whatnot ;P.
 | 
					 | 
				
			||||||
-- Man hydro turbines are tough and long lasting. So, give it some value :)
 | 
					 | 
				
			||||||
local run = function(pos, node)
 | 
					 | 
				
			||||||
	local meta             = minetest.get_meta(pos)
 | 
					 | 
				
			||||||
	local water_flow       = 0
 | 
					 | 
				
			||||||
	local production_level
 | 
					 | 
				
			||||||
	local eu_supply
 | 
					 | 
				
			||||||
	local max_output       = 40 * 45 -- Generates 1800EU/s
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	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, z=pos.z+1},
 | 
					 | 
				
			||||||
		{x=pos.x,   y=pos.y, z=pos.z-1},
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	for _, p in pairs(positions) do
 | 
					 | 
				
			||||||
		water_flow = water_flow + get_water_flow(p)
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	eu_supply = math.min(40 * water_flow, max_output)
 | 
					 | 
				
			||||||
	production_level = math.floor(100 * eu_supply / max_output)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	meta:set_int("MV_EU_supply", eu_supply)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	meta:set_string("infotext",
 | 
					 | 
				
			||||||
	S("Hydro %s Generator"):format("MV").." ("..production_level.."%)")
 | 
					 | 
				
			||||||
	if production_level > 0 and
 | 
					 | 
				
			||||||
		minetest.get_node(pos).name == "technic:hydro_turbine" then
 | 
					 | 
				
			||||||
		technic.swap_node(pos, "technic:hydro_turbine_active")
 | 
					 | 
				
			||||||
		meta:set_int("MV_EU_supply", 0)
 | 
					 | 
				
			||||||
		return
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	if production_level == 0 then
 | 
					 | 
				
			||||||
		technic.swap_node(pos, "technic:hydro_turbine")
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
minetest.register_node("technic:hydro_turbine", {
 | 
					 | 
				
			||||||
	description = S("Hydro %s Generator"):format("MV"),
 | 
					 | 
				
			||||||
	tiles = {
 | 
					 | 
				
			||||||
		"technic_hydro_turbine_top.png",
 | 
					 | 
				
			||||||
		"technic_machine_bottom.png"..cable_entry,
 | 
					 | 
				
			||||||
		"technic_hydro_turbine_side.png",
 | 
					 | 
				
			||||||
		"technic_hydro_turbine_side.png",
 | 
					 | 
				
			||||||
		"technic_hydro_turbine_side.png",
 | 
					 | 
				
			||||||
		"technic_hydro_turbine_side.png"
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	paramtype2 = "facedir",
 | 
					 | 
				
			||||||
	groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
 | 
					 | 
				
			||||||
	technic_machine=1, technic_mv=1},
 | 
					 | 
				
			||||||
	legacy_facedir_simple = true,
 | 
					 | 
				
			||||||
	sounds = default.node_sound_wood_defaults(),
 | 
					 | 
				
			||||||
	on_construct = function(pos)
 | 
					 | 
				
			||||||
		local meta = minetest.get_meta(pos)
 | 
					 | 
				
			||||||
		meta:set_string("infotext", S("Hydro %s Generator"):format("MV"))
 | 
					 | 
				
			||||||
		meta:set_int("MV_EU_supply", 0)
 | 
					 | 
				
			||||||
	end,
 | 
					 | 
				
			||||||
	technic_run = run,
 | 
					 | 
				
			||||||
})
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
minetest.register_node("technic:hydro_turbine_active", {
 | 
					 | 
				
			||||||
	description = S("Hydro %s Generator"):format("MV"),
 | 
					 | 
				
			||||||
	tiles = {"technic_hydro_turbine_top_active.png", "technic_machine_bottom.png",
 | 
					 | 
				
			||||||
			"technic_hydro_turbine_side.png", "technic_hydro_turbine_side.png",
 | 
					 | 
				
			||||||
			"technic_hydro_turbine_side.png", "technic_hydro_turbine_side.png"},
 | 
					 | 
				
			||||||
	paramtype2 = "facedir",
 | 
					 | 
				
			||||||
	groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
 | 
					 | 
				
			||||||
			technic_machine=1, technic_mv=1, not_in_creative_inventory=1},
 | 
					 | 
				
			||||||
	legacy_facedir_simple = true,
 | 
					 | 
				
			||||||
	sounds = default.node_sound_wood_defaults(),
 | 
					 | 
				
			||||||
	drop = "technic:hydro_turbine",
 | 
					 | 
				
			||||||
	technic_run = run,
 | 
					 | 
				
			||||||
	technic_disabled_machine_name = "technic:hydro_turbine",
 | 
					 | 
				
			||||||
})
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
technic.register_machine("MV", "technic:hydro_turbine",        technic.producer)
 | 
					 | 
				
			||||||
technic.register_machine("MV", "technic:hydro_turbine_active", technic.producer)
 | 
					 | 
				
			||||||
@@ -13,7 +13,6 @@ if technic.config:get_bool("enable_wind_mill") then
 | 
				
			|||||||
end
 | 
					end
 | 
				
			||||||
dofile(path.."/generator.lua")
 | 
					dofile(path.."/generator.lua")
 | 
				
			||||||
dofile(path.."/solar_array.lua")
 | 
					dofile(path.."/solar_array.lua")
 | 
				
			||||||
dofile(path.."/hydro_turbine.lua")
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- Machines
 | 
					-- Machines
 | 
				
			||||||
dofile(path.."/alloy_furnace.lua")
 | 
					dofile(path.."/alloy_furnace.lua")
 | 
				
			||||||
@@ -21,12 +20,9 @@ dofile(path.."/electric_furnace.lua")
 | 
				
			|||||||
dofile(path.."/grinder.lua")
 | 
					dofile(path.."/grinder.lua")
 | 
				
			||||||
dofile(path.."/extractor.lua")
 | 
					dofile(path.."/extractor.lua")
 | 
				
			||||||
dofile(path.."/compressor.lua")
 | 
					dofile(path.."/compressor.lua")
 | 
				
			||||||
dofile(path.."/centrifuge.lua")
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
dofile(path.."/tool_workshop.lua")
 | 
					dofile(path.."/tool_workshop.lua")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
dofile(path.."/freezer.lua")
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- The power radiator supplies appliances with inductive coupled power:
 | 
					-- The power radiator supplies appliances with inductive coupled power:
 | 
				
			||||||
-- Lighting and associated textures is taken directly from VanessaE's homedecor and made electric.
 | 
					-- Lighting and associated textures is taken directly from VanessaE's homedecor and made electric.
 | 
				
			||||||
-- This is currently useless, slow, and mostly copied
 | 
					-- This is currently useless, slow, and mostly copied
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -14,7 +14,20 @@ end
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
function technic_homedecor_node_is_owned(pos, placer)
 | 
					function technic_homedecor_node_is_owned(pos, placer)
 | 
				
			||||||
        local ownername = false
 | 
					        local ownername = false
 | 
				
			||||||
        if type(isprotect) == "function" then -- glomie's protection mod
 | 
					        if type(IsPlayerNodeOwner) == "function" then -- node_ownership mod
 | 
				
			||||||
 | 
					                if HasOwner(pos, placer) then
 | 
				
			||||||
 | 
					                        if not IsPlayerNodeOwner(pos, placer:get_player_name()) then
 | 
				
			||||||
 | 
					                                if type(getLastOwner) == "function" then -- ...is an old version
 | 
				
			||||||
 | 
					                                        ownername = getLastOwner(pos)
 | 
				
			||||||
 | 
					                                elseif type(GetNodeOwnerName) == "function" then -- ...is a recent version
 | 
				
			||||||
 | 
					                                        ownername = GetNodeOwnerName(pos)
 | 
				
			||||||
 | 
					                                else
 | 
				
			||||||
 | 
					                                        ownername = S("someone")
 | 
				
			||||||
 | 
					                                end
 | 
				
			||||||
 | 
					                        end
 | 
				
			||||||
 | 
					                end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        elseif type(isprotect) == "function" then -- glomie's protection mod
 | 
				
			||||||
                if not isprotect(5, pos, placer) then
 | 
					                if not isprotect(5, pos, placer) then
 | 
				
			||||||
                        ownername = S("someone")
 | 
					                        ownername = S("someone")
 | 
				
			||||||
                end
 | 
					                end
 | 
				
			||||||
@@ -32,6 +45,7 @@ function technic_homedecor_node_is_owned(pos, placer)
 | 
				
			|||||||
        end
 | 
					        end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local dirs1 = {20, 23, 22, 21}
 | 
				
			||||||
local dirs2 = {9,  18,  7, 12}
 | 
					local dirs2 = {9,  18,  7, 12}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local technic_homedecor_rotate_and_place = function(itemstack, placer, pointed_thing)
 | 
					local technic_homedecor_rotate_and_place = function(itemstack, placer, pointed_thing)
 | 
				
			||||||
@@ -44,6 +58,7 @@ local technic_homedecor_rotate_and_place = function(itemstack, placer, pointed_t
 | 
				
			|||||||
			local under = pointed_thing.under
 | 
								local under = pointed_thing.under
 | 
				
			||||||
			local pitch = placer:get_look_pitch()
 | 
								local pitch = placer:get_look_pitch()
 | 
				
			||||||
			local pname = minetest.get_node(under).name
 | 
								local pname = minetest.get_node(under).name
 | 
				
			||||||
 | 
								local node = minetest.get_node(above)
 | 
				
			||||||
			local fdir = minetest.dir_to_facedir(placer:get_look_dir())
 | 
								local fdir = minetest.dir_to_facedir(placer:get_look_dir())
 | 
				
			||||||
			local wield_name = itemstack:get_name()
 | 
								local wield_name = itemstack:get_name()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -144,7 +159,7 @@ minetest.register_node('technic:homedecor_glowlight_half_yellow_active', {
 | 
				
			|||||||
	paramtype = "light",
 | 
						paramtype = "light",
 | 
				
			||||||
	paramtype2 = "facedir",
 | 
						paramtype2 = "facedir",
 | 
				
			||||||
	walkable = true,
 | 
						walkable = true,
 | 
				
			||||||
	light_source = minetest.LIGHT_MAX,
 | 
						light_source = LIGHT_MAX,
 | 
				
			||||||
	sounds = default.node_sound_wood_defaults(),
 | 
						sounds = default.node_sound_wood_defaults(),
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	groups = { snappy = 3, not_in_creative_inventory=1},
 | 
						groups = { snappy = 3, not_in_creative_inventory=1},
 | 
				
			||||||
@@ -225,7 +240,7 @@ minetest.register_node('technic:homedecor_glowlight_quarter_yellow_active', {
 | 
				
			|||||||
	paramtype = "light",
 | 
						paramtype = "light",
 | 
				
			||||||
	paramtype2 = "facedir",
 | 
						paramtype2 = "facedir",
 | 
				
			||||||
	walkable = true,
 | 
						walkable = true,
 | 
				
			||||||
	light_source = minetest.LIGHT_MAX-1,
 | 
						light_source = LIGHT_MAX-1,
 | 
				
			||||||
	sounds = default.node_sound_wood_defaults(),
 | 
						sounds = default.node_sound_wood_defaults(),
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	groups = { snappy = 3, not_in_creative_inventory=1},
 | 
						groups = { snappy = 3, not_in_creative_inventory=1},
 | 
				
			||||||
@@ -307,7 +322,7 @@ minetest.register_node('technic:homedecor_glowlight_half_white_active', {
 | 
				
			|||||||
	paramtype = "light",
 | 
						paramtype = "light",
 | 
				
			||||||
	paramtype2 = "facedir",
 | 
						paramtype2 = "facedir",
 | 
				
			||||||
	walkable = true,
 | 
						walkable = true,
 | 
				
			||||||
	light_source = minetest.LIGHT_MAX,
 | 
						light_source = LIGHT_MAX,
 | 
				
			||||||
	sounds = default.node_sound_wood_defaults(),
 | 
						sounds = default.node_sound_wood_defaults(),
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	groups = { snappy = 3, not_in_creative_inventory=1},
 | 
						groups = { snappy = 3, not_in_creative_inventory=1},
 | 
				
			||||||
@@ -388,7 +403,7 @@ minetest.register_node('technic:homedecor_glowlight_quarter_white_active', {
 | 
				
			|||||||
	paramtype = "light",
 | 
						paramtype = "light",
 | 
				
			||||||
	paramtype2 = "facedir",
 | 
						paramtype2 = "facedir",
 | 
				
			||||||
	walkable = true,
 | 
						walkable = true,
 | 
				
			||||||
	light_source = minetest.LIGHT_MAX-1,
 | 
						light_source = LIGHT_MAX-1,
 | 
				
			||||||
	sounds = default.node_sound_wood_defaults(),
 | 
						sounds = default.node_sound_wood_defaults(),
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	groups = { snappy = 3, not_in_creative_inventory=1},
 | 
						groups = { snappy = 3, not_in_creative_inventory=1},
 | 
				
			||||||
@@ -469,7 +484,7 @@ minetest.register_node('technic:homedecor_glowlight_small_cube_yellow_active', {
 | 
				
			|||||||
	paramtype = "light",
 | 
						paramtype = "light",
 | 
				
			||||||
	paramtype2 = "facedir",
 | 
						paramtype2 = "facedir",
 | 
				
			||||||
	walkable = true,
 | 
						walkable = true,
 | 
				
			||||||
	light_source = minetest.LIGHT_MAX-1,
 | 
						light_source = LIGHT_MAX-1,
 | 
				
			||||||
	sounds = default.node_sound_wood_defaults(),
 | 
						sounds = default.node_sound_wood_defaults(),
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	groups = { snappy = 3, not_in_creative_inventory=1},
 | 
						groups = { snappy = 3, not_in_creative_inventory=1},
 | 
				
			||||||
@@ -550,7 +565,7 @@ minetest.register_node('technic:homedecor_glowlight_small_cube_white_active', {
 | 
				
			|||||||
	paramtype = "light",
 | 
						paramtype = "light",
 | 
				
			||||||
	paramtype2 = "facedir",
 | 
						paramtype2 = "facedir",
 | 
				
			||||||
	walkable = true,
 | 
						walkable = true,
 | 
				
			||||||
	light_source = minetest.LIGHT_MAX-1,
 | 
						light_source = LIGHT_MAX-1,
 | 
				
			||||||
	sounds = default.node_sound_wood_defaults(),
 | 
						sounds = default.node_sound_wood_defaults(),
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	groups = { snappy = 3, not_in_creative_inventory=1},
 | 
						groups = { snappy = 3, not_in_creative_inventory=1},
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -12,16 +12,6 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
local power_radius = 12
 | 
					local power_radius = 12
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
minetest.register_craft({
 | 
					 | 
				
			||||||
	output = 'technic:power_radiator 1',
 | 
					 | 
				
			||||||
	recipe = {
 | 
					 | 
				
			||||||
		{'technic:stainless_steel_ingot', 'technic:mv_transformer', 'technic:stainless_steel_ingot'},
 | 
					 | 
				
			||||||
		{'technic:copper_coil',           'technic:machine_casing', 'technic:copper_coil'},
 | 
					 | 
				
			||||||
		{'technic:rubber',                'technic:mv_cable',       'technic:rubber'},
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
})
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
------------------------------------------------------------------
 | 
					------------------------------------------------------------------
 | 
				
			||||||
-- API for inductive powered nodes:
 | 
					-- API for inductive powered nodes:
 | 
				
			||||||
-- Use the functions below to set the corresponding callbacks
 | 
					-- Use the functions below to set the corresponding callbacks
 | 
				
			||||||
@@ -36,8 +26,7 @@ technic.register_inductive_machine = function(name)
 | 
				
			|||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- Appliances:
 | 
					-- Appliances:
 | 
				
			||||||
--  has_supply: pos of supply node if the appliance has a power radiator near
 | 
					--  has_supply: pos of supply node if the appliance has a power radiator near with sufficient power for the demand else ""
 | 
				
			||||||
--              with sufficient power for the demand else ""
 | 
					 | 
				
			||||||
--  EU_demand: The power demand of the device.
 | 
					--  EU_demand: The power demand of the device.
 | 
				
			||||||
--  EU_charge: Actual use. set to EU_demand if active==1
 | 
					--  EU_charge: Actual use. set to EU_demand if active==1
 | 
				
			||||||
--  active: set to 1 if the device is on
 | 
					--  active: set to 1 if the device is on
 | 
				
			||||||
@@ -146,13 +135,21 @@ minetest.register_node("technic:power_radiator", {
 | 
				
			|||||||
	end
 | 
						end
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					minetest.register_craft({
 | 
				
			||||||
 | 
						output = 'technic:power_radiator 1',
 | 
				
			||||||
 | 
						recipe = {
 | 
				
			||||||
 | 
							{'technic:stainless_steel_ingot', 'technic:mv_transformer', 'technic:stainless_steel_ingot'},
 | 
				
			||||||
 | 
							{'technic:copper_coil',           'technic:machine_casing', 'technic:copper_coil'},
 | 
				
			||||||
 | 
							{'technic:rubber',                'technic:mv_cable0',      'technic:rubber'},
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
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,
 | 
				
			||||||
	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)
 | 
							local meta             = minetest.env:get_meta(pos)
 | 
				
			||||||
		local eu_input  = meta:get_int("MV_EU_input")
 | 
							local eu_input  = meta:get_int("MV_EU_input")
 | 
				
			||||||
		local eu_demand = meta:get_int("MV_EU_demand")
 | 
							local eu_demand = meta:get_int("MV_EU_demand")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -178,6 +175,8 @@ minetest.register_abm({
 | 
				
			|||||||
			-- The supply radius
 | 
								-- The supply radius
 | 
				
			||||||
			local rad = power_radius
 | 
								local rad = power_radius
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								local meta1            = nil
 | 
				
			||||||
 | 
								local pos1             = {}
 | 
				
			||||||
			local used_charge      = 0
 | 
								local used_charge      = 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			-- Index all nodes within supply range
 | 
								-- Index all nodes within supply range
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,7 +4,7 @@ minetest.register_craft({
 | 
				
			|||||||
	recipe = {
 | 
						recipe = {
 | 
				
			||||||
		{'technic:solar_array_lv',     'technic:solar_array_lv', 'technic:solar_array_lv'},
 | 
							{'technic:solar_array_lv',     'technic:solar_array_lv', 'technic:solar_array_lv'},
 | 
				
			||||||
		{'technic:carbon_steel_ingot', 'technic:mv_transformer', 'technic:carbon_steel_ingot'},
 | 
							{'technic:carbon_steel_ingot', 'technic:mv_transformer', 'technic:carbon_steel_ingot'},
 | 
				
			||||||
		{'',                           'technic:mv_cable',       ''},
 | 
							{'',                           'technic:mv_cable0',      ''},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,49 +5,60 @@ 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 = {
 | 
				
			||||||
		{'group:wood',    'default:diamond',        'group:wood'},
 | 
							{'group:wood',    'default:diamond',        'group:wood'},
 | 
				
			||||||
		{'mesecons_pistons:piston_sticky_off', 'technic:machine_casing', 'technic:carbon_cloth'},
 | 
							{'group:wood',    'technic:machine_casing', 'group:wood'},
 | 
				
			||||||
		{'default:obsidian',                   'technic:mv_cable',       'default:obsidian'},
 | 
							{'default:stone', 'technic:mv_cable0',      'default:stone'},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local workshop_demand = {5000, 3500, 2000}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
local workshop_formspec =
 | 
					local workshop_formspec =
 | 
				
			||||||
	"size[8,9;]"..
 | 
						"invsize[8,9;]"..
 | 
				
			||||||
	"list[current_name;src;3,1;1,1;]"..
 | 
						"list[current_name;src;3,1;1,1;]"..
 | 
				
			||||||
	"label[0,0;"..S("%s Tool Workshop"):format("MV").."]"..
 | 
						"label[0,0;"..S("%s Tool Workshop"):format("MV").."]"..
 | 
				
			||||||
	"list[current_name;upgrade1;1,3;1,1;]"..
 | 
						"list[current_player;main;0,5;8,4;]"
 | 
				
			||||||
	"list[current_name;upgrade2;2,3;1,1;]"..
 | 
					 | 
				
			||||||
	"label[1,4;"..S("Upgrade Slots").."]"..
 | 
					 | 
				
			||||||
	"list[current_player;main;0,5;8,4;]"..
 | 
					 | 
				
			||||||
	"listring[current_player;main]"..
 | 
					 | 
				
			||||||
	"listring[current_name;src]"..
 | 
					 | 
				
			||||||
	"listring[current_player;main]"..
 | 
					 | 
				
			||||||
	"listring[current_name;upgrade1]"..
 | 
					 | 
				
			||||||
	"listring[current_player;main]"..
 | 
					 | 
				
			||||||
	"listring[current_name;upgrade2]"..
 | 
					 | 
				
			||||||
	"listring[current_player;main]"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
local run = function(pos, node)
 | 
					minetest.register_node("technic:tool_workshop", {
 | 
				
			||||||
 | 
						description = S("%s Tool Workshop"):format("MV"),
 | 
				
			||||||
 | 
						tiles = {"technic_workshop_top.png", "technic_machine_bottom.png", "technic_workshop_side.png",
 | 
				
			||||||
 | 
						         "technic_workshop_side.png", "technic_workshop_side.png", "technic_workshop_side.png"},
 | 
				
			||||||
 | 
						groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
 | 
				
			||||||
 | 
						sounds = default.node_sound_wood_defaults(),
 | 
				
			||||||
 | 
						on_construct = function(pos)
 | 
				
			||||||
 | 
							local meta = minetest.get_meta(pos)
 | 
				
			||||||
 | 
							meta:set_string("infotext", S("%s Tool Workshop"):format("MV"))
 | 
				
			||||||
 | 
							meta:set_string("formspec", workshop_formspec)
 | 
				
			||||||
 | 
							local inv = meta:get_inventory()
 | 
				
			||||||
 | 
							inv:set_size("src", 1)
 | 
				
			||||||
 | 
						end,	
 | 
				
			||||||
 | 
						can_dig = technic.machine_can_dig,
 | 
				
			||||||
 | 
						allow_metadata_inventory_put = technic.machine_inventory_put,
 | 
				
			||||||
 | 
						allow_metadata_inventory_take = technic.machine_inventory_take,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					minetest.register_abm({
 | 
				
			||||||
 | 
						nodenames = {"technic:tool_workshop"},
 | 
				
			||||||
 | 
						interval = 1,
 | 
				
			||||||
 | 
						chance   = 1,
 | 
				
			||||||
 | 
						action = function(pos, node, active_object_count, active_object_count_wider)
 | 
				
			||||||
		local meta         = minetest.get_meta(pos)
 | 
							local meta         = minetest.get_meta(pos)
 | 
				
			||||||
		local inv          = meta:get_inventory()
 | 
							local inv          = meta:get_inventory()
 | 
				
			||||||
		local eu_input     = meta:get_int("MV_EU_input")
 | 
							local eu_input     = meta:get_int("MV_EU_input")
 | 
				
			||||||
		local machine_name = S("%s Tool Workshop"):format("MV")
 | 
							local machine_name = S("%s Tool Workshop"):format("MV")
 | 
				
			||||||
 | 
							local machine_node = "technic:tool_workshop"
 | 
				
			||||||
 | 
							local demand       = 5000
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		-- Setup meta data if it does not exist.
 | 
							-- Setup meta data if it does not exist.
 | 
				
			||||||
		if not eu_input then
 | 
							if not eu_input then
 | 
				
			||||||
		meta:set_int("MV_EU_demand", workshop_demand[1])
 | 
								meta:set_int("MV_EU_demand", demand)
 | 
				
			||||||
			meta:set_int("MV_EU_input", 0)
 | 
								meta:set_int("MV_EU_input", 0)
 | 
				
			||||||
			return
 | 
								return
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	local EU_upgrade, tube_upgrade = technic.handle_machine_upgrades(meta)
 | 
							-- Power off automatically if no longer connected to a switching station
 | 
				
			||||||
 | 
							technic.switching_station_timeout_count(pos, "MV")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		local repairable = false
 | 
							local repairable = false
 | 
				
			||||||
		local srcstack = inv:get_stack("src", 1)
 | 
							local srcstack = inv:get_stack("src", 1)
 | 
				
			||||||
@@ -60,66 +71,21 @@ local run = function(pos, node)
 | 
				
			|||||||
				repairable = true
 | 
									repairable = true
 | 
				
			||||||
			end
 | 
								end
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
	technic.handle_machine_pipeworks(pos, tube_upgrade, function (pos, x_velocity, z_velocity)
 | 
					 | 
				
			||||||
		if not repairable then
 | 
					 | 
				
			||||||
			technic.send_items(pos, x_velocity, z_velocity, "src")
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	end)
 | 
					 | 
				
			||||||
		if not repairable then
 | 
							if not repairable then
 | 
				
			||||||
			meta:set_string("infotext", S("%s Idle"):format(machine_name))
 | 
								meta:set_string("infotext", S("%s Idle"):format(machine_name))
 | 
				
			||||||
			meta:set_int("MV_EU_demand", 0)
 | 
								meta:set_int("MV_EU_demand", 0)
 | 
				
			||||||
			return
 | 
								return
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
	if eu_input < workshop_demand[EU_upgrade+1] then
 | 
							if eu_input < demand then
 | 
				
			||||||
			meta:set_string("infotext", S("%s Unpowered"):format(machine_name))
 | 
								meta:set_string("infotext", S("%s Unpowered"):format(machine_name))
 | 
				
			||||||
	elseif eu_input >= workshop_demand[EU_upgrade+1] then
 | 
							elseif eu_input >= demand then
 | 
				
			||||||
			meta:set_string("infotext", S("%s Active"):format(machine_name))
 | 
								meta:set_string("infotext", S("%s Active"):format(machine_name))
 | 
				
			||||||
			srcstack:add_wear(-1000)
 | 
								srcstack:add_wear(-1000)
 | 
				
			||||||
			inv:set_stack("src", 1, srcstack)
 | 
								inv:set_stack("src", 1, srcstack)
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
	meta:set_int("MV_EU_demand", workshop_demand[EU_upgrade+1])
 | 
							meta:set_int("MV_EU_demand", demand)
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
 | 
					 | 
				
			||||||
minetest.register_node("technic:tool_workshop", {
 | 
					 | 
				
			||||||
	description = S("%s Tool Workshop"):format("MV"),
 | 
					 | 
				
			||||||
	paramtype2 = "facedir",
 | 
					 | 
				
			||||||
	tiles = {
 | 
					 | 
				
			||||||
		"technic_workshop_top.png"..tube_entry,
 | 
					 | 
				
			||||||
		"technic_machine_bottom.png"..tube_entry,
 | 
					 | 
				
			||||||
		"technic_workshop_side.png"..tube_entry,
 | 
					 | 
				
			||||||
		"technic_workshop_side.png"..tube_entry,
 | 
					 | 
				
			||||||
		"technic_workshop_side.png"..tube_entry,
 | 
					 | 
				
			||||||
		"technic_workshop_side.png"
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
 | 
					 | 
				
			||||||
		technic_machine=1, technic_mv=1, tubedevice=1, tubedevice_receiver=1},
 | 
					 | 
				
			||||||
	connect_sides = {"bottom", "back", "left", "right"},
 | 
					 | 
				
			||||||
	sounds = default.node_sound_wood_defaults(),
 | 
					 | 
				
			||||||
	on_construct = function(pos)
 | 
					 | 
				
			||||||
		local meta = minetest.get_meta(pos)
 | 
					 | 
				
			||||||
		meta:set_string("infotext", S("%s Tool Workshop"):format("MV"))
 | 
					 | 
				
			||||||
		meta:set_string("formspec", workshop_formspec)
 | 
					 | 
				
			||||||
		local inv = meta:get_inventory()
 | 
					 | 
				
			||||||
		inv:set_size("src", 1)
 | 
					 | 
				
			||||||
		inv:set_size("upgrade1", 1)
 | 
					 | 
				
			||||||
		inv:set_size("upgrade2", 1)
 | 
					 | 
				
			||||||
	end,
 | 
					 | 
				
			||||||
	can_dig = technic.machine_can_dig,
 | 
					 | 
				
			||||||
	allow_metadata_inventory_put = technic.machine_inventory_put,
 | 
					 | 
				
			||||||
	allow_metadata_inventory_take = technic.machine_inventory_take,
 | 
					 | 
				
			||||||
	tube = {
 | 
					 | 
				
			||||||
		can_insert = function (pos, node, stack, direction)
 | 
					 | 
				
			||||||
			return minetest.get_meta(pos):get_inventory():room_for_item("src", stack)
 | 
					 | 
				
			||||||
		end,
 | 
					 | 
				
			||||||
		insert_object = function (pos, node, stack, direction)
 | 
					 | 
				
			||||||
			return minetest.get_meta(pos):get_inventory():add_item("src", stack)
 | 
					 | 
				
			||||||
		end,
 | 
					 | 
				
			||||||
		connect_sides = {left = 1, right = 1, back = 1, top = 1, bottom = 1},
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	technic_run = run,
 | 
					 | 
				
			||||||
	after_place_node = pipeworks.after_place,
 | 
					 | 
				
			||||||
	after_dig_node = technic.machine_after_dig_node
 | 
					 | 
				
			||||||
}) 
 | 
					}) 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
technic.register_machine("MV", "technic:tool_workshop", technic.receiver)
 | 
					technic.register_machine("MV", "technic:tool_workshop", technic.receiver)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -13,9 +13,9 @@ minetest.register_craft({
 | 
				
			|||||||
minetest.register_craft({
 | 
					minetest.register_craft({
 | 
				
			||||||
	output = 'technic:wind_mill',
 | 
						output = 'technic:wind_mill',
 | 
				
			||||||
	recipe = {
 | 
						recipe = {
 | 
				
			||||||
		{'',                           'basic_materials:motor',              ''},
 | 
							{'',                           'technic:motor',              ''},
 | 
				
			||||||
		{'technic:carbon_steel_ingot', 'technic:carbon_steel_block', 'technic:carbon_steel_ingot'},
 | 
							{'technic:carbon_steel_ingot', 'technic:carbon_steel_block', 'technic:carbon_steel_ingot'},
 | 
				
			||||||
		{'',                           'technic:mv_cable',           ''},
 | 
							{'',                           'technic:mv_cable0',          ''},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -29,49 +29,11 @@ minetest.register_node("technic:wind_mill_frame", {
 | 
				
			|||||||
	paramtype = "light",
 | 
						paramtype = "light",
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local function check_wind_mill(pos)
 | 
					 | 
				
			||||||
	if pos.y < 30 then
 | 
					 | 
				
			||||||
		return false
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	pos = {x=pos.x, y=pos.y, z=pos.z}
 | 
					 | 
				
			||||||
	for i = 1, 20 do
 | 
					 | 
				
			||||||
		pos.y = pos.y - 1
 | 
					 | 
				
			||||||
		local node = minetest.get_node_or_nil(pos)
 | 
					 | 
				
			||||||
		if not node then
 | 
					 | 
				
			||||||
			-- we reached CONTENT_IGNORE, we can assume, that nothing changed
 | 
					 | 
				
			||||||
			-- as the user will have to load the block to change it
 | 
					 | 
				
			||||||
			return
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		if node.name ~= "technic:wind_mill_frame" then
 | 
					 | 
				
			||||||
			return false
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	return true
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
local run = function(pos, node)
 | 
					 | 
				
			||||||
	local meta = minetest.get_meta(pos)
 | 
					 | 
				
			||||||
	local machine_name = S("Wind %s Generator"):format("MV")
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	local check = check_wind_mill(pos)
 | 
					 | 
				
			||||||
	if check == false then
 | 
					 | 
				
			||||||
		meta:set_int("MV_EU_supply", 0)
 | 
					 | 
				
			||||||
		meta:set_string("infotext", S("%s Improperly Placed"):format(machine_name))
 | 
					 | 
				
			||||||
	elseif check == true then
 | 
					 | 
				
			||||||
		local power = math.min(pos.y * 100, 5000)
 | 
					 | 
				
			||||||
		meta:set_int("MV_EU_supply", power)
 | 
					 | 
				
			||||||
		meta:set_string("infotext", S("@1 (@2)", machine_name,
 | 
					 | 
				
			||||||
			technic.EU_string(power)))
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	-- check == nil: assume nothing has changed
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
minetest.register_node("technic:wind_mill", {
 | 
					minetest.register_node("technic:wind_mill", {
 | 
				
			||||||
	description = S("Wind %s Generator"):format("MV"),
 | 
						description = S("Wind %s Generator"):format("MV"),
 | 
				
			||||||
	tiles = {"technic_carbon_steel_block.png"},
 | 
						tiles = {"technic_carbon_steel_block.png"},
 | 
				
			||||||
	paramtype2 = "facedir",
 | 
						paramtype2 = "facedir",
 | 
				
			||||||
	groups = {cracky=1, technic_machine=1, technic_mv=1},
 | 
						groups = {cracky=1},
 | 
				
			||||||
	connect_sides = {"top", "bottom", "back", "left", "right"},
 | 
					 | 
				
			||||||
	sounds = default.node_sound_stone_defaults(),
 | 
						sounds = default.node_sound_stone_defaults(),
 | 
				
			||||||
	drawtype = "nodebox",
 | 
						drawtype = "nodebox",
 | 
				
			||||||
	paramtype = "light",
 | 
						paramtype = "light",
 | 
				
			||||||
@@ -89,7 +51,40 @@ minetest.register_node("technic:wind_mill", {
 | 
				
			|||||||
		meta:set_string("infotext", S("Wind %s Generator"):format("MV"))
 | 
							meta:set_string("infotext", S("Wind %s Generator"):format("MV"))
 | 
				
			||||||
		meta:set_int("MV_EU_supply", 0)
 | 
							meta:set_int("MV_EU_supply", 0)
 | 
				
			||||||
	end,	
 | 
						end,	
 | 
				
			||||||
	technic_run = run,
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local function check_wind_mill(pos)
 | 
				
			||||||
 | 
						if pos.y < 30 then
 | 
				
			||||||
 | 
							return false
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						for i = 1, 20 do
 | 
				
			||||||
 | 
							local node = minetest.get_node({x=pos.x, y=pos.y-i, z=pos.z})
 | 
				
			||||||
 | 
							if node.name ~= "technic:wind_mill_frame" then
 | 
				
			||||||
 | 
								return false
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						return true
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					minetest.register_abm({
 | 
				
			||||||
 | 
						nodenames = {"technic:wind_mill"},
 | 
				
			||||||
 | 
						interval = 1,
 | 
				
			||||||
 | 
						chance   = 1,
 | 
				
			||||||
 | 
						action = function(pos, node, active_object_count, active_object_count_wider)
 | 
				
			||||||
 | 
							local meta = minetest.get_meta(pos)
 | 
				
			||||||
 | 
							local machine_name = S("Wind %s Generator"):format("MV")
 | 
				
			||||||
 | 
							local power = math.min(pos.y * 100, 5000)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if not check_wind_mill(pos) then
 | 
				
			||||||
 | 
								meta:set_int("MV_EU_supply", 0)
 | 
				
			||||||
 | 
								meta:set_string("infotext", S("%s Improperly Placed"):format(machine_name))
 | 
				
			||||||
 | 
								return
 | 
				
			||||||
 | 
							else
 | 
				
			||||||
 | 
								meta:set_int("MV_EU_supply", power)
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							meta:set_string("infotext", machine_name.." ("..power.."EU)")
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
technic.register_machine("MV", "technic:wind_mill", technic.producer)
 | 
					technic.register_machine("MV", "technic:wind_mill", technic.producer)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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")
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,117 +0,0 @@
 | 
				
			|||||||
local S = technic.getter
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
local desc = S("Administrative World Anchor")
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
local function compute_forceload_positions(pos, meta)
 | 
					 | 
				
			||||||
	local radius = meta:get_int("radius")
 | 
					 | 
				
			||||||
	local minpos = vector.subtract(pos, vector.new(radius, radius, radius))
 | 
					 | 
				
			||||||
	local maxpos = vector.add(pos, vector.new(radius, radius, radius))
 | 
					 | 
				
			||||||
	local minbpos = {}
 | 
					 | 
				
			||||||
	local maxbpos = {}
 | 
					 | 
				
			||||||
	for _, coord in ipairs({"x","y","z"}) do
 | 
					 | 
				
			||||||
		minbpos[coord] = math.floor(minpos[coord] / 16) * 16
 | 
					 | 
				
			||||||
		maxbpos[coord] = math.floor(maxpos[coord] / 16) * 16
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	local flposes = {}
 | 
					 | 
				
			||||||
	for x = minbpos.x, maxbpos.x, 16 do
 | 
					 | 
				
			||||||
		for y = minbpos.y, maxbpos.y, 16 do
 | 
					 | 
				
			||||||
			for z = minbpos.z, maxbpos.z, 16 do
 | 
					 | 
				
			||||||
				table.insert(flposes, vector.new(x, y, z))
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	return flposes
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
local function currently_forceloaded_positions(meta)
 | 
					 | 
				
			||||||
	local ser = meta:get_string("forceloaded")
 | 
					 | 
				
			||||||
	return ser == "" and {} or minetest.deserialize(ser)
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
local function forceload_off(meta)
 | 
					 | 
				
			||||||
	local flposes = currently_forceloaded_positions(meta)
 | 
					 | 
				
			||||||
	meta:set_string("forceloaded", "")
 | 
					 | 
				
			||||||
	for _, p in ipairs(flposes) do
 | 
					 | 
				
			||||||
		minetest.forceload_free_block(p)
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
local function forceload_on(pos, meta)
 | 
					 | 
				
			||||||
	local want_flposes = compute_forceload_positions(pos, meta)
 | 
					 | 
				
			||||||
	local have_flposes = {}
 | 
					 | 
				
			||||||
	for _, p in ipairs(want_flposes) do
 | 
					 | 
				
			||||||
		if minetest.forceload_block(p) then
 | 
					 | 
				
			||||||
			table.insert(have_flposes, p)
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	meta:set_string("forceloaded", #have_flposes == 0 and "" or minetest.serialize(have_flposes))
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
local function set_display(pos, meta)
 | 
					 | 
				
			||||||
	local ESC = minetest.formspec_escape
 | 
					 | 
				
			||||||
	meta:set_string("infotext", S(meta:get_int("enabled") ~= 0 and "%s Enabled" or "%s Disabled"):format(desc))
 | 
					 | 
				
			||||||
	meta:set_string("formspec",
 | 
					 | 
				
			||||||
		"size[5,3.5]"..
 | 
					 | 
				
			||||||
		"item_image[0,0;1,1;technic:admin_anchor]"..
 | 
					 | 
				
			||||||
		"label[1,0;"..ESC(desc).."]"..
 | 
					 | 
				
			||||||
		"label[0,1;"..ESC(S("Owner:").." "..meta:get_string("owner")).."]"..
 | 
					 | 
				
			||||||
		(meta:get_int("locked") == 0 and
 | 
					 | 
				
			||||||
			"button[3,1;2,1;lock;"..ESC(S("Unlocked")).."]" or
 | 
					 | 
				
			||||||
			"button[3,1;2,1;unlock;"..ESC(S("Locked")).."]")..
 | 
					 | 
				
			||||||
		"field[0.25,2.3;1,1;radius;"..ESC(S("Radius:"))..";"..meta:get_int("radius").."]"..
 | 
					 | 
				
			||||||
		(meta:get_int("enabled") == 0 and
 | 
					 | 
				
			||||||
			"button[3,2;2,1;enable;"..ESC(S("Disabled")).."]" or
 | 
					 | 
				
			||||||
			"button[3,2;2,1;disable;"..ESC(S("Enabled")).."]")..
 | 
					 | 
				
			||||||
		"label[0,3;"..ESC(S("Keeping %d/%d map blocks loaded"):format(
 | 
					 | 
				
			||||||
			#currently_forceloaded_positions(meta), #compute_forceload_positions(pos, meta)
 | 
					 | 
				
			||||||
		)).."]")
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
minetest.register_node("technic:admin_anchor", {
 | 
					 | 
				
			||||||
	description = desc,
 | 
					 | 
				
			||||||
	drawtype = "normal",
 | 
					 | 
				
			||||||
	tiles = {"technic_admin_anchor.png"},
 | 
					 | 
				
			||||||
	is_ground_content = true,
 | 
					 | 
				
			||||||
	groups = {cracky=3, not_in_creative_inventory=1},
 | 
					 | 
				
			||||||
	sounds = default.node_sound_stone_defaults(),
 | 
					 | 
				
			||||||
	after_place_node = function (pos, placer)
 | 
					 | 
				
			||||||
		local meta = minetest.get_meta(pos)
 | 
					 | 
				
			||||||
		if placer and placer:is_player() then
 | 
					 | 
				
			||||||
			meta:set_string("owner", placer:get_player_name())
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		set_display(pos, meta)
 | 
					 | 
				
			||||||
	end,
 | 
					 | 
				
			||||||
	can_dig = function (pos, player)
 | 
					 | 
				
			||||||
		local meta = minetest.get_meta(pos)
 | 
					 | 
				
			||||||
		return meta:get_int("locked") == 0 or
 | 
					 | 
				
			||||||
			(player and player:is_player() and player:get_player_name() == meta:get_string("owner"))
 | 
					 | 
				
			||||||
	end,
 | 
					 | 
				
			||||||
	on_destruct = function (pos)
 | 
					 | 
				
			||||||
		local meta = minetest.get_meta(pos)
 | 
					 | 
				
			||||||
		forceload_off(meta)
 | 
					 | 
				
			||||||
	end,
 | 
					 | 
				
			||||||
	on_receive_fields = function (pos, formname, fields, sender)
 | 
					 | 
				
			||||||
		local meta = minetest.get_meta(pos)
 | 
					 | 
				
			||||||
		if (meta:get_int("locked") ~= 0 or fields.lock) and
 | 
					 | 
				
			||||||
				not (sender and sender:is_player() and
 | 
					 | 
				
			||||||
					sender:get_player_name() == meta:get_string("owner")) then
 | 
					 | 
				
			||||||
			return
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		if fields.unlock then meta:set_int("locked", 0) end
 | 
					 | 
				
			||||||
		if fields.lock then meta:set_int("locked", 1) end
 | 
					 | 
				
			||||||
		if fields.disable or fields.enable or fields.radius then
 | 
					 | 
				
			||||||
			forceload_off(meta)
 | 
					 | 
				
			||||||
			if fields.disable then meta:set_int("enabled", 0) end
 | 
					 | 
				
			||||||
			if fields.enable then meta:set_int("enabled", 1) end
 | 
					 | 
				
			||||||
			if fields.radius
 | 
					 | 
				
			||||||
					and string.find(fields.radius, "^[0-9]+$")
 | 
					 | 
				
			||||||
					and tonumber(fields.radius) < 256 then
 | 
					 | 
				
			||||||
				meta:set_int("radius", fields.radius)
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			if meta:get_int("enabled") ~= 0 then
 | 
					 | 
				
			||||||
				forceload_on(pos, meta)
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		set_display(pos, meta)
 | 
					 | 
				
			||||||
	end,
 | 
					 | 
				
			||||||
})
 | 
					 | 
				
			||||||
@@ -1,68 +1,75 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
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, pos1, node1, node)
 | 
				
			||||||
	if node.param2 > 3 then return end
 | 
						if node1.name == "air" then 
 | 
				
			||||||
	if node.name ~= "air" then
 | 
					 | 
				
			||||||
		if node.name == "ignore" or
 | 
					 | 
				
			||||||
		   node.name == "default:lava_source" or
 | 
					 | 
				
			||||||
		   node.name == "default:lava_flowing" or
 | 
					 | 
				
			||||||
		   node.name == "default:water_source" or
 | 
					 | 
				
			||||||
		   node.name == "default:water_flowing" then
 | 
					 | 
				
			||||||
			return
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		local drops = minetest.get_node_drops(node.name, "")
 | 
					 | 
				
			||||||
		local remove_to = false
 | 
					 | 
				
			||||||
		for i, item in ipairs(drops) do
 | 
					 | 
				
			||||||
			if not inv:room_for_item(slot_name, item) then
 | 
					 | 
				
			||||||
				remove_to = i - 1
 | 
					 | 
				
			||||||
				break
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			inv:add_item(slot_name, item)
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		if remove_to then
 | 
					 | 
				
			||||||
			for i = 1, remove_to do
 | 
					 | 
				
			||||||
				inv:remove_item(slot_name, drops[i])
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		else
 | 
					 | 
				
			||||||
			minetest.remove_node(pos)
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		return
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
		if not inv:is_empty(slot_name) then
 | 
							if not inv:is_empty(slot_name) then
 | 
				
			||||||
		local stack = inv:get_list(slot_name)[1]
 | 
								stack1=inv:get_list(slot_name)
 | 
				
			||||||
		local def = stack:get_definition()
 | 
								local def = stack1[1]:get_definition()
 | 
				
			||||||
			if def.type == "node" then
 | 
								if def.type == "node" then
 | 
				
			||||||
			minetest.set_node(pos, {
 | 
									node_to_be_placed={name=stack1[1]:get_name(), param1=0, param2=node.param2}
 | 
				
			||||||
				name = stack:get_name(),
 | 
									minetest.set_node(pos1,node_to_be_placed)
 | 
				
			||||||
				param2 = machine_node.param2
 | 
									stack1[1]:take_item()
 | 
				
			||||||
			})
 | 
									inv:set_stack(slot_name, 1, stack1[1])
 | 
				
			||||||
			stack:take_item()
 | 
					 | 
				
			||||||
			inv:set_stack(slot_name, 1, stack)
 | 
					 | 
				
			||||||
			elseif def.type == "craft" then
 | 
								elseif def.type == "craft" then
 | 
				
			||||||
				if def.on_place then
 | 
									if def.on_place then
 | 
				
			||||||
				-- Use pcall to avoid nil placer errors.
 | 
										-- print("deploy_node: item has on_place. trying...")
 | 
				
			||||||
				-- TODO: Do without pcall.
 | 
										local ok, stk = pcall(def.on_place, stack1[1], nil, {
 | 
				
			||||||
				local ok, stk = pcall(def.on_place, stack, nil, {
 | 
					 | 
				
			||||||
						-- Fake pointed_thing
 | 
											-- Fake pointed_thing
 | 
				
			||||||
						type = "node",
 | 
											type = "node",
 | 
				
			||||||
					above = pos,
 | 
											above = pos1,
 | 
				
			||||||
					under = {x=pos.x, y=pos.y-1, z=pos.z},
 | 
											under = { x=pos1.x, y=pos1.y-1, z=pos1.z },
 | 
				
			||||||
					})
 | 
										})
 | 
				
			||||||
					if ok then
 | 
										if ok then
 | 
				
			||||||
					inv:set_stack(slot_name, 1, stk or stack)
 | 
											-- print("deploy_node: on_place succeeded!")
 | 
				
			||||||
 | 
											inv:set_stack(slot_name, 1, stk or stack1[1])
 | 
				
			||||||
						return
 | 
											return
 | 
				
			||||||
 | 
										-- else
 | 
				
			||||||
 | 
											-- print("deploy_node: WARNING: error while running on_place: "..tostring(stk))
 | 
				
			||||||
					end
 | 
										end
 | 
				
			||||||
				end
 | 
									end
 | 
				
			||||||
			minetest.item_place_object(stack, nil, {
 | 
									minetest.item_place_object(stack1[1], nil, {
 | 
				
			||||||
					-- Fake pointed_thing
 | 
										-- Fake pointed_thing
 | 
				
			||||||
					type = "node",
 | 
										type = "node",
 | 
				
			||||||
				above = pos,
 | 
										above = pos1,
 | 
				
			||||||
				under = pos,
 | 
										under = pos1,
 | 
				
			||||||
				})
 | 
									})
 | 
				
			||||||
				inv:set_stack(slot_name, 1, nil)
 | 
									inv:set_stack(slot_name, 1, nil)
 | 
				
			||||||
			end
 | 
								end
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
 | 
							return 
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if node1.name == "ignore" or
 | 
				
			||||||
 | 
						   node1.name == "default:lava_source" or
 | 
				
			||||||
 | 
						   node1.name == "default:lava_flowing" or
 | 
				
			||||||
 | 
						   node1.name == "default:water_source" or
 | 
				
			||||||
 | 
						   node1.name == "default:water_flowing" 
 | 
				
			||||||
 | 
						   then return end
 | 
				
			||||||
 | 
						if inv:room_for_item(slot_name,node1) then
 | 
				
			||||||
 | 
							local def = minetest.registered_nodes[node1.name]
 | 
				
			||||||
 | 
							if not def then return end
 | 
				
			||||||
 | 
							local drop = def.drop or node1.name
 | 
				
			||||||
 | 
							if type(drop) == "table" then
 | 
				
			||||||
 | 
								local pr = PseudoRandom(math.random())
 | 
				
			||||||
 | 
								local c = 0
 | 
				
			||||||
 | 
								local loop = 0 -- Prevent infinite loop
 | 
				
			||||||
 | 
								while (c < (drop.max_items or 1)) and (loop < 1000) do
 | 
				
			||||||
 | 
									local i = math.floor(pr:next(1, #drop.items))
 | 
				
			||||||
 | 
									if pr:next(1, drop.items[i].rarity or 1) == 1 then
 | 
				
			||||||
 | 
										for _,item in ipairs(drop.items[i].items) do
 | 
				
			||||||
 | 
											inv:add_item(slot_name,item)
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
										c = c + 1
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									loop = loop + 1
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
								minetest.remove_node(pos1)
 | 
				
			||||||
 | 
							elseif type(drop) == "string" then
 | 
				
			||||||
 | 
								inv:add_item(slot_name,drop)
 | 
				
			||||||
 | 
								minetest.remove_node(pos1)
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
minetest.register_craft({
 | 
					minetest.register_craft({
 | 
				
			||||||
@@ -85,124 +92,273 @@ minetest.register_craft({
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local function make_on(mark, length)
 | 
					local function mk1_on(pos, node)
 | 
				
			||||||
	return function(pos, node)
 | 
					 | 
				
			||||||
	local meta = minetest.get_meta(pos)
 | 
						local meta = minetest.get_meta(pos)
 | 
				
			||||||
		local owner = meta:get_string("owner")
 | 
					 | 
				
			||||||
	local inv = meta:get_inventory()
 | 
						local inv = meta:get_inventory()
 | 
				
			||||||
		local dir = vector.new()
 | 
						local pos1={}
 | 
				
			||||||
		if node.param2 == 3 then dir.x = 1 end
 | 
						pos1.x=pos.x
 | 
				
			||||||
		if node.param2 == 2 then dir.z = 1 end
 | 
						pos1.y=pos.y
 | 
				
			||||||
		if node.param2 == 1 then dir.x = -1 end
 | 
						pos1.z=pos.z
 | 
				
			||||||
		if node.param2 == 0 then dir.z = -1 end
 | 
						if node.param2==3 then pos1.x=pos1.x+1 end
 | 
				
			||||||
 | 
						if node.param2==2 then pos1.z=pos1.z+1 end
 | 
				
			||||||
 | 
						if node.param2==1 then pos1.x=pos1.x-1 end
 | 
				
			||||||
 | 
						if node.param2==0 then pos1.z=pos1.z-1 end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		local place_pos = vector.new(pos)
 | 
						if node.name == "technic:constructor_mk1_off" then
 | 
				
			||||||
 | 
							technic.swap_node(pos,"technic:constructor_mk1_on")
 | 
				
			||||||
		if node.name == "technic:constructor_mk"..mark.."_off" then
 | 
							nodeupdate(pos)
 | 
				
			||||||
			technic.swap_node(pos, "technic:constructor_mk"..mark.."_on")
 | 
							local node1=minetest.get_node(pos1)
 | 
				
			||||||
			minetest.check_for_falling(pos)
 | 
							deploy_node (inv,"slot1",pos1,node1,node)
 | 
				
			||||||
			for i = 1, length do
 | 
					 | 
				
			||||||
				place_pos = vector.add(place_pos, dir)
 | 
					 | 
				
			||||||
				if owner ~= "" and minetest.is_protected(place_pos, owner) then
 | 
					 | 
				
			||||||
					return
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
				local place_node = minetest.get_node(place_pos)
 | 
					 | 
				
			||||||
				deploy_node(inv, "slot"..i, place_pos, place_node, node)
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local function make_off(mark)
 | 
					local function mk1_off(pos, node)
 | 
				
			||||||
	return function(pos, node)
 | 
						if node.name == "technic:constructor_mk1_on" then
 | 
				
			||||||
		if node.name == "technic:constructor_mk"..mark.."_on" then
 | 
							technic.swap_node(pos,"technic:constructor_mk1_off")
 | 
				
			||||||
			technic.swap_node(pos,"technic:constructor_mk"..mark.."_off")
 | 
							nodeupdate(pos)
 | 
				
			||||||
			minetest.check_for_falling(pos)
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local function allow_inventory_put(pos, listname, index, stack, player)
 | 
					 | 
				
			||||||
	if stack and minetest.get_item_group(stack:get_name(), "technic_constructor") == 1 then
 | 
					 | 
				
			||||||
		return 0
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	return technic.machine_inventory_put(pos, listname, index, stack, player)
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
local function make_constructor(mark, length)
 | 
					minetest.register_node("technic:constructor_mk1_off", {
 | 
				
			||||||
	minetest.register_node("technic:constructor_mk"..mark.."_off", {
 | 
						description = S("Constructor Mk%d"):format(1),
 | 
				
			||||||
		description = S("Constructor Mk%d"):format(mark),
 | 
						tile_images = {"technic_constructor_mk1_top_off.png","technic_constructor_mk1_bottom_off.png","technic_constructor_mk1_side2_off.png","technic_constructor_mk1_side1_off.png",
 | 
				
			||||||
		tiles = {"technic_constructor_mk"..mark.."_top_off.png",
 | 
								"technic_constructor_back.png","technic_constructor_front_off.png"},
 | 
				
			||||||
			"technic_constructor_mk"..mark.."_bottom_off.png",
 | 
						is_ground_content = true,
 | 
				
			||||||
			"technic_constructor_mk"..mark.."_side2_off.png",
 | 
					 | 
				
			||||||
			"technic_constructor_mk"..mark.."_side1_off.png",
 | 
					 | 
				
			||||||
			"technic_constructor_back.png",
 | 
					 | 
				
			||||||
			"technic_constructor_front_off.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, mesecon_receptor_off = 1, mesecon_effector_off = 1, mesecon = 2},
 | 
				
			||||||
			mesecon = 2, technic_constructor = 1},
 | 
						mesecons= {effector={action_on=mk1_on}},
 | 
				
			||||||
		mesecons = {effector = {action_on = make_on(mark, length)}},
 | 
					 | 
				
			||||||
	sounds = default.node_sound_stone_defaults(),
 | 
						sounds = default.node_sound_stone_defaults(),
 | 
				
			||||||
	on_construct = function(pos)
 | 
						on_construct = function(pos)
 | 
				
			||||||
	local meta = minetest.get_meta(pos)
 | 
						local meta = minetest.get_meta(pos)
 | 
				
			||||||
			local formspec = "size[8,9;]"..
 | 
						meta:set_string("formspec",
 | 
				
			||||||
				"label[0,0;"..S("Constructor Mk%d"):format(mark).."]"..
 | 
									"invsize[8,9;]"..
 | 
				
			||||||
				"list[current_player;main;0,5;8,4;]"
 | 
									"label[0,0;"..S("Constructor Mk%d"):format(1).."]"..
 | 
				
			||||||
			for i = 1, length do
 | 
									"label[5,0;"..S("Slot %d"):format(1).."]"..
 | 
				
			||||||
				formspec = formspec
 | 
									"list[current_name;slot1;6,0;1,1;]"..
 | 
				
			||||||
					.."label[5,"..(i - 1)..";"..S("Slot %d"):format(i).."]"
 | 
									"list[current_player;main;0,5;8,4;]")
 | 
				
			||||||
					.."list[current_name;slot"..i
 | 
							meta:set_string("infotext", S("Constructor Mk%d"):format(1))
 | 
				
			||||||
						..";6,"..(i - 1)..";1,1;]"
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			meta:set_string("formspec", formspec)
 | 
					 | 
				
			||||||
			meta:set_string("infotext", S("Constructor Mk%d"):format(mark))
 | 
					 | 
				
			||||||
		local inv = meta:get_inventory()
 | 
							local inv = meta:get_inventory()
 | 
				
			||||||
			for i = 1, length do
 | 
							inv:set_size("slot1", 1)
 | 
				
			||||||
				inv:set_size("slot"..i, 1)
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			meta:set_string("owner", "?")
 | 
					 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
		after_place_node = function(pos, placer)
 | 
					
 | 
				
			||||||
 | 
						can_dig = function(pos,player)
 | 
				
			||||||
		local meta = minetest.get_meta(pos)
 | 
							local meta = minetest.get_meta(pos)
 | 
				
			||||||
			meta:set_string("owner", (placer and placer:get_player_name() or "?"))
 | 
							local inv = meta:get_inventory()
 | 
				
			||||||
 | 
							return inv:is_empty("slot1")
 | 
				
			||||||
 | 
						end,	
 | 
				
			||||||
 | 
						allow_metadata_inventory_put = technic.machine_inventory_put,
 | 
				
			||||||
 | 
						allow_metadata_inventory_take = technic.machine_inventory_take,
 | 
				
			||||||
 | 
						allow_metadata_inventory_move = technic.machine_inventory_move,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					minetest.register_node("technic:constructor_mk1_on", {
 | 
				
			||||||
 | 
						description = S("Constructor Mk%d"):format(1),
 | 
				
			||||||
 | 
						tile_images = {"technic_constructor_mk1_top_on.png","technic_constructor_mk1_bottom_on.png","technic_constructor_mk1_side2_on.png","technic_constructor_mk1_side1_on.png",
 | 
				
			||||||
 | 
								"technic_constructor_back.png","technic_constructor_front_on.png"},
 | 
				
			||||||
 | 
						paramtype2 = "facedir",
 | 
				
			||||||
 | 
						drop = "technic:constructor_mk1_off",
 | 
				
			||||||
 | 
						groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,mesecon = 2,not_in_creative_inventory=1},
 | 
				
			||||||
 | 
						mesecons= {effector={action_off=mk1_off}},
 | 
				
			||||||
 | 
						sounds = default.node_sound_stone_defaults(),
 | 
				
			||||||
 | 
						allow_metadata_inventory_put = technic.machine_inventory_put,
 | 
				
			||||||
 | 
						allow_metadata_inventory_take = technic.machine_inventory_take,
 | 
				
			||||||
 | 
						allow_metadata_inventory_move = technic.machine_inventory_move,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--Constructor Mk2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local function mk2_on(pos, node)
 | 
				
			||||||
 | 
						local meta = minetest.get_meta(pos)
 | 
				
			||||||
 | 
						local inv = meta:get_inventory()
 | 
				
			||||||
 | 
						local pos1={}
 | 
				
			||||||
 | 
						local pos2={}
 | 
				
			||||||
 | 
						pos1.x=pos.x
 | 
				
			||||||
 | 
						pos1.y=pos.y
 | 
				
			||||||
 | 
						pos1.z=pos.z
 | 
				
			||||||
 | 
						pos2.x=pos.x
 | 
				
			||||||
 | 
						pos2.y=pos.y
 | 
				
			||||||
 | 
						pos2.z=pos.z
 | 
				
			||||||
 | 
						if node.param2==3 then pos1.x=pos1.x+1 pos2.x=pos2.x+2 end
 | 
				
			||||||
 | 
						if node.param2==2 then pos1.z=pos1.z+1 pos2.z=pos2.z+2 end
 | 
				
			||||||
 | 
						if node.param2==1 then pos1.x=pos1.x-1 pos2.x=pos2.x-2 end
 | 
				
			||||||
 | 
						if node.param2==0 then pos1.z=pos1.z-1 pos2.z=pos2.z-2 end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if node.name == "technic:constructor_mk2_off" then
 | 
				
			||||||
 | 
							technic.swap_node(pos,"technic:constructor_mk2_on")
 | 
				
			||||||
 | 
							nodeupdate(pos)
 | 
				
			||||||
 | 
							local node1=minetest.get_node(pos1)
 | 
				
			||||||
 | 
							deploy_node (inv,"slot1",pos1,node1,node)
 | 
				
			||||||
 | 
							local node1=minetest.get_node(pos2)	
 | 
				
			||||||
 | 
							deploy_node (inv,"slot2",pos2,node1,node)
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local function mk2_off(pos, node)
 | 
				
			||||||
 | 
						if node.name == "technic:constructor_mk2_on" then
 | 
				
			||||||
 | 
							technic.swap_node(pos,"technic:constructor_mk2_off")
 | 
				
			||||||
 | 
							nodeupdate(pos)
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					minetest.register_node("technic:constructor_mk2_off", {
 | 
				
			||||||
 | 
						description = S("Constructor Mk%d"):format(2),
 | 
				
			||||||
 | 
						tile_images = {"technic_constructor_mk2_top_off.png","technic_constructor_mk2_bottom_off.png","technic_constructor_mk2_side2_off.png","technic_constructor_mk2_side1_off.png",
 | 
				
			||||||
 | 
								"technic_constructor_back.png","technic_constructor_front_off.png"},
 | 
				
			||||||
 | 
						is_ground_content = true,
 | 
				
			||||||
 | 
						paramtype2 = "facedir",
 | 
				
			||||||
 | 
						groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2, mesecon = 2},
 | 
				
			||||||
 | 
						mesecons= {effector={action_on=mk2_on}},
 | 
				
			||||||
 | 
						sounds = default.node_sound_stone_defaults(),
 | 
				
			||||||
 | 
						on_construct = function(pos)
 | 
				
			||||||
 | 
						local meta = minetest.get_meta(pos)
 | 
				
			||||||
 | 
						meta:set_string("formspec",
 | 
				
			||||||
 | 
									"invsize[8,9;]"..
 | 
				
			||||||
 | 
									"label[0,0;"..S("Constructor Mk%d"):format(2).."]"..
 | 
				
			||||||
 | 
									"label[5,0;"..S("Slot %d"):format(1).."]"..
 | 
				
			||||||
 | 
									"list[current_name;slot1;6,0;1,1;]"..
 | 
				
			||||||
 | 
									"label[5,1;"..S("Slot %d"):format(2).."]"..
 | 
				
			||||||
 | 
									"list[current_name;slot2;6,1;1,1;]"..
 | 
				
			||||||
 | 
									"list[current_player;main;0,5;8,4;]")
 | 
				
			||||||
 | 
							meta:set_string("infotext", S("Constructor Mk%d"):format(2))
 | 
				
			||||||
 | 
							local inv = meta:get_inventory()
 | 
				
			||||||
 | 
							inv:set_size("slot1", 1)
 | 
				
			||||||
 | 
							inv:set_size("slot2", 1)
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
	can_dig = function(pos,player)
 | 
						can_dig = function(pos,player)
 | 
				
			||||||
		local meta = minetest.get_meta(pos)
 | 
							local meta = minetest.get_meta(pos)
 | 
				
			||||||
		local inv = meta:get_inventory()
 | 
							local inv = meta:get_inventory()
 | 
				
			||||||
			for i = 1, length do
 | 
							if inv:is_empty("slot1")==false or inv:is_empty("slot2")==false then return false end
 | 
				
			||||||
				if not inv:is_empty("slot"..i) then
 | 
					 | 
				
			||||||
					return false
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		return true
 | 
							return true
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
		allow_metadata_inventory_put = allow_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_mk2_on", {
 | 
				
			||||||
		tiles = {"technic_constructor_mk"..mark.."_top_on.png",
 | 
						description = S("Constructor Mk%d"):format(2),
 | 
				
			||||||
			"technic_constructor_mk"..mark.."_bottom_on.png",
 | 
						tile_images = {"technic_constructor_mk2_top_on.png","technic_constructor_mk2_bottom_on.png","technic_constructor_mk2_side2_on.png","technic_constructor_mk2_side1_on.png",
 | 
				
			||||||
			"technic_constructor_mk"..mark.."_side2_on.png",
 | 
								"technic_constructor_back.png","technic_constructor_front_on.png"},
 | 
				
			||||||
			"technic_constructor_mk"..mark.."_side1_on.png",
 | 
						is_ground_content = true,
 | 
				
			||||||
			"technic_constructor_back.png",
 | 
					 | 
				
			||||||
			"technic_constructor_front_on.png"},
 | 
					 | 
				
			||||||
	paramtype2 = "facedir",
 | 
						paramtype2 = "facedir",
 | 
				
			||||||
		drop = "technic:constructor_mk"..mark.."_off",
 | 
						drop = "technic:constructor_mk2_off",
 | 
				
			||||||
		groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
 | 
						groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2, mesecon = 2, not_in_creative_inventory=1},
 | 
				
			||||||
			mesecon=2, not_in_creative_inventory=1, technic_constructor=1},
 | 
						mesecons = {effector={action_off=mk2_off}},
 | 
				
			||||||
		mesecons= {effector = {action_off = make_off(mark)}},
 | 
					 | 
				
			||||||
	sounds = default.node_sound_stone_defaults(),
 | 
						sounds = default.node_sound_stone_defaults(),
 | 
				
			||||||
		allow_metadata_inventory_put = allow_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
 | 
					 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Constructor Mk3
 | 
				
			||||||
 | 
					local function mk3_on(pos, node)
 | 
				
			||||||
 | 
						local meta = minetest.get_meta(pos)
 | 
				
			||||||
 | 
						local inv = meta:get_inventory()
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						local pos1={}
 | 
				
			||||||
 | 
						local pos2={}
 | 
				
			||||||
 | 
						local pos3={}
 | 
				
			||||||
 | 
						local pos4={}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						pos1.x=pos.x
 | 
				
			||||||
 | 
						pos1.y=pos.y
 | 
				
			||||||
 | 
						pos1.z=pos.z
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						pos2.x=pos.x
 | 
				
			||||||
 | 
						pos2.y=pos.y
 | 
				
			||||||
 | 
						pos2.z=pos.z
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						pos3.x=pos.x
 | 
				
			||||||
 | 
						pos3.y=pos.y
 | 
				
			||||||
 | 
						pos3.z=pos.z
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						pos4.x=pos.x
 | 
				
			||||||
 | 
						pos4.y=pos.y
 | 
				
			||||||
 | 
						pos4.z=pos.z
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if node.param2==3 then pos1.x=pos1.x+1 pos2.x=pos2.x+2 pos3.x=pos3.x+3 pos4.x=pos4.x+4 end
 | 
				
			||||||
 | 
						if node.param2==2 then pos1.z=pos1.z+1 pos2.z=pos2.z+2 pos3.z=pos3.z+3 pos4.z=pos4.z+4 end
 | 
				
			||||||
 | 
						if node.param2==1 then pos1.x=pos1.x-1 pos2.x=pos2.x-2 pos3.x=pos3.x-3 pos4.x=pos4.x-4 end
 | 
				
			||||||
 | 
						if node.param2==0 then pos1.z=pos1.z-1 pos2.z=pos2.z-2 pos3.z=pos3.z-3 pos4.z=pos4.z-4 end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if node.name == "technic:constructor_mk3_off" then
 | 
				
			||||||
 | 
							technic.swap_node(pos,"technic:constructor_mk3_on")
 | 
				
			||||||
 | 
							nodeupdate(pos)
 | 
				
			||||||
 | 
							local node1=minetest.get_node(pos1)
 | 
				
			||||||
 | 
							deploy_node (inv,"slot1",pos1,node1,node)
 | 
				
			||||||
 | 
							local node1=minetest.get_node(pos2)	
 | 
				
			||||||
 | 
							deploy_node (inv,"slot2",pos2,node1,node)
 | 
				
			||||||
 | 
							local node1=minetest.get_node(pos3)	
 | 
				
			||||||
 | 
							deploy_node (inv,"slot3",pos3,node1,node)
 | 
				
			||||||
 | 
							local node1=minetest.get_node(pos4)	
 | 
				
			||||||
 | 
							deploy_node (inv,"slot4",pos4,node1,node)
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
make_constructor(1, 1)
 | 
					local function mk3_off(pos, node)
 | 
				
			||||||
make_constructor(2, 2)
 | 
						if node.name == "technic:constructor_mk3_on" then
 | 
				
			||||||
make_constructor(3, 4)
 | 
							technic.swap_node(pos,"technic:constructor_mk3_off")
 | 
				
			||||||
 | 
							nodeupdate(pos)
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					minetest.register_node("technic:constructor_mk3_off", {
 | 
				
			||||||
 | 
						description = S("Constructor Mk%d"):format(3),
 | 
				
			||||||
 | 
						tile_images = {"technic_constructor_mk3_top_off.png","technic_constructor_mk3_bottom_off.png","technic_constructor_mk3_side2_off.png","technic_constructor_mk3_side1_off.png",
 | 
				
			||||||
 | 
								"technic_constructor_back.png","technic_constructor_front_off.png"},
 | 
				
			||||||
 | 
						paramtype2 = "facedir",
 | 
				
			||||||
 | 
						groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2, mesecon = 2},
 | 
				
			||||||
 | 
						mesecons = {effector={action_on=mk3_on}},
 | 
				
			||||||
 | 
						sounds = default.node_sound_stone_defaults(),
 | 
				
			||||||
 | 
						on_construct = function(pos)
 | 
				
			||||||
 | 
						local meta = minetest.get_meta(pos)
 | 
				
			||||||
 | 
						meta:set_string("formspec",
 | 
				
			||||||
 | 
									"invsize[8,9;]"..
 | 
				
			||||||
 | 
									"label[0,0;"..S("Constructor Mk%d"):format(3).."]"..
 | 
				
			||||||
 | 
									"label[5,0;"..S("Slot %d"):format(1).."]"..
 | 
				
			||||||
 | 
									"list[current_name;slot1;6,0;1,1;]"..
 | 
				
			||||||
 | 
									"label[5,1;"..S("Slot %d"):format(2).."]"..
 | 
				
			||||||
 | 
									"list[current_name;slot2;6,1;1,1;]"..
 | 
				
			||||||
 | 
									"label[5,2;"..S("Slot %d"):format(3).."]"..
 | 
				
			||||||
 | 
									"list[current_name;slot3;6,2;1,1;]"..
 | 
				
			||||||
 | 
									"label[5,3;"..S("Slot %d"):format(4).."]"..
 | 
				
			||||||
 | 
									"list[current_name;slot4;6,3;1,1;]"..
 | 
				
			||||||
 | 
									"list[current_player;main;0,5;8,4;]")
 | 
				
			||||||
 | 
							meta:set_string("infotext", S("Constructor Mk%d"):format(3))
 | 
				
			||||||
 | 
							local inv = meta:get_inventory()
 | 
				
			||||||
 | 
							inv:set_size("slot1", 1)
 | 
				
			||||||
 | 
							inv:set_size("slot2", 1)
 | 
				
			||||||
 | 
							inv:set_size("slot3", 1)
 | 
				
			||||||
 | 
							inv:set_size("slot4", 1)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						can_dig = function(pos,player)
 | 
				
			||||||
 | 
							local meta = minetest.get_meta(pos)
 | 
				
			||||||
 | 
							local inv = meta:get_inventory()
 | 
				
			||||||
 | 
							if inv:is_empty("slot1")==false or inv:is_empty("slot2")==false or inv:is_empty("slot3")==false or inv:is_empty("slot4")==false then return false end
 | 
				
			||||||
 | 
							return true
 | 
				
			||||||
 | 
						end,	
 | 
				
			||||||
 | 
						allow_metadata_inventory_put = technic.machine_inventory_put,
 | 
				
			||||||
 | 
						allow_metadata_inventory_take = technic.machine_inventory_take,
 | 
				
			||||||
 | 
						allow_metadata_inventory_move = technic.machine_inventory_move,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					minetest.register_node("technic:constructor_mk3_on", {
 | 
				
			||||||
 | 
						description = S("Constructor Mk%d"):format(3),
 | 
				
			||||||
 | 
						tile_images = {"technic_constructor_mk3_top_on.png","technic_constructor_mk3_bottom_on.png","technic_constructor_mk3_side2_on.png","technic_constructor_mk3_side1_on.png",
 | 
				
			||||||
 | 
								"technic_constructor_back.png","technic_constructor_front_on.png"},
 | 
				
			||||||
 | 
						is_ground_content = true,
 | 
				
			||||||
 | 
						paramtype2 = "facedir",
 | 
				
			||||||
 | 
						drop = "technic:constructor_mk3_off",
 | 
				
			||||||
 | 
						groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2, mesecon = 2,not_in_creative_inventory=1},
 | 
				
			||||||
 | 
						mesecons = {effector={action_off=mk3_off}},
 | 
				
			||||||
 | 
						sounds = default.node_sound_stone_defaults(),
 | 
				
			||||||
 | 
						allow_metadata_inventory_put = technic.machine_inventory_put,
 | 
				
			||||||
 | 
						allow_metadata_inventory_take = technic.machine_inventory_take,
 | 
				
			||||||
 | 
						allow_metadata_inventory_move = technic.machine_inventory_move,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +1,9 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
local S = technic.getter
 | 
					local S = technic.getter
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local infinite_stacks = minetest.settings:get_bool("creative_mode")
 | 
					frames = {}
 | 
				
			||||||
	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 = {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -10,60 +12,45 @@ local frames_pos = {}
 | 
				
			|||||||
local function get_face(pos,ppos,pvect)
 | 
					local function get_face(pos,ppos,pvect)
 | 
				
			||||||
	-- Raytracer to get which face has been clicked
 | 
						-- Raytracer to get which face has been clicked
 | 
				
			||||||
	ppos={x=ppos.x-pos.x,y=ppos.y-pos.y+1.5,z=ppos.z-pos.z}
 | 
						ppos={x=ppos.x-pos.x,y=ppos.y-pos.y+1.5,z=ppos.z-pos.z}
 | 
				
			||||||
 | 
					 | 
				
			||||||
	if pvect.x>0 then
 | 
						if pvect.x>0 then
 | 
				
			||||||
		local t=(-0.5-ppos.x)/pvect.x
 | 
							local t=(-0.5-ppos.x)/pvect.x
 | 
				
			||||||
		local y_int=ppos.y+t*pvect.y
 | 
							local y_int=ppos.y+t*pvect.y
 | 
				
			||||||
		local z_int=ppos.z+t*pvect.z
 | 
							local z_int=ppos.z+t*pvect.z
 | 
				
			||||||
		if y_int > -0.45 and y_int < 0.45 and z_int > -0.45 and z_int < 0.45 then
 | 
							if y_int>-0.45 and y_int<0.45 and z_int>-0.45 and z_int<0.45 then return 1 end 
 | 
				
			||||||
			return 1
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	elseif pvect.x<0 then
 | 
						elseif pvect.x<0 then
 | 
				
			||||||
		local t=(0.5-ppos.x)/pvect.x
 | 
							local t=(0.5-ppos.x)/pvect.x
 | 
				
			||||||
		local y_int=ppos.y+t*pvect.y
 | 
							local y_int=ppos.y+t*pvect.y
 | 
				
			||||||
		local z_int=ppos.z+t*pvect.z
 | 
							local z_int=ppos.z+t*pvect.z
 | 
				
			||||||
		if y_int > -0.45 and y_int < 0.45 and z_int > -0.45 and z_int < 0.45 then
 | 
							if y_int>-0.45 and y_int<0.45 and z_int>-0.45 and z_int<0.45 then return 2 end 
 | 
				
			||||||
			return 2
 | 
					 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if pvect.y>0 then
 | 
						if pvect.y>0 then
 | 
				
			||||||
		local t=(-0.5-ppos.y)/pvect.y
 | 
							local t=(-0.5-ppos.y)/pvect.y
 | 
				
			||||||
		local x_int=ppos.x+t*pvect.x
 | 
							local x_int=ppos.x+t*pvect.x
 | 
				
			||||||
		local z_int=ppos.z+t*pvect.z
 | 
							local z_int=ppos.z+t*pvect.z
 | 
				
			||||||
		if x_int > -0.45 and x_int < 0.45 and z_int > -0.45 and z_int < 0.45 then
 | 
							if x_int>-0.45 and x_int<0.45 and z_int>-0.45 and z_int<0.45 then return 3 end 
 | 
				
			||||||
			return 3
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	elseif pvect.y<0 then
 | 
						elseif pvect.y<0 then
 | 
				
			||||||
		local t=(0.5-ppos.y)/pvect.y
 | 
							local t=(0.5-ppos.y)/pvect.y
 | 
				
			||||||
		local x_int=ppos.x+t*pvect.x
 | 
							local x_int=ppos.x+t*pvect.x
 | 
				
			||||||
		local z_int=ppos.z+t*pvect.z
 | 
							local z_int=ppos.z+t*pvect.z
 | 
				
			||||||
		if x_int > -0.45 and x_int < 0.45 and z_int > -0.45 and z_int < 0.45 then
 | 
							if x_int>-0.45 and x_int<0.45 and z_int>-0.45 and z_int<0.45 then return 4 end 
 | 
				
			||||||
			return 4
 | 
					 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if pvect.z>0 then
 | 
						if pvect.z>0 then
 | 
				
			||||||
		local t=(-0.5-ppos.z)/pvect.z
 | 
							local t=(-0.5-ppos.z)/pvect.z
 | 
				
			||||||
		local x_int=ppos.x+t*pvect.x
 | 
							local x_int=ppos.x+t*pvect.x
 | 
				
			||||||
		local y_int=ppos.y+t*pvect.y
 | 
							local y_int=ppos.y+t*pvect.y
 | 
				
			||||||
		if x_int > -0.45 and x_int < 0.45 and y_int > -0.45 and y_int < 0.45 then
 | 
							if x_int>-0.45 and x_int<0.45 and y_int>-0.45 and y_int<0.45 then return 5 end 
 | 
				
			||||||
			return 5
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	elseif pvect.z<0 then
 | 
						elseif pvect.z<0 then
 | 
				
			||||||
		local t=(0.5-ppos.z)/pvect.z
 | 
							local t=(0.5-ppos.z)/pvect.z
 | 
				
			||||||
		local x_int=ppos.x+t*pvect.x
 | 
							local x_int=ppos.x+t*pvect.x
 | 
				
			||||||
		local y_int=ppos.y+t*pvect.y
 | 
							local y_int=ppos.y+t*pvect.y
 | 
				
			||||||
		if x_int > -0.45 and x_int < 0.45 and y_int > -0.45 and y_int < 0.45 then
 | 
							if x_int>-0.45 and x_int<0.45 and y_int>-0.45 and y_int<0.45 then return 6 end 
 | 
				
			||||||
			return 6
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local function lines(str)
 | 
					local function lines(str)
 | 
				
			||||||
	local t = {}
 | 
						local t = {}
 | 
				
			||||||
	local function helper(line) table.insert(t, line) return "" end
 | 
						local function helper(line) table.insert(t, line) return "" end
 | 
				
			||||||
	helper(str:gsub("(.-)\r?\n", helper))
 | 
						helper((str:gsub("(.-)\r?\n", helper)))
 | 
				
			||||||
	return t
 | 
						return t
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -81,29 +68,27 @@ end
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
local function pos_in_list(l,pos)
 | 
					local function pos_in_list(l,pos)
 | 
				
			||||||
	for _,p in ipairs(l) do
 | 
						for _,p in ipairs(l) do
 | 
				
			||||||
		if p.x == pos.x and p.y == pos.y and p.z == pos.z then
 | 
							if p.x==pos.x and p.y==pos.y and p.z==pos.z then return true end
 | 
				
			||||||
			return true
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
	return false
 | 
						return false
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local function table_empty(what)
 | 
					local function table_empty(table)
 | 
				
			||||||
	for _ in pairs(what) do
 | 
						for _, __ in pairs(table) do
 | 
				
			||||||
		return false
 | 
							return false
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
	return true
 | 
						return true
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local function add_table(what, toadd)
 | 
					local function add_table(table,toadd)
 | 
				
			||||||
	local i = 1
 | 
						local i = 1
 | 
				
			||||||
	while true do
 | 
						while true do
 | 
				
			||||||
		local o = what[i]
 | 
							o = table[i]
 | 
				
			||||||
		if o == toadd then return end
 | 
							if o == toadd then return end
 | 
				
			||||||
		if o == nil then break end
 | 
							if o == nil then break end
 | 
				
			||||||
		i = i+1
 | 
							i = i+1
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
	what[i] = toadd
 | 
						table[i] = toadd
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local function move_nodes_vect(poslist,vect,must_not_move,owner)
 | 
					local function move_nodes_vect(poslist,vect,must_not_move,owner)
 | 
				
			||||||
@@ -115,56 +100,39 @@ local function move_nodes_vect(poslist, vect, must_not_move, owner)
 | 
				
			|||||||
			end
 | 
								end
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
 | 
					 | 
				
			||||||
	for _,pos in ipairs(poslist) do
 | 
						for _,pos in ipairs(poslist) do
 | 
				
			||||||
		local npos=vector.add(pos,vect)
 | 
							local npos=vector.add(pos,vect)
 | 
				
			||||||
		local name = minetest.get_node(npos).name
 | 
							local name = minetest.get_node(npos).name
 | 
				
			||||||
		if (name ~= "air" and minetest.registered_nodes[name].liquidtype == "none" or
 | 
							if ((name~="air" and minetest.registered_nodes[name].liquidtype=="none") or frames_pos[pos_to_string(npos)]) and not(pos_in_list(poslist,npos)) then
 | 
				
			||||||
				frames_pos[pos_to_string(npos)]) and not pos_in_list(poslist, npos) then
 | 
					 | 
				
			||||||
			return
 | 
								return
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
 | 
							--[[if pos.x==must_not_move.x and pos.y==must_not_move.y and pos.z==must_not_move.z then
 | 
				
			||||||
 | 
								return
 | 
				
			||||||
 | 
							end]]
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
 | 
					 | 
				
			||||||
	local nodelist = {}
 | 
						local nodelist = {}
 | 
				
			||||||
	for _, pos in ipairs(poslist) do
 | 
						for _, pos in ipairs(poslist) do
 | 
				
			||||||
		local node = minetest.get_node(pos)
 | 
							local node = minetest.get_node(pos)
 | 
				
			||||||
		local meta = minetest.get_meta(pos):to_table()
 | 
							local meta = minetest.get_meta(pos):to_table()
 | 
				
			||||||
		local timer = minetest.get_node_timer(pos)
 | 
							nodelist[#(nodelist)+1] = {oldpos = pos, pos = vector.add(pos, vect), node = node, meta = meta}
 | 
				
			||||||
		nodelist[#nodelist + 1] = {
 | 
					 | 
				
			||||||
			oldpos = pos,
 | 
					 | 
				
			||||||
			pos = vector.add(pos, vect),
 | 
					 | 
				
			||||||
			node = node,
 | 
					 | 
				
			||||||
			meta = meta,
 | 
					 | 
				
			||||||
			timer = {
 | 
					 | 
				
			||||||
				timeout = timer:get_timeout(),
 | 
					 | 
				
			||||||
				elapsed = timer:get_elapsed()
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
 | 
					 | 
				
			||||||
	local objects = {}
 | 
						local objects = {}
 | 
				
			||||||
	for _, pos in ipairs(poslist) do
 | 
						for _, pos in ipairs(poslist) do
 | 
				
			||||||
		for _,object in ipairs(minetest.get_objects_inside_radius(pos, 1)) do
 | 
							for _,object in ipairs(minetest.get_objects_inside_radius(pos, 1)) do
 | 
				
			||||||
			local entity = object:get_luaentity()
 | 
								local entity = object:get_luaentity()
 | 
				
			||||||
			if not entity or not mesecon.is_mvps_unmov(entity.name) then
 | 
								if not entity or not mesecon:is_mvps_unmov(entity.name) then
 | 
				
			||||||
				add_table(objects, object)
 | 
									add_table(objects, object)
 | 
				
			||||||
			end
 | 
								end
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
 | 
					 | 
				
			||||||
	for _, obj in ipairs(objects) do
 | 
						for _, obj in ipairs(objects) do
 | 
				
			||||||
		obj:set_pos(vector.add(obj:get_pos(), vect))
 | 
							obj:setpos(vector.add(obj:getpos(), vect))
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
 | 
					 | 
				
			||||||
	for _,n in ipairs(nodelist) do
 | 
						for _,n in ipairs(nodelist) do
 | 
				
			||||||
		local npos = n.pos
 | 
							local npos = n.pos
 | 
				
			||||||
		minetest.set_node(npos, n.node)
 | 
							minetest.set_node(npos, n.node)
 | 
				
			||||||
		local meta = minetest.get_meta(npos)
 | 
							local meta = minetest.get_meta(npos)
 | 
				
			||||||
		meta:from_table(n.meta)
 | 
							meta:from_table(n.meta)
 | 
				
			||||||
		local timer = minetest.get_node_timer(npos)
 | 
					 | 
				
			||||||
		if n.timer.timeout ~= 0 or n.timer.elapsed ~= 0 then
 | 
					 | 
				
			||||||
			timer:set(n.timer.timeout, n.timer.elapsed)
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		for __,pos in ipairs(poslist) do
 | 
							for __,pos in ipairs(poslist) do
 | 
				
			||||||
			if npos.x == pos.x and npos.y == pos.y and npos.z == pos.z then
 | 
								if npos.x == pos.x and npos.y == pos.y and npos.z == pos.z then
 | 
				
			||||||
				table.remove(poslist, __)
 | 
									table.remove(poslist, __)
 | 
				
			||||||
@@ -172,20 +140,19 @@ local function move_nodes_vect(poslist, vect, must_not_move, owner)
 | 
				
			|||||||
			end
 | 
								end
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
 | 
					 | 
				
			||||||
	for __, pos in ipairs(poslist) do
 | 
						for __, pos in ipairs(poslist) do
 | 
				
			||||||
		minetest.remove_node(pos)
 | 
							minetest.remove_node(pos)
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
 | 
					 | 
				
			||||||
	for _, callback in ipairs(mesecon.on_mvps_move) do
 | 
						for _, callback in ipairs(mesecon.on_mvps_move) do
 | 
				
			||||||
		callback(nodelist)
 | 
							callback(nodelist)
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local function is_supported_node(name)
 | 
					local function is_supported_node(name)
 | 
				
			||||||
	return string.find(name, "tube") and string.find(name, "pipeworks")
 | 
						return ((string.find(name, "tube") ~= nil) and (string.find(name, "pipeworks") ~= nil))
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- Frames
 | 
					-- Frames
 | 
				
			||||||
for xm=0,1 do
 | 
					for xm=0,1 do
 | 
				
			||||||
for xp=0,1 do
 | 
					for xp=0,1 do
 | 
				
			||||||
@@ -199,7 +166,6 @@ for zp = 0, 1 do
 | 
				
			|||||||
local nodeboxes= {
 | 
					local nodeboxes= {
 | 
				
			||||||
	{ -a, -a, -a, -b,  a, -b },
 | 
						{ -a, -a, -a, -b,  a, -b },
 | 
				
			||||||
	{ -a, -a,  b, -b,  a,  a },
 | 
						{ -a, -a,  b, -b,  a,  a },
 | 
				
			||||||
 | 
					 | 
				
			||||||
	{  b, -a,  b,  a,  a,  a },
 | 
						{  b, -a,  b,  a,  a,  a },
 | 
				
			||||||
	{  b, -a, -a,  a,  a, -b },
 | 
						{  b, -a, -a,  a,  a, -b },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -235,7 +201,7 @@ for zp = 0, 1 do
 | 
				
			|||||||
		table.insert(nodeboxes, {-b,-b,-a, b,b,-b})
 | 
							table.insert(nodeboxes, {-b,-b,-a, b,b,-b})
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	local nameext = string.format("%d%d%d%d%d%d", xm, xp, ym, yp, zm, zp)
 | 
						local nameext=tostring(xm)..tostring(xp)..tostring(ym)..tostring(yp)..tostring(zm)..tostring(zp)
 | 
				
			||||||
	local groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}
 | 
						local groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}
 | 
				
			||||||
	if nameext~="111111" then groups.not_in_creative_inventory=1 end
 | 
						if nameext~="111111" then groups.not_in_creative_inventory=1 end
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
@@ -257,44 +223,33 @@ for zp = 0, 1 do
 | 
				
			|||||||
		frame=1,
 | 
							frame=1,
 | 
				
			||||||
		drop="technic:frame_111111",
 | 
							drop="technic:frame_111111",
 | 
				
			||||||
		sunlight_propagates = true,
 | 
							sunlight_propagates = true,
 | 
				
			||||||
 | 
					 | 
				
			||||||
		frame_connect_all=function(nodename)
 | 
							frame_connect_all=function(nodename)
 | 
				
			||||||
			local l2 = {}
 | 
								l2={}
 | 
				
			||||||
			local l1 = {
 | 
								l1={{x=-1,y=0,z=0},{x=1,y=0,z=0},{x=0,y=-1,z=0},{x=0,y=1,z=0},{x=0,y=0,z=-1},{x=0,y=0,z=1}}
 | 
				
			||||||
				{ x = -1, y = 0, z = 0 }, { x = 1, y = 0, z = 0 },
 | 
					 | 
				
			||||||
				{ x = 0, y = -1, z = 0 }, { x = 0, y = 1, z = 0 },
 | 
					 | 
				
			||||||
				{ x = 0, y = 0, z = -1 }, { x = 0, y = 0, z = 1 }
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
			for i,dir in ipairs(l1) do
 | 
								for i,dir in ipairs(l1) do
 | 
				
			||||||
				if string.sub(nodename,-7+i,-7+i)=="1" then
 | 
									if string.sub(nodename,-7+i,-7+i)=="1" then
 | 
				
			||||||
					l2[#l2 + 1] = dir
 | 
										l2[#(l2)+1]=dir
 | 
				
			||||||
				end
 | 
									end
 | 
				
			||||||
			end
 | 
								end
 | 
				
			||||||
			return l2
 | 
								return l2
 | 
				
			||||||
		end,
 | 
							end,
 | 
				
			||||||
 | 
					 | 
				
			||||||
		on_punch=function(pos,node,puncher)
 | 
							on_punch=function(pos,node,puncher)
 | 
				
			||||||
			local ppos = puncher:get_pos()
 | 
								local ppos=puncher:getpos()
 | 
				
			||||||
			local pvect=puncher:get_look_dir()
 | 
								local pvect=puncher:get_look_dir()
 | 
				
			||||||
			local pface=get_face(pos,ppos,pvect)
 | 
								local pface=get_face(pos,ppos,pvect)
 | 
				
			||||||
 | 
					 | 
				
			||||||
			if pface==nil then return end
 | 
								if pface==nil then return end
 | 
				
			||||||
 | 
					 | 
				
			||||||
			local nodename=node.name
 | 
								local nodename=node.name
 | 
				
			||||||
			local newstate = tostring(1 - tonumber(string.sub(nodename, pface - 7, pface - 7)))
 | 
								local newstate=tostring(1-tonumber(string.sub(nodename,-7+pface,-7+pface)))
 | 
				
			||||||
			if pface<=5 then
 | 
								if pface<=5 then
 | 
				
			||||||
				nodename = string.sub(nodename, 1, pface - 7 - 1)..newstate..string.sub(nodename, pface - 7 + 1)
 | 
									nodename=string.sub(nodename,1,-7+pface-1)..newstate..string.sub(nodename,-7+pface+1)
 | 
				
			||||||
			else
 | 
								else
 | 
				
			||||||
				nodename=string.sub(nodename,1,-2)..newstate
 | 
									nodename=string.sub(nodename,1,-2)..newstate
 | 
				
			||||||
			end
 | 
								end
 | 
				
			||||||
 | 
					 | 
				
			||||||
			node.name=nodename
 | 
								node.name=nodename
 | 
				
			||||||
			minetest.set_node(pos,node)
 | 
								minetest.set_node(pos,node)
 | 
				
			||||||
		end,
 | 
							end,
 | 
				
			||||||
 | 
					 | 
				
			||||||
		on_place = function(itemstack, placer, pointed_thing)
 | 
							on_place = function(itemstack, placer, pointed_thing)
 | 
				
			||||||
			local pos = pointed_thing.above
 | 
								local pos = pointed_thing.above
 | 
				
			||||||
 | 
					 | 
				
			||||||
			if minetest.is_protected(pos, placer:get_player_name()) then
 | 
								if minetest.is_protected(pos, placer:get_player_name()) then
 | 
				
			||||||
				minetest.log("action", placer:get_player_name()
 | 
									minetest.log("action", placer:get_player_name()
 | 
				
			||||||
					.. " tried to place " .. itemstack:get_name()
 | 
										.. " tried to place " .. itemstack:get_name()
 | 
				
			||||||
@@ -303,25 +258,21 @@ for zp = 0, 1 do
 | 
				
			|||||||
				minetest.record_protection_violation(pos, placer:get_player_name())
 | 
									minetest.record_protection_violation(pos, placer:get_player_name())
 | 
				
			||||||
				return itemstack
 | 
									return itemstack
 | 
				
			||||||
			end
 | 
								end
 | 
				
			||||||
 | 
					 | 
				
			||||||
			if pos == nil then return end
 | 
								if pos == nil then return end
 | 
				
			||||||
 | 
					 | 
				
			||||||
			local node = minetest.get_node(pos)
 | 
								local node = minetest.get_node(pos)
 | 
				
			||||||
			if node.name ~= "air" then
 | 
								if node.name ~= "air" then
 | 
				
			||||||
				if is_supported_node(node.name) then
 | 
									if is_supported_node(node.name) then
 | 
				
			||||||
					local obj = minetest.add_entity(pos, "technic:frame_entity")
 | 
										obj = minetest.add_entity(pos, "technic:frame_entity")
 | 
				
			||||||
					obj:get_luaentity():set_node({name=itemstack:get_name()})
 | 
										obj:get_luaentity():set_node({name=itemstack:get_name()})
 | 
				
			||||||
				end
 | 
									end
 | 
				
			||||||
			else
 | 
								else
 | 
				
			||||||
				minetest.set_node(pos, {name = itemstack:get_name()})
 | 
									minetest.set_node(pos, {name = itemstack:get_name()})
 | 
				
			||||||
			end
 | 
								end
 | 
				
			||||||
 | 
					 | 
				
			||||||
			if not infinite_stacks then
 | 
								if not infinite_stacks then
 | 
				
			||||||
				itemstack:take_item()
 | 
									itemstack:take_item()
 | 
				
			||||||
			end
 | 
								end
 | 
				
			||||||
			return itemstack
 | 
								return itemstack
 | 
				
			||||||
		end,
 | 
							end,
 | 
				
			||||||
 | 
					 | 
				
			||||||
		on_rightclick = function(pos, node, placer, itemstack, pointed_thing)
 | 
							on_rightclick = function(pos, node, placer, itemstack, pointed_thing)
 | 
				
			||||||
			if is_supported_node(itemstack:get_name()) then
 | 
								if is_supported_node(itemstack:get_name()) then
 | 
				
			||||||
				if minetest.is_protected(pos, placer:get_player_name()) then
 | 
									if minetest.is_protected(pos, placer:get_player_name()) then
 | 
				
			||||||
@@ -340,15 +291,15 @@ for zp = 0, 1 do
 | 
				
			|||||||
				-- Run callback
 | 
									-- Run callback
 | 
				
			||||||
				if def.after_place_node then
 | 
									if def.after_place_node then
 | 
				
			||||||
					-- Copy place_to because callback can modify it
 | 
										-- Copy place_to because callback can modify it
 | 
				
			||||||
					local pos_copy = vector.new(pos)
 | 
										local pos_copy = {x=pos.x, y=pos.y, z=pos.z}
 | 
				
			||||||
					if def.after_place_node(pos_copy, placer, itemstack) then
 | 
										if def.after_place_node(pos_copy, placer, itemstack) then
 | 
				
			||||||
						take_item = false
 | 
											take_item = false
 | 
				
			||||||
					end
 | 
										end
 | 
				
			||||||
				end
 | 
									end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				-- Run script hook
 | 
									-- Run script hook
 | 
				
			||||||
				local callback = nil
 | 
									local _, callback
 | 
				
			||||||
				for _, _ in ipairs(minetest.registered_on_placenodes) do
 | 
									for _, callback in ipairs(minetest.registered_on_placenodes) do
 | 
				
			||||||
					-- Copy pos and node because callback can modify them
 | 
										-- Copy pos and node because callback can modify them
 | 
				
			||||||
					local pos_copy = {x=pos.x, y=pos.y, z=pos.z}
 | 
										local pos_copy = {x=pos.x, y=pos.y, z=pos.z}
 | 
				
			||||||
					local newnode_copy = {name=def.name, param1=0, param2=0}
 | 
										local newnode_copy = {name=def.name, param1=0, param2=0}
 | 
				
			||||||
@@ -362,14 +313,14 @@ for zp = 0, 1 do
 | 
				
			|||||||
					itemstack:take_item()
 | 
										itemstack:take_item()
 | 
				
			||||||
				end
 | 
									end
 | 
				
			||||||
				
 | 
									
 | 
				
			||||||
				local obj = minetest.add_entity(pos, "technic:frame_entity")
 | 
									obj = minetest.add_entity(pos, "technic:frame_entity")
 | 
				
			||||||
				obj:get_luaentity():set_node({name=node.name})
 | 
									obj:get_luaentity():set_node({name=node.name})
 | 
				
			||||||
				
 | 
									
 | 
				
			||||||
				return itemstack
 | 
									return itemstack
 | 
				
			||||||
			else
 | 
								else
 | 
				
			||||||
				--local pointed_thing = {type = "node", under = pos}
 | 
									--local pointed_thing = {type = "node", under = pos}
 | 
				
			||||||
				if pointed_thing then
 | 
									if pointed_thing then
 | 
				
			||||||
					return minetest.item_place_node(itemstack, placer, pointed_thing)
 | 
										minetest.item_place_node(itemstack, placer, pointed_thing)
 | 
				
			||||||
				end
 | 
									end
 | 
				
			||||||
			end
 | 
								end
 | 
				
			||||||
		end,
 | 
							end,
 | 
				
			||||||
@@ -395,10 +346,22 @@ minetest.register_entity("technic:frame_entity", {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	set_node = function(self, node)
 | 
						set_node = function(self, node)
 | 
				
			||||||
		self.node = node
 | 
							self.node = node
 | 
				
			||||||
		local pos = vector.round(self.object:getpos())
 | 
							local pos = self.object:getpos()
 | 
				
			||||||
 | 
							pos = {x = math.floor(pos.x+0.5), y = math.floor(pos.y+0.5), z = math.floor(pos.z+0.5)}
 | 
				
			||||||
		frames_pos[pos_to_string(pos)] = node.name
 | 
							frames_pos[pos_to_string(pos)] = node.name
 | 
				
			||||||
 | 
							local stack = ItemStack(node.name)
 | 
				
			||||||
		local prop = {
 | 
							local itemtable = stack:to_table()
 | 
				
			||||||
 | 
							local itemname = nil
 | 
				
			||||||
 | 
							if itemtable then
 | 
				
			||||||
 | 
								itemname = stack:to_table().name
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							local item_texture = nil
 | 
				
			||||||
 | 
							local item_type = ""
 | 
				
			||||||
 | 
							if minetest.registered_items[itemname] then
 | 
				
			||||||
 | 
								item_texture = minetest.registered_items[itemname].inventory_image
 | 
				
			||||||
 | 
								item_type = minetest.registered_items[itemname].type
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							prop = {
 | 
				
			||||||
			is_visible = true,
 | 
								is_visible = true,
 | 
				
			||||||
			textures = {node.name},
 | 
								textures = {node.name},
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
@@ -415,14 +378,15 @@ minetest.register_entity("technic:frame_entity", {
 | 
				
			|||||||
	end,
 | 
						end,
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	dig = function(self)
 | 
						dig = function(self)
 | 
				
			||||||
		minetest.handle_node_drops(self.object:get_pos(), { ItemStack("technic:frame_111111") }, self.last_puncher)
 | 
							minetest.handle_node_drops(self.object:getpos(), {ItemStack("technic:frame_111111")}, self.last_puncher)
 | 
				
			||||||
		local pos = vector.round(self.object:get_pos())
 | 
							local pos = self.object:getpos()
 | 
				
			||||||
 | 
							pos = {x = math.floor(pos.x+0.5), y = math.floor(pos.y+0.5), z = math.floor(pos.z+0.5)}
 | 
				
			||||||
		frames_pos[pos_to_string(pos)] = nil
 | 
							frames_pos[pos_to_string(pos)] = nil
 | 
				
			||||||
		self.object:remove()
 | 
							self.object:remove()
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	on_punch = function(self, puncher, time_from_last_punch, tool_capabilities, dir)
 | 
						on_punch = function(self, puncher, time_from_last_punch, tool_capabilities, dir)
 | 
				
			||||||
		local pos = self.object:get_pos()
 | 
							local pos = self.object:getpos()
 | 
				
			||||||
		if self.damage_object == nil then
 | 
							if self.damage_object == nil then
 | 
				
			||||||
			self.damage_object = minetest.add_entity(pos, "technic:damage_entity")
 | 
								self.damage_object = minetest.add_entity(pos, "technic:damage_entity")
 | 
				
			||||||
			self.damage_object:get_luaentity().remaining_time = 0.25
 | 
								self.damage_object:get_luaentity().remaining_time = 0.25
 | 
				
			||||||
@@ -432,43 +396,35 @@ minetest.register_entity("technic:frame_entity", {
 | 
				
			|||||||
		else
 | 
							else
 | 
				
			||||||
			self.damage_object:get_luaentity().remaining_time = 0.25
 | 
								self.damage_object:get_luaentity().remaining_time = 0.25
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
 | 
					 | 
				
			||||||
		self.last_puncher = puncher
 | 
							self.last_puncher = puncher
 | 
				
			||||||
		local ppos = puncher:get_pos()
 | 
							local ppos = puncher:getpos()
 | 
				
			||||||
		local pvect = puncher:get_look_dir()
 | 
							local pvect = puncher:get_look_dir()
 | 
				
			||||||
		local pface = get_face(pos,ppos,pvect)
 | 
							local pface = get_face(pos,ppos,pvect)
 | 
				
			||||||
		if pface == nil then return end
 | 
							if pface == nil then return end
 | 
				
			||||||
		local nodename = self.node.name
 | 
							local nodename = self.node.name
 | 
				
			||||||
		local newstate = tostring(1 - tonumber(string.sub(nodename, pface - 7, pface - 7)))
 | 
							local newstate = tostring(1-tonumber(string.sub(nodename, -7+pface, -7+pface)))
 | 
				
			||||||
 | 
					 | 
				
			||||||
		if pface <= 5 then
 | 
							if pface <= 5 then
 | 
				
			||||||
			nodename = string.sub(nodename, 1, pface - 7 - 1)..newstate..string.sub(nodename, pface - 7 + 1)
 | 
								nodename = string.sub(nodename, 1, -7+pface-1)..newstate..string.sub(nodename, -7+pface+1)
 | 
				
			||||||
		else
 | 
							else
 | 
				
			||||||
			nodename = string.sub(nodename, 1, -2)..newstate
 | 
								nodename = string.sub(nodename, 1, -2)..newstate
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
 | 
					 | 
				
			||||||
		self.node.name = nodename
 | 
							self.node.name = nodename
 | 
				
			||||||
		self:set_node(self.node)
 | 
							self:set_node(self.node)
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	on_rightclick = function(self, clicker)
 | 
						on_rightclick = function(self, clicker)
 | 
				
			||||||
		local pos = self.object:get_pos()
 | 
							local pos = self.object:getpos()
 | 
				
			||||||
		local ppos = clicker:get_pos()
 | 
							local ppos = clicker:getpos()
 | 
				
			||||||
		local pvect = clicker:get_look_dir()
 | 
							local pvect = clicker:get_look_dir()
 | 
				
			||||||
		local pface = get_face(pos, ppos, pvect)
 | 
							local pface = get_face(pos, ppos, pvect)
 | 
				
			||||||
 | 
							if pface == nil then return end
 | 
				
			||||||
		if pface == nil then
 | 
							local pos_under = {x = math.floor(pos.x+0.5), y = math.floor(pos.y+0.5), z = math.floor(pos.z+0.5)}
 | 
				
			||||||
			return
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		local pos_under = vector.round(pos)
 | 
					 | 
				
			||||||
		local pos_above = {x = pos_under.x, y = pos_under.y, z = pos_under.z}
 | 
							local pos_above = {x = pos_under.x, y = pos_under.y, z = pos_under.z}
 | 
				
			||||||
		local index = ({"x", "y", "z"})[math.floor((pface+1)/2)]
 | 
							local index = ({"x", "y", "z"})[math.floor((pface+1)/2)]
 | 
				
			||||||
		pos_above[index] = pos_above[index] + 2*((pface+1)%2) - 1
 | 
							pos_above[index] = pos_above[index] + 2*((pface+1)%2) - 1
 | 
				
			||||||
		local pointed_thing = {type = "node", under = pos_under, above = pos_above}
 | 
							local pointed_thing = {type = "node", under = pos_under, above = pos_above}
 | 
				
			||||||
		local itemstack = clicker:get_wielded_item()
 | 
							local itemstack = clicker:get_wielded_item()
 | 
				
			||||||
		local itemdef = minetest.registered_items[itemstack:get_name()]
 | 
							local itemdef = minetest.registered_items[itemstack:get_name()]
 | 
				
			||||||
 | 
					 | 
				
			||||||
		if itemdef ~= nil then
 | 
							if itemdef ~= nil then
 | 
				
			||||||
			itemdef.on_place(itemstack, clicker, pointed_thing)
 | 
								itemdef.on_place(itemstack, clicker, pointed_thing)
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
@@ -509,17 +465,13 @@ minetest.register_entity("technic:damage_entity", {
 | 
				
			|||||||
	end,
 | 
						end,
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
mesecon.register_mvps_unmov("technic:frame_entity")
 | 
					mesecon:register_mvps_unmov("technic:frame_entity")
 | 
				
			||||||
mesecon.register_mvps_unmov("technic:damage_entity")
 | 
					mesecon:register_mvps_unmov("technic:damage_entity")
 | 
				
			||||||
mesecon.register_on_mvps_move(function(moved_nodes)
 | 
					mesecon:register_on_mvps_move(function(moved_nodes)
 | 
				
			||||||
	local to_move = {}
 | 
						local to_move = {}
 | 
				
			||||||
	for _, n in ipairs(moved_nodes) do
 | 
						for _, n in ipairs(moved_nodes) do
 | 
				
			||||||
		if frames_pos[pos_to_string(n.oldpos)] ~= nil then
 | 
							if frames_pos[pos_to_string(n.oldpos)] ~= nil then
 | 
				
			||||||
			to_move[#to_move + 1] = {
 | 
								to_move[#to_move+1] = {pos = n.pos, oldpos = n.oldpos, name = frames_pos[pos_to_string(n.oldpos)]}
 | 
				
			||||||
				pos = n.pos,
 | 
					 | 
				
			||||||
				oldpos = n.oldpos,
 | 
					 | 
				
			||||||
				name = frames_pos[pos_to_string(n.oldpos)]
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
			frames_pos[pos_to_string(n.oldpos)] = nil
 | 
								frames_pos[pos_to_string(n.oldpos)] = nil
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
@@ -529,9 +481,8 @@ mesecon.register_on_mvps_move(function(moved_nodes)
 | 
				
			|||||||
			local objects = minetest.get_objects_inside_radius(t.oldpos, 0.1)
 | 
								local objects = minetest.get_objects_inside_radius(t.oldpos, 0.1)
 | 
				
			||||||
			for _, obj in ipairs(objects) do
 | 
								for _, obj in ipairs(objects) do
 | 
				
			||||||
				local entity = obj:get_luaentity()
 | 
									local entity = obj:get_luaentity()
 | 
				
			||||||
				if entity and (entity.name == "technic:frame_entity" or
 | 
									if entity and (entity.name == "technic:frame_entity" or entity.name == "technic:damage_entity") then
 | 
				
			||||||
						entity.name == "technic:damage_entity") then
 | 
										obj:setpos(t.pos)
 | 
				
			||||||
					obj:set_pos(t.pos)
 | 
					 | 
				
			||||||
				end
 | 
									end
 | 
				
			||||||
			end
 | 
								end
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
@@ -560,10 +511,10 @@ local function connected(pos, c, adj)
 | 
				
			|||||||
		if frames_pos[pos_to_string(pos1)] then
 | 
							if frames_pos[pos_to_string(pos1)] then
 | 
				
			||||||
			nodename = frames_pos[pos_to_string(pos1)]
 | 
								nodename = frames_pos[pos_to_string(pos1)]
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
		if not pos_in_list(c, pos1) and nodename ~= "air" and
 | 
							if not(pos_in_list(c,pos1)) and nodename~="air" and
 | 
				
			||||||
		(minetest.registered_nodes[nodename].frames_can_connect==nil or
 | 
							(minetest.registered_nodes[nodename].frames_can_connect==nil or
 | 
				
			||||||
		minetest.registered_nodes[nodename].frames_can_connect(pos1,vect)) then
 | 
							minetest.registered_nodes[nodename].frames_can_connect(pos1,vect)) then
 | 
				
			||||||
			c[#c + 1] = pos1
 | 
								c[#(c)+1]=pos1
 | 
				
			||||||
			if minetest.registered_nodes[nodename].frame==1 then
 | 
								if minetest.registered_nodes[nodename].frame==1 then
 | 
				
			||||||
				local adj=minetest.registered_nodes[nodename].frame_connect_all(nodename)
 | 
									local adj=minetest.registered_nodes[nodename].frame_connect_all(nodename)
 | 
				
			||||||
				connected(pos1,c,adj)
 | 
									connected(pos1,c,adj)
 | 
				
			||||||
@@ -573,7 +524,7 @@ local function connected(pos, c, adj)
 | 
				
			|||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local function get_connected_nodes(pos)
 | 
					local function get_connected_nodes(pos)
 | 
				
			||||||
	local c = { pos }
 | 
						c={pos}
 | 
				
			||||||
	local nodename=minetest.get_node(pos).name
 | 
						local nodename=minetest.get_node(pos).name
 | 
				
			||||||
	if frames_pos[pos_to_string(pos)] then
 | 
						if frames_pos[pos_to_string(pos)] then
 | 
				
			||||||
		nodename = frames_pos[pos_to_string(pos)]
 | 
							nodename = frames_pos[pos_to_string(pos)]
 | 
				
			||||||
@@ -583,55 +534,39 @@ local function get_connected_nodes(pos)
 | 
				
			|||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local function frame_motor_on(pos, node)
 | 
					local function frame_motor_on(pos, node)
 | 
				
			||||||
	local dirs = {
 | 
						local dirs = {{x=0,y=1,z=0},{x=0,y=0,z=1},{x=0,y=0,z=-1},{x=1,y=0,z=0},{x=-1,y=0,z=0},{x=0,y=-1,z=0}}
 | 
				
			||||||
		{ x = 0, y = 1, z = 0 }, { x = 0, y = 0, z = 1 },
 | 
					 | 
				
			||||||
		{ x = 0, y = 0, z = -1 }, { x = 1, y = 0, z = 0 },
 | 
					 | 
				
			||||||
		{ x = -1, y = 0, z = 0 }, { x = 0, y = -1, z = 0 }
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	local nnodepos = vector.add(pos, dirs[math.floor(node.param2/4)+1])
 | 
						local nnodepos = vector.add(pos, dirs[math.floor(node.param2/4)+1])
 | 
				
			||||||
	local dir = minetest.facedir_to_dir(node.param2)
 | 
						local dir = minetest.facedir_to_dir(node.param2)
 | 
				
			||||||
	local nnode=minetest.get_node(nnodepos)
 | 
						local nnode=minetest.get_node(nnodepos)
 | 
				
			||||||
 | 
					 | 
				
			||||||
	if frames_pos[pos_to_string(nnodepos)] then
 | 
						if frames_pos[pos_to_string(nnodepos)] then
 | 
				
			||||||
		nnode.name = frames_pos[pos_to_string(nnodepos)]
 | 
							nnode.name = frames_pos[pos_to_string(nnodepos)]
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
 | 
					 | 
				
			||||||
	local meta = minetest.get_meta(pos)
 | 
						local meta = minetest.get_meta(pos)
 | 
				
			||||||
	if meta:get_int("last_moved") == minetest.get_gametime() then
 | 
						if meta:get_int("last_moved") == minetest.get_gametime() then
 | 
				
			||||||
		return
 | 
							return
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
 | 
					 | 
				
			||||||
	local owner = meta:get_string("owner")
 | 
						local owner = meta:get_string("owner")
 | 
				
			||||||
	if minetest.registered_nodes[nnode.name].frame==1 then
 | 
						if minetest.registered_nodes[nnode.name].frame==1 then
 | 
				
			||||||
		local connected_nodes=get_connected_nodes(nnodepos)
 | 
							local connected_nodes=get_connected_nodes(nnodepos)
 | 
				
			||||||
		move_nodes_vect(connected_nodes,dir,pos,owner)
 | 
							move_nodes_vect(connected_nodes,dir,pos,owner)
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
 | 
					 | 
				
			||||||
	minetest.get_meta(vector.add(pos, dir)):set_int("last_moved", minetest.get_gametime())
 | 
						minetest.get_meta(vector.add(pos, dir)):set_int("last_moved", minetest.get_gametime())
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
minetest.register_node("technic:frame_motor",{
 | 
					minetest.register_node("technic:frame_motor",{
 | 
				
			||||||
	description = S("Frame Motor"),
 | 
						description = S("Frame Motor"),
 | 
				
			||||||
	tiles = {
 | 
						tiles = {"pipeworks_filter_top.png^[transformR90", "technic_lv_cable.png", "technic_lv_cable.png",
 | 
				
			||||||
		"pipeworks_filter_top.png^[transformR90", "technic_lv_cable.png", "technic_lv_cable.png",
 | 
							"technic_lv_cable.png", "technic_lv_cable.png", "technic_lv_cable.png"},
 | 
				
			||||||
		"technic_lv_cable.png", "technic_lv_cable.png", "technic_lv_cable.png"
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,mesecon=2},
 | 
						groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,mesecon=2},
 | 
				
			||||||
	paramtype2 = "facedir",
 | 
						paramtype2 = "facedir",
 | 
				
			||||||
	mesecons={effector={action_on=frame_motor_on}},
 | 
						mesecons={effector={action_on=frame_motor_on}},
 | 
				
			||||||
 | 
					 | 
				
			||||||
	after_place_node = function(pos, placer, itemstack)
 | 
						after_place_node = function(pos, placer, itemstack)
 | 
				
			||||||
		local meta = minetest.get_meta(pos)
 | 
							local meta = minetest.get_meta(pos)
 | 
				
			||||||
		meta:set_string("owner", placer:get_player_name())
 | 
							meta:set_string("owner", placer:get_player_name())
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
 | 
					 | 
				
			||||||
	frames_can_connect=function(pos,dir)
 | 
						frames_can_connect=function(pos,dir)
 | 
				
			||||||
		local node = minetest.get_node(pos)
 | 
							local node = minetest.get_node(pos)
 | 
				
			||||||
		local dir2 = ({
 | 
							local dir2 = ({{x=0,y=1,z=0},{x=0,y=0,z=1},{x=0,y=0,z=-1},{x=1,y=0,z=0},{x=-1,y=0,z=0},{x=0,y=-1,z=0}})[math.floor(node.param2/4)+1]
 | 
				
			||||||
			{ x= 0 , y = 1, z = 0 }, { x = 0, y = 0, z = 1 },
 | 
					 | 
				
			||||||
			{ x = 0, y = 0, z = -1 }, { x = 1, y = 0, z = 0 },
 | 
					 | 
				
			||||||
			{ x = -1, y = 0, z = 0 }, { x = 0, y = -1, z = 0 }
 | 
					 | 
				
			||||||
		})[math.floor(node.param2 / 4) + 1]
 | 
					 | 
				
			||||||
		return dir2.x~=-dir.x or dir2.y~=-dir.y or dir2.z~=-dir.z
 | 
							return dir2.x~=-dir.x or dir2.y~=-dir.y or dir2.z~=-dir.z
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
@@ -640,19 +575,13 @@ minetest.register_node("technic:frame_motor", {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
-- Templates
 | 
					-- Templates
 | 
				
			||||||
local function template_connected(pos,c,connectors)
 | 
					local function template_connected(pos,c,connectors)
 | 
				
			||||||
	local vects = {
 | 
						for _,vect in ipairs({{x=0,y=1,z=0},{x=0,y=0,z=1},{x=0,y=0,z=-1},{x=1,y=0,z=0},{x=-1,y=0,z=0},{x=0,y=-1,z=0}}) do
 | 
				
			||||||
		{ x = 0, y = 1, z = 0 }, { x = 0, y = 0, z = 1 },
 | 
					 | 
				
			||||||
		{ x = 0, y = 0, z = -1 }, { x = 1, y = 0, z = 0 },
 | 
					 | 
				
			||||||
		{ x = -1, y = 0, z = 0 }, { x = 0, y = -1, z = 0 }
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	for _, vect in ipairs(vects) do
 | 
					 | 
				
			||||||
		local pos1=vector.add(pos,vect)
 | 
							local pos1=vector.add(pos,vect)
 | 
				
			||||||
		local nodename=minetest.get_node(pos1).name
 | 
							local nodename=minetest.get_node(pos1).name
 | 
				
			||||||
		if not pos_in_list(c, pos1) and (nodename == "technic:template" or
 | 
							if not(pos_in_list(c,pos1)) and (nodename=="technic:template" or nodename == "technic:template_connector")then
 | 
				
			||||||
				nodename == "technic:template_connector") then
 | 
					 | 
				
			||||||
			local meta = minetest.get_meta(pos1)
 | 
								local meta = minetest.get_meta(pos1)
 | 
				
			||||||
			if meta:get_string("connected") == "" then
 | 
								if meta:get_string("connected") == "" then
 | 
				
			||||||
				c[#c + 1] = pos1
 | 
									c[#(c)+1]=pos1
 | 
				
			||||||
				template_connected(pos1,c,connectors)
 | 
									template_connected(pos1,c,connectors)
 | 
				
			||||||
				if nodename == "technic:template_connector" then
 | 
									if nodename == "technic:template_connector" then
 | 
				
			||||||
					connectors[#connectors+1] = pos1
 | 
										connectors[#connectors+1] = pos1
 | 
				
			||||||
@@ -679,7 +608,7 @@ local function swap_template(pos, new)
 | 
				
			|||||||
	local saved_node = meta:get_string("saved_node")
 | 
						local saved_node = meta:get_string("saved_node")
 | 
				
			||||||
	meta:set_string("saved_node", "")
 | 
						meta:set_string("saved_node", "")
 | 
				
			||||||
	technic.swap_node(pos, new)
 | 
						technic.swap_node(pos, new)
 | 
				
			||||||
	meta = minetest.get_meta(pos)
 | 
						local meta = minetest.get_meta(pos)
 | 
				
			||||||
	meta:set_string("saved_node", saved_node)
 | 
						meta:set_string("saved_node", saved_node)
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -695,7 +624,6 @@ local function save_node(pos)
 | 
				
			|||||||
		meta:set_string("connected", "")
 | 
							meta:set_string("connected", "")
 | 
				
			||||||
		return
 | 
							return
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
 | 
					 | 
				
			||||||
	local meta = minetest.get_meta(pos)
 | 
						local meta = minetest.get_meta(pos)
 | 
				
			||||||
	local meta0 = meta:to_table()
 | 
						local meta0 = meta:to_table()
 | 
				
			||||||
	for _, list in pairs(meta0.inventory) do
 | 
						for _, list in pairs(meta0.inventory) do
 | 
				
			||||||
@@ -703,7 +631,6 @@ local function save_node(pos)
 | 
				
			|||||||
			list[key] = stack:to_string()
 | 
								list[key] = stack:to_string()
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
 | 
					 | 
				
			||||||
	node.meta = meta0
 | 
						node.meta = meta0
 | 
				
			||||||
	minetest.set_node(pos, {name="technic:template"})
 | 
						minetest.set_node(pos, {name="technic:template"})
 | 
				
			||||||
	return node
 | 
						return node
 | 
				
			||||||
@@ -723,27 +650,25 @@ end
 | 
				
			|||||||
local function expand_template(pos)
 | 
					local function expand_template(pos)
 | 
				
			||||||
	local meta = minetest.get_meta(pos)
 | 
						local meta = minetest.get_meta(pos)
 | 
				
			||||||
	local c = meta:get_string("connected")
 | 
						local c = meta:get_string("connected")
 | 
				
			||||||
 | 
					 | 
				
			||||||
	if c == "" then return end
 | 
						if c == "" then return end
 | 
				
			||||||
	c = minetest.deserialize(c)
 | 
						c = minetest.deserialize(c)
 | 
				
			||||||
 | 
					 | 
				
			||||||
	for _, vect in ipairs(c) do
 | 
						for _, vect in ipairs(c) do
 | 
				
			||||||
		local pos1 = vector.add(pos, vect)
 | 
							local pos1 = vector.add(pos, vect)
 | 
				
			||||||
		local saved_node = save_node(pos1)
 | 
							local saved_node = save_node(pos1)
 | 
				
			||||||
		local meta1 = minetest.get_meta(pos1)
 | 
							local meta1 = minetest.get_meta(pos1)
 | 
				
			||||||
		if saved_node ~= nil then
 | 
							if saved_node ~= nil then
 | 
				
			||||||
			meta1:set_string("saved_node", minetest.serialize(saved_node))
 | 
								meta1:set_string("saved_node", minetest.serialize(saved_node))
 | 
				
			||||||
 | 
							else
 | 
				
			||||||
 | 
								--meta1:set_string("saved_node", "")
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local function compress_templates(pos)
 | 
					local function compress_templates(pos)
 | 
				
			||||||
	local templates, connectors = get_templates(pos)
 | 
						local templates, connectors = get_templates(pos)
 | 
				
			||||||
 | 
					 | 
				
			||||||
	if #connectors == 0 then
 | 
						if #connectors == 0 then
 | 
				
			||||||
		connectors = {pos}
 | 
							connectors = {pos}
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
 | 
					 | 
				
			||||||
	for _, cn in ipairs(connectors) do
 | 
						for _, cn in ipairs(connectors) do
 | 
				
			||||||
		local meta = minetest.get_meta(cn)
 | 
							local meta = minetest.get_meta(cn)
 | 
				
			||||||
		local c = {}
 | 
							local c = {}
 | 
				
			||||||
@@ -756,7 +681,7 @@ local function compress_templates(pos)
 | 
				
			|||||||
		local cc = {}
 | 
							local cc = {}
 | 
				
			||||||
		for _,p in ipairs(connectors) do
 | 
							for _,p in ipairs(connectors) do
 | 
				
			||||||
			local np = vector.subtract(p, cn)
 | 
								local np = vector.subtract(p, cn)
 | 
				
			||||||
			if np.x ~= 0 or np.y ~= 0 or np.z ~= 0 then
 | 
								if (np.x ~= 0 or np.y ~= 0 or np.z ~= 0) then
 | 
				
			||||||
				cc[pos_to_string(np)] = true
 | 
									cc[pos_to_string(np)] = true
 | 
				
			||||||
			end
 | 
								end
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
@@ -776,7 +701,6 @@ local function template_drops(pos, node, oldmeta, digger)
 | 
				
			|||||||
	local c = oldmeta.fields.connected
 | 
						local c = oldmeta.fields.connected
 | 
				
			||||||
	local cc = oldmeta.fields.connectors_connected
 | 
						local cc = oldmeta.fields.connectors_connected
 | 
				
			||||||
	local drops
 | 
						local drops
 | 
				
			||||||
 | 
					 | 
				
			||||||
	if c == "" or c == nil then
 | 
						if c == "" or c == nil then
 | 
				
			||||||
		drops = {"technic:template 1"}
 | 
							drops = {"technic:template 1"}
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
@@ -798,7 +722,7 @@ local function template_drops(pos, node, oldmeta, digger)
 | 
				
			|||||||
				end
 | 
									end
 | 
				
			||||||
			else
 | 
								else
 | 
				
			||||||
				local stack_max = 99
 | 
									local stack_max = 99
 | 
				
			||||||
				local num = #minetest.deserialize(c)
 | 
									local num = #(minetest.deserialize(c))
 | 
				
			||||||
				drops = {}
 | 
									drops = {}
 | 
				
			||||||
				while num > stack_max do
 | 
									while num > stack_max do
 | 
				
			||||||
					drops[#drops+1] = "technic:template "..stack_max
 | 
										drops[#drops+1] = "technic:template "..stack_max
 | 
				
			||||||
@@ -808,7 +732,6 @@ local function template_drops(pos, node, oldmeta, digger)
 | 
				
			|||||||
			end
 | 
								end
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
 | 
					 | 
				
			||||||
	minetest.handle_node_drops(pos, drops, digger)
 | 
						minetest.handle_node_drops(pos, drops, digger)
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -841,7 +764,7 @@ minetest.register_node("technic:template_disabled", {
 | 
				
			|||||||
	on_destruct = template_on_destruct,
 | 
						on_destruct = template_on_destruct,
 | 
				
			||||||
	after_dig_node = template_drops,
 | 
						after_dig_node = template_drops,
 | 
				
			||||||
	on_punch = function(pos,node,puncher)
 | 
						on_punch = function(pos,node,puncher)
 | 
				
			||||||
	local _ = minetest.get_meta(pos)
 | 
						local meta = minetest.get_meta(pos)
 | 
				
			||||||
		swap_template(pos, "technic:template_connector")
 | 
							swap_template(pos, "technic:template_connector")
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
@@ -883,7 +806,7 @@ minetest.register_tool("technic:template_tool", {
 | 
				
			|||||||
	inventory_image = "technic_template_tool.png",
 | 
						inventory_image = "technic_template_tool.png",
 | 
				
			||||||
	on_use = function(itemstack, puncher, pointed_thing)
 | 
						on_use = function(itemstack, puncher, pointed_thing)
 | 
				
			||||||
		local pos = pointed_thing.under
 | 
							local pos = pointed_thing.under
 | 
				
			||||||
		if pos == nil or minetest.is_protected and minetest.is_protected(pos, puncher:get_player_name()) then
 | 
							if pos == nil or (minetest.is_protected and minetest.is_protected(pos, puncher:get_player_name())) then
 | 
				
			||||||
			return nil
 | 
								return nil
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
		local node = minetest.get_node(pos)
 | 
							local node = minetest.get_node(pos)
 | 
				
			||||||
@@ -912,18 +835,14 @@ local function get_template_nodes(pos)
 | 
				
			|||||||
		local pos1=vector.add(pos,vect)
 | 
							local pos1=vector.add(pos,vect)
 | 
				
			||||||
		local nodename=minetest.get_node(pos1).name
 | 
							local nodename=minetest.get_node(pos1).name
 | 
				
			||||||
		if not(pos_in_list(c,pos1)) and nodename~="air" then
 | 
							if not(pos_in_list(c,pos1)) and nodename~="air" then
 | 
				
			||||||
			c[#c + 1] = pos1
 | 
								c[#(c)+1]=pos1
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
	return c
 | 
						return c
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local function template_motor_on(pos, node)
 | 
					local function template_motor_on(pos, node)
 | 
				
			||||||
	local dirs = {
 | 
						local dirs = {{x=0,y=1,z=0},{x=0,y=0,z=1},{x=0,y=0,z=-1},{x=1,y=0,z=0},{x=-1,y=0,z=0},{x=0,y=-1,z=0}}
 | 
				
			||||||
		{ x = 0, y = 1, z = 0 }, { x = 0, y = 0, z = 1 },
 | 
					 | 
				
			||||||
		{ x = 0, y = 0, z = -1 }, { x = 1, y = 0, z = 0 },
 | 
					 | 
				
			||||||
		{ x = -1, y = 0, z = 0 }, { x = 0, y = -1, z = 0 }
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	local nnodepos = vector.add(pos, dirs[math.floor(node.param2/4)+1])
 | 
						local nnodepos = vector.add(pos, dirs[math.floor(node.param2/4)+1])
 | 
				
			||||||
	local dir = minetest.facedir_to_dir(node.param2)
 | 
						local dir = minetest.facedir_to_dir(node.param2)
 | 
				
			||||||
	local nnode=minetest.get_node(nnodepos)
 | 
						local nnode=minetest.get_node(nnodepos)
 | 
				
			||||||
@@ -941,14 +860,8 @@ end
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
minetest.register_node("technic:template_motor",{
 | 
					minetest.register_node("technic:template_motor",{
 | 
				
			||||||
	description = S("Template Motor"),
 | 
						description = S("Template Motor"),
 | 
				
			||||||
	tiles = {
 | 
						tiles = {"pipeworks_filter_top.png^[transformR90", "technic_lv_cable.png", "technic_lv_cable.png",
 | 
				
			||||||
		"pipeworks_filter_top.png^[transformR90",
 | 
							"technic_lv_cable.png", "technic_lv_cable.png", "technic_lv_cable.png"},
 | 
				
			||||||
		"technic_lv_cable.png",
 | 
					 | 
				
			||||||
		"technic_lv_cable.png",
 | 
					 | 
				
			||||||
		"technic_lv_cable.png",
 | 
					 | 
				
			||||||
		"technic_lv_cable.png",
 | 
					 | 
				
			||||||
		"technic_lv_cable.png"
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,mesecon=2},
 | 
						groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,mesecon=2},
 | 
				
			||||||
	paramtype2 = "facedir",
 | 
						paramtype2 = "facedir",
 | 
				
			||||||
	mesecons={effector={action_on=template_motor_on}},
 | 
						mesecons={effector={action_on=template_motor_on}},
 | 
				
			||||||
@@ -963,7 +876,7 @@ minetest.register_craft({
 | 
				
			|||||||
	output = 'technic:frame_111111',
 | 
						output = 'technic:frame_111111',
 | 
				
			||||||
	recipe = {
 | 
						recipe = {
 | 
				
			||||||
		{'',			'default:stick',	''},
 | 
							{'',			'default:stick',	''},
 | 
				
			||||||
		{ 'default:stick', 'basic_materials:brass_ingot', 'default:stick' },
 | 
							{'default:stick',	'technic:brass_ingot',	'default:stick'},
 | 
				
			||||||
		{'',			'default:stick',	''},
 | 
							{'',			'default:stick',	''},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
@@ -972,7 +885,7 @@ minetest.register_craft({
 | 
				
			|||||||
	output = 'technic:frame_motor',
 | 
						output = 'technic:frame_motor',
 | 
				
			||||||
	recipe = {
 | 
						recipe = {
 | 
				
			||||||
		{'',					'technic:frame_111111',	''},
 | 
							{'',					'technic:frame_111111',	''},
 | 
				
			||||||
		{ 'group:mesecon_conductor_craftable', 'basic_materials:motor',        'group:mesecon_conductor_craftable' },
 | 
							{'group:mesecon_conductor_craftable',	'technic:motor',	'group:mesecon_conductor_craftable'},
 | 
				
			||||||
		{'',					'technic:frame_111111',	''},
 | 
							{'',					'technic:frame_111111',	''},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
@@ -980,9 +893,9 @@ minetest.register_craft({
 | 
				
			|||||||
minetest.register_craft({
 | 
					minetest.register_craft({
 | 
				
			||||||
	output = 'technic:template 10',
 | 
						output = 'technic:template 10',
 | 
				
			||||||
	recipe = {
 | 
						recipe = {
 | 
				
			||||||
		{ '',                    'basic_materials:brass_ingot',  '' },
 | 
							{'',			'technic:brass_ingot',	''},
 | 
				
			||||||
		{ 'basic_materials:brass_ingot', 'default:mese_crystal', 'basic_materials:brass_ingot' },
 | 
							{'technic:brass_ingot',	'default:mese_crystal',	'technic:brass_ingot'},
 | 
				
			||||||
		{ '',                    'basic_materials:brass_ingot',  '' },
 | 
							{'',			'technic:brass_ingot',	''},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1000,7 +913,7 @@ minetest.register_craft({
 | 
				
			|||||||
	output = 'technic:template_motor',
 | 
						output = 'technic:template_motor',
 | 
				
			||||||
	recipe = {
 | 
						recipe = {
 | 
				
			||||||
		{'',					'technic:template',	''},
 | 
							{'',					'technic:template',	''},
 | 
				
			||||||
		{ 'group:mesecon_conductor_craftable', 'basic_materials:motor',    'group:mesecon_conductor_craftable' },
 | 
							{'group:mesecon_conductor_craftable',	'technic:motor',	'group:mesecon_conductor_craftable'},
 | 
				
			||||||
		{'',					'technic:template',	''},
 | 
							{'',					'technic:template',	''},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,13 +3,6 @@ local path = technic.modpath.."/machines/other"
 | 
				
			|||||||
-- mesecons and tubes related
 | 
					-- mesecons and tubes related
 | 
				
			||||||
dofile(path.."/injector.lua")
 | 
					dofile(path.."/injector.lua")
 | 
				
			||||||
dofile(path.."/constructor.lua")
 | 
					dofile(path.."/constructor.lua")
 | 
				
			||||||
 | 
					if minetest.get_modpath("mesecons_mvps") ~= nil then
 | 
				
			||||||
if technic.config:get_bool("enable_frames") and minetest.get_modpath("mesecons_mvps") ~= nil then
 | 
					 | 
				
			||||||
	dofile(path.."/frames.lua")
 | 
						dofile(path.."/frames.lua")
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					 | 
				
			||||||
-- Coal-powered machines
 | 
					 | 
				
			||||||
dofile(path.."/coal_alloy_furnace.lua")
 | 
					 | 
				
			||||||
dofile(path.."/coal_furnace.lua")
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
dofile(path.."/anchor.lua")
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||