Usage and tool break sounds were played at 'pointed_thing.above' which
can be nil if not pointing at anything or at an entity. This caused
sounds to be played to all players on a server non-positionally.
Fallback to player pos for sounds if 'pointed_thing.above' is nil.
Replace 'pt' variable with 'pointed_thing' in 'register_tool'.
TNT removes flammable nodes from the destruction radius and should
remove flames within it too because they lose their fuel and would
be removed by ABM later anyway.
Previous code:
Used looped sounds without attaching them to objects or playing direct
to players.
The looped sounds are not 'stopped' when players leave the area.
These may be causing the bug where sounds are heard at extreme
distances.
Entering a world with already present flames results in silent flames.
Sounds are often played at a large number of points in a 6 node lattice.
A large fire is reported to cause a high load, disabling the sound code
is reported to help this.
New code:
Optional flame sound to not interfere with ambience mods.
Permanent flame now has sound.
For multiple flames, sound is positioned at the centre of all flames, and
has volume determined by flame number.
The original freesound 'large fire' recording was used to create 3 sounds
that play at random for a non-repetitive effect. At low volume it is
suitable for small fires.
Original sound files and sound function (as an empty function) kept
temporarily to reduce disruption.
Reduce gain of flame extinguish sound.
Enable ignition of tnt, gunpowder and permanent
flame above coalblock using flint and steel
Override coalblock to remove flame above when dug
Add depends.txt for default mod
Because the fire nodes are not removed 100% when there are
no more burnable nodes nearby, they can potentially stay around
for very, very long times, leading to ABM trains every 5 seconds
for no good reason (only 1 in 16 will be removed every interval).
A much better method to remove fire nodes is to remove them by
timer, and give removal a 100% chance if no flammable nodes are
adjacent. This makes fire cleanup a lot faster and more natural,
and will reduce the amount of ABM hits making fire overall more
responsive.
We also remove the 1 in 4 chance and fold the removal of flammable
nodes into the ABM chance.
There's some low hanging fruit cleanups in here as well.
Spread ABM intervals evenly across 1 to 16 seconds
16s ensures no nodes are missed when player walks past
Adjust chance values to compensate, for identical action rates
Combine lavacooling ABMs into one, return to chance = 1
Grass growth: add 'neighbors = "air"' to avoid
processing the thousands of underground dirt nodes
Grass death: Reduce action rate to that of grass growth
Fire: Use chance = 1 for flame extinguishing
and flame removal when mod is disabled
Add extinguish sounds (from default mod lavacooling)
'disable fire' setting extinguishes fire quickly using a dedicated ABM
'disable fire' also disables all other ABMs
Simplify flammable node removal ABM
Speed up node ignition, it was too slow
Add 'sunlight propagates = true' and 'paramtype = "light" to flame
Balance fire sounds' gain