Commit Graph

37 Commits

Author SHA1 Message Date
David Leal a8daa417c4
Add GitHub workflow and luacheck (#545)
Add badge to README
Fix luacheck warnings
Remove node_ownership globals (and support)
2020-06-12 20:39:00 +02:00
coil d119a67482 Refactor switching station ABMs (#508)
When the function is defined inside the ABM, a new closure is allocated every time the ABM runs. 
Since the action function is already way too long, it's better for readability and performance to split it out.
2019-08-26 19:45:11 +02:00
HybridDog 41f175986d Show EU power values more readable (#424)
Add the EU_string helper function
In comparison to pretty_num it uses SI prefixes, adds "EU" (e.g. kEU) and rounds the number for readability
Add a constant_digit_count boolean setting
2018-07-16 17:26:39 +02:00
number Zero 86fb981b44 Fix O(n^2) network traversal 2018-02-13 18:25:44 +01:00
Ekdohibs 215de5487b Fix redundant_warn 2018-01-13 10:30:22 +01:00
Vanessa Ezekowitz a84b5f3b28 print warning to console if redundant switching station is found
and where it is

only prints the warning once per redundant station, per minetest
session. if there are multiple redundant stations on a network, digging
one should cause the warning to appear for the next one technic finds,
if it doesn't show them all right away.
2017-07-03 18:05:52 -04:00
Vanessa Ezekowitz 9d5bd90b57 add chat command to allow disabling of switching station ABM
(for situations where a user creates a laggy machine on a public server, use
this to suspend power distribution until the machine is found and disabled)

`/powerctrl off` to disable
`/powerctrl on` to reenable

(actually, anything but "on" disables it)
2017-07-03 17:35:19 -04:00
you 987cc5a6a4 Add api documentation (#361) 2017-06-05 10:51:59 -04:00
Vanessa Ezekowitz 54004f4951 redo top/bottom textures for supply converter
delete back/bottom texture for power monitor
use "machine bottom" for bottom of force field generator
add cable connection overlay, use it on various machines' bottoms/sides, as appropriate
2017-04-11 08:48:16 -04:00
DS-Minetest 338f3b6a99 Make battery box send information via digilines. 2017-04-01 16:47:34 -03:00
Vanessa Ezekowitz 78f16c3e8e label all ABMs for profiler 2017-03-31 19:15:25 -04:00
DS-Minetest 6abd857b3f Add digiline support to switching station.
Makes the switching station able to send supply and demand
via digilines.
2017-03-28 09:30:59 -03:00
Maciej 'agaran' Pijanka 10307f23a7 Do not run converters twice. 2017-03-15 19:00:22 -04:00
Carter Kolwey 088eea1e3b Fixes for network calculation issues
This fixes several issues:
* More than one switching station could become active on large networks
 - Switching stations now semi-permanently become disabled if another is present
 - Power monitors have been added to replace the function of "slave" switching stations, to discourage overuse of switching stations
* Networks did not reliably "split" when cutting a cable
 - I "may" have caused this issue, but I believe it is solved by this
* Machines did not run without a player near the switching station
 - Active switching stations now forceload themselves, and free the forceloaded block if disabled, dug, or disconnected
 - Machines are only loaded to run them (as before), so only one mapblock (or two if the bottom edge of the switching station is a mapblock boundary) is loaded
 - Cables are still only loaded during a full network recalculation
2017-03-10 01:35:58 -06:00
Carter Kolwey d3f40e0fd0 Only update the associated network(s) when placing/digging nodes 2017-03-05 04:09:23 -06:00
ShadowNinja 85a984982c Cleanup
Changes:
  * Make rayIter a global utility, and use it for radiation too.
  * prettynum -> pretty_num and cleanup.
  * Remove resolve_name/function_exists (unused).
  * Cleanup nuclear reactor code.
2016-03-20 00:02:33 -04:00
ShadowNinja 83c6494166 Use connected nodeboxes for cables 2016-03-20 00:02:33 -04:00
Tim c6464d3ebe label the switching station abm for profiling purposes
this allows the mtt profiler to profile this abm individually from other abms since t4im/mtt@48eff13
2015-02-28 00:47:15 +01:00
est31 4b179821d3 Get rid of technic.format 2015-02-13 21:13:17 +01:00
est31 9444eff7f7 Make switching station only react to nodes from below 2015-02-02 05:29:44 +01:00
est31 d9bf9830b0 Better number formating
Is it 120000 or 1200000?
2015-01-31 01:29:16 -05:00
est31 c38da0945c Optimize quarry_run
Don't load the whole digging area when only a small piece is relevant.
Also, move the (time expensive) check whether the air above a block is free to the last position, which spares unneccessary checks when multiple quarries are placed together, or a quarry has to loop over air for another reason.
2015-01-24 19:40:02 +01:00
Novatux 4ac36e9d27 Fix infinite energy with supply converter 2014-12-30 12:10:36 +01:00
Kevin Zheng 7cfb3874a3 Evenly distribute charge across multiple batteries 2014-08-06 12:08:48 -05:00
Vanessa Ezekowitz 29c7ff5228 don't attempt to force-load blocks if they're already loaded. 2014-07-23 10:00:13 -04:00
Novatux 1c617f2c5e Make unconnected generators burn the fuel they still have. 2014-07-12 09:50:50 +02:00
Novatux 563a4c071d Make switching station run all machines it is connected to, including those in unloaded blocks. 2014-07-11 11:00:46 +02:00
Zefram e8a5a6652d Use machine casing in most machine recipes 2014-07-09 09:17:43 +02:00
Zefram 623fcae4a4 Fix supply converter
Its registration as a battery (BA) node didn't work.  It needs to be
registered as both a producer (PR) and a receiver (RE).
2014-05-24 00:24:30 +02:00
Zefram 68b7bcc28e split default iron/steel into three metals
Override the default mod's iron/steel substance, replacing it with three
metals: wrought iron (pure iron), carbon steel (iron alloyed with a little
carbon), and cast iron (iron alloyed with lots of carbon).  Wrought iron
is easiest to refine, then cast iron, and carbon steel the most difficult,
matching the historical progression.  Recipes that used default steel are
changed to use one of the three, the choice of alloy for each application
being both somewhat realistic and also matching up with game progression.

The default:steel{_ingot,block} items are identified specifically with
wrought iron.  This makes the default refining recipes work appropriately.
Iron-using recipes defined outside technic are thus necessarily
reinterpreted to use wrought iron, which is mostly appropriate.
Some objects are renamed accordingly.

Rather than use the default steel textures for wrought iron, with technic
providing textures for the other two, technic now provides textures for
all three metals.  This avoids problems that would occur with texture
packs that provide default_steel_{ingot,block} textures that are not
intended to support this wrought-iron/carbon-steel/cast-iron distinction.
A texture pack can provide a distinct set of three textures specifically
for the situation where this distinction is required.

Incidentally make grinding and alloy cooking recipes work correctly when
ingredients are specified by alias.
2014-05-22 20:57:50 +02:00
ShadowNinja d8437faebc More global localiztions 2013-12-17 19:56:01 -05:00
ShadowNinja be2f30a1a2 Add support for translations via intllib 2013-10-30 13:48:39 -04:00
Novatux 468d79db61 Bugfixes with energy branch.
Conflicts:
	technic/machines/switching_station.lua
2013-10-04 10:50:51 -04:00
Novatux 12d29c2139 Forgot to update on cable add/destroy+use minetest.hash_node_position because else it did not work. 2013-10-04 10:49:06 -04:00
Novatux f4ac2b8c1e Make power distribution more efficient.
Conflicts:
	technic/machines/register/cables.lua
2013-10-04 10:48:39 -04:00
ShadowNinja ee0765804c Partial rewrite 2013-09-17 16:37:56 -04:00
ShadowNinja 5d470cd753 Move files to subfolders 2013-07-11 12:31:00 -04:00