Commit Graph

33 Commits

Author SHA1 Message Date
SmallJoker 0f6bdb1bde Correct (almost) all luacheck warnings
Also includes a few code opimizations:
- Combined mining drill functions
- Shorter alias registration (unused?)
- Add TODOs to address later
2022-06-06 21:04:13 +02:00
Lejo b81d1d3f2d Check protection of the forcefield and Quarry (#468) 2019-04-13 20:45:49 +02:00
Thomas Rudin c14521cbd2 Quarry: Fix server freeze when max depth is reduced (#487)
Endless loop if max-depth is changed but some quarries are below that new limit
The old comparison (~=) did not account for that
2019-03-02 11:14:05 +01:00
Thomas Rudin 701240bc3a Quarry: Check for valid facedir to fix server freeze #465 (#466)
Checks if facedir is valid. If the face points up or down the depth-check would run endless and freeze the server
2018-12-09 16:01:10 +01:00
Thomas Rudin 3d52b679b0 Quarry: Make use of fake digger from pipeworks (#453)
Fixes crash when digging empty protected chests (https://github.com/minetest/minetest_game/blob/backport-0.4/mods/default/nodes.lua#L1868)
2018-11-16 21:36:03 +01:00
Vanessa Dannenberg 44cb8df048 use basic_materials mod where possible. 2018-11-11 09:54:20 +01:00
thetaepsilon-gamedev c93bfefd9f machines/HV/quarry.lua: [modification] provide a basic digger object to can_dig callbacks to prevent nil object errors (#425)
Minetest game's doors mod was known to cause server errors when passed a nil digger in it's can_dig callback,
due to always attempting to invoke digger:get_player_name().
Fix this by providing a basic fake player which provides this method to can_dig callbacks.
(It should be noted that currently this fix causes doors to be undiggable by quarries.)
2018-05-19 22:06:00 +02:00
Vitaliy 689766f15a Remove unused values (#407) 2018-02-17 11:00:15 -08: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
Vanessa Ezekowitz 0e9caf069d add pipeworks tube overlay to top of quarry
(and get rid of obsolete inventorycube() image)
2017-04-11 08:09:53 -04:00
Tim 428b1b8709 Mitigate several forms of quarry-placement leading to item-transportation loops, that eventually cause server freezes.
As a nice side effect, items are not gonna be unnecessarily received by the quarry anymore, if another tube is available for transport.
2016-10-09 17:46:06 +02:00
ShadowNinja 83c6494166 Use connected nodeboxes for cables 2016-03-20 00:02:33 -04:00
est31 f250e1632f Give quarries a better inventory icon
Current inventory icon is indistinguishable from carbon steel block. The side with the pick was hidden. This commit moves that part to the front.
2015-01-24 21:23:26 +01:00
est31 86dd5852aa Add cache to quarry
Adds a cache to the quarry in order to reduce load and send larger stacks through pipes instead of just single items. Coin tossing ensures the cache gets purged around every 200 seconds. The interval isn't fixed in order to prevent material spikes from multiple quarries which got loaded simultaneously. When the cache is full, or the quarry finished, it is purged too.
2015-01-24 21:22:49 +01: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
Zefram d0efa15b98 In quarry, skip past undiggable nodes
The quarry used to get stuck when it encountered an undiggable node.
Change it to skip past that node, digging whatever later stuff it can.
Necessarily, the current digging position becomes semantically-significant
state: it is no longer sufficient to search the quarry cuboid from the top
on each iteration.  The current digging height is reported in the quarry's
interaction form, and can be reset to the top using a button on the form.

Where there is a non-air node within the quarry directly above the
next node to dig, it blocks the quarry's access to that node, even if
everything involved is diggable.  Thus an undiggable node casts a shadow
of undug nodes below it.  Resolving undiggability of a node is a major
reason to use the restart button.
2014-08-18 15:14:15 +01:00
Zefram 049129d9b8 Handle both pipeworks APIs
The new API function is now renamed to pipeworks.tube_inject_item(),
so use it under that name.  If it is not available, synthesise the new
API in terms of the old one.
2014-08-15 13:23:41 +02:00
Novatux baf7f61665 Compatibility with latest pipeworks 2014-08-14 21:29:56 +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 5e4a87b925 Rework some recipes to use more varied ingredients 2014-07-09 09:17:44 +02:00
Zefram 68ea0acbd0 Consistently use cable in electric machine recipes
All electric machine recipes now include cable of the appropriate tier
as the bottom-middle ingredient, immediately below the casing ingredient.
Many LV machines were using a copper ingot in that location.
2014-07-09 09:17:43 +02:00
Zefram e8a5a6652d Use machine casing in most machine recipes 2014-07-09 09:17:43 +02:00
Zefram 7c4b7046cc Rationalise machine terminology
All electrically-powered machines now consistently indicate their
tier (supply voltage) in their names.  As this implies that they are
electrically powered, the furnaces no longer have "Electric" in their
names.  The fuel-fired equivalents of electric machines, which exist
for alloy furnace and furnace, now say "Fuel-Fired" to distinguish them.
(The fuel-fired alloy furnace used to say "Coal", which was inaccurate
because it uses any fuel.  The fuel-fired furnace, from the default mod,
used to just be called "Furnace", which is ambiguous.)

Electric power generators now consistently indicate their tier and have
the word "Generator" in their names.  This makes their purpose much
clearer, and makes obvious craft guide searches produce useful results.
The fuel-fired generators, previously just (ambiguously) called
"Generator", are now explicitly "Fuel-Fired".
2014-06-21 01:21:52 +02:00
Zefram b74c2d38b9 Better quarry control dialog
The size configuration is no longer cleared when exiting the dialog with
<esc>.  The enable/disable toggle button now indicates the current state.
The name of the toggle button now varies according to state, so that
pressing the button multiple times in one state (which can arise due
to lag making the user unsure about whether the first press registered)
only makes the state change that the user requested, rather than toggling
repeatedly.
2014-05-24 00:26:24 +02:00
Zefram 4d20e4473e Stop quarry duplicating items
The quarry was digging via dig_node and also manually putting the node's
drops into the tube system.  This assumed that dig_node would attempt
to put the drops in the player's inventory, doing nothing if there is
no such inventory.  With the item_drop mod installed, dig_node would
instead turn the node into an item entity, so the quarry's strategy would
duplicate the item, making it appear both as an item entity in situ and
as an item in the tube.  Instead, the quarry must use remove_node when
it manually processes the drops, just like the pipeworks node breaker.
2014-05-24 00:25:19 +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 93b0d25cbc Use get_string for owner string 2013-12-29 10:59:04 -05:00
Vanessa Ezekowitz ae235ee8f3 more pipeworks API-change updates 2013-12-15 15:49:28 -05:00
Vanessa Ezekowitz 8ef3f20c3c adapt to changes in Pipeworks API 2013-12-15 15:03:41 -05:00
ShadowNinja bde49aca61 Fix crash when quarrying a protected area 2013-11-18 15:27:17 -05:00
ShadowNinja 2d8ff45d9a Fix crash with invalid radius 2013-11-15 00:54:17 -05:00
ShadowNinja be2f30a1a2 Add support for translations via intllib 2013-10-30 13:48:39 -04:00
ShadowNinja ee0765804c Partial rewrite 2013-09-17 16:37:56 -04:00