This changes the farming API such that any nodedef with paramtype2
and place_param2 are passed through to all the plant stages of the
farming plant.
This allows plants to use an alternative mesh for the plantlike
drawtype, and provide a bit of graphical variation in plants.
We enable this for wheat, using place_param2 = 3, which is the '#'
shaped plant mesh. If you would actually be able to give yourself
this plant in creative or through /give, you would also get the
same '#' shape.
Biomes:
Add 'sandstone desert', 'cold desert', 'snowy grassland'.
Rename 'glacier' biome to 'icesheet' biome.
Rename non-swamp 'swamp' biomes to 'shore' biomes.
Remove 'sandstone grassland' biome.
Rename 'stone grassland' biome to 'grassland' biome.
Edit biome points for improved similarity to Whittaker classification.
Change 'tundra' to bare stone with snowblocks.
Make dirt 'swamp' / 'shore' less deep.
Ores:
Make dirt blob ore biome-specific, limit to dirt biomes.
Decorations:
Make mushroom noise spread match that of appletrees as originally intended,
to have mushrooms spawn in darker thicker forest areas.
Add coral reefs in warm oceans.
Add bushes and acacia bushes.
Jungletrees in deeper water for larger swamps.
Register flower mod decorations in singlenode mapgen for use by
minetest.generate_registered_decorations, as in default/mapgen.lua.
Boats:
Previously, boats were not added to inventory in creative mode, fix.
In creative mode multiple boats will not be added to inventory.
Add comment.
Carts:
Set speed to 2 if punched by a non-player, to match the effect of a
player punch.
Add comments.
This is partly a workaround for a bug.
Climbs with continuous power rails were failing often due to
unexplained losses of speed leading to a reversal of direction.
The lack of acceleration on climbs meant that lost speed was not
regained.
Keeping cart speed at maximum on climbs helps reduce the chance of
reversals.
This also allows players to slowly accelerate up to full speed on a
climb without needing a horizontal run-up to reach full speed first.
It may not be possible to build the horizontal sections needed, or,
if players are replacing a previous carts mod their track
constructions, bridges, tunnels etc. will often not have the
horizontal sections needed.
Players will also sometimes need to place and enter a cart on a slope
and be able to climb.
- Improve arms attachment
The arm bones were at an angle, so that the bones were difficult
to orient correctly, as unintuitive combinations of angles
would be needed to get the default orientation, or any other
acceptable orientation. Moreover, a simple rotation of the arm,
e.g. forward, would require all angles to be adapted, instead
of just one.
The ends of the arms bones were moved from touching the body, to
the center of the arm, at an equal distance from the sides of the
arm and the shoulder; the arm bone is now in the center of the arm.
- Fix body rotation
The body was rotated 180° while the rest wasn't, leading to
strange results when setting bone positions manually.
- Fix default rotation of limbs (manually positioning them in
their default position would require an 180° rotation).
Is is not know how this was fixed. Maybe just because the
model was re-exported.
- The bone of the cape was moved to the center of the cape (it was
at the edge). For some reason this fixed the 180° rotation of the
cape when it was manually positioned (similar to previous issue).
The changes above fix most of the issues mentioned in #1376
- Add a player-model-specific workaround for the problem described in:
https://github.com/minetest/minetest/issues/2813#issuecomment-198796927https://github.com/minetest/minetest_game/pull/1392#issuecomment-261669915
During walking, attached tools would randomly switch hands. Walking also
happens to be the only animation where the body does not move. Making the
body move an imperceptible amount makes the issue disappear for the player
model.
- Fix body vertex group: it no longer includes parts of arms and legs
Thanks to @stujones11 for these last two changes.
This code adds the key concept to minetest_game, and integrates it
with lockable nodes. Currently supported lockable items are the Steel
Door, the Steel Trapdoor, and the Locked Chest.
The goal of this modification is to introduce a fine-grained multi-
player permission system that is intuitive and usable without any
console or chat commands, and doesn't require extra privileges to
be granted or setup. Keys can also physically be conveyed to other
players, adding to gameplay and adding some personality that is
preferable to console commands or editing formspecs.
A skeleton key can be crafted with 1 gold ingot. Skeleton keys can
then be matched to a lockable node by right-clicking the skeleton
key on a lockable node, which changes the skeleton key to a "key".
Gold was chosen as it's currently a not-so very useful item, and
therefore it's likely that players have some, but aren't really
using it for any purpose.
This key can subsequently used by any player to open or access that
lockable node, including retrieving items from Locked Chests, or
putting items in them.
They key is programmed to fit only the particular locked node it is
programmed to. This is achieved by storing a secret value in both
key and locked node. If this secret value doesn't match, the key
will not open the locked node. This allows many keys to be created
for one chest or door, but a key will only fit one node ever. The
secrets are stored in node, and item meta for the key.
If a locked node is removed, all keys that opened it are no longer
valid. Even if a new door/chest is placed in exactly the same spot,
the old keys will no longer fit that node.
Keys can be smelted back in gold ingots if they are no longer useful.
The method of storing a secret in nodemeta and itemstackmeta is secure
as there is no way for the client to create new items on the server
with a particular secret metadata value. Even if you could possible
create such an itemstack on the client, the server does not ever read
itemstackmeta from a client package.
The patch adds an API that allows other nodes and nodes added by
mods to use the same keys as well. The method how to implement this
is described in game_api.txt. The mod should add 2 callbacks to it's
node definition. Example code is given.
Textures are from PixelBOX, thanks to Gambit.
This merges the current state of the well-maintained and tested
`torches` mod as I've maintained it for the last 6 months.
This started out as a thorough cleanup of 3D torches by blockmen,
where some of the initial code still remains.
The models were redone entirely from scratch and have been extensively
tested with dozens of animated textures converted with mcimport,
and look a lot better than the original 3D Torches mod.
The ceiling torch is retained and functional. The `wieldlight`
addition that the torches mod has was removed, since it relies
on wieldview to look decent. This can stay external mod code.
I've opted to move the torch nodes to a separate file. It's not
a lot of code but nodes.lua is already huge, and I wanted to
retain the copyright header and some of the readme.txt notes,
and this was the easiest way of doing it.
This code passes "default:torch" to nodes with on_rightclick,
fixing problems with itemframes. Essentially it has a more
elaborate item_place() routine to make sure we're not passing
the wall torch to nodes that may display it.
The ceiling torch is a separate model and not the same as the
floor model. That does mean that there are 3 models in this
mod.
This is all the working code from SmallJoker's boost_cart, poored into
a more suitable form for minetest_game.
- Mesecons and moreores stuff was removed entirely.
- Textures were all renamed and moved out of default/
- Updated license, readme.txt, attribution
- Changed code license to MIT, left artwork at CC0
- removed default:rail and made aliases for it
- :carts:rail is now carts:rail.
- localized entity def
- removed copper rail entirely
- startstop rail was removed, as well as detector rail
- remodeled to b3d using stujones11 excellent blend model, but sizes
of cart adjusted to make pixel sizes consistent (0.625) everywhere.
- slightly more complex texture map for the cart (front/side visibly
different)
- rail parameters are passed as a separate def table, and stored in
a private list. This avoids having to call `get_meta` on every
node. In return, we need the node name, though.
- adds metal sounds (based on default metal sound function) and
cart moving sound.
- reduced cart speeds to max 7, 5 by pushing.
- Added on_step() rail event handler, gets called when a cart is on
a rail.
- Added various rebased updates from upstream (thanks Krock)
- Included a fix that removes the 'reverse jiggle' when stopping.
- Included reworked textures by sofar.
The mod namespace is still public, but I'm NOT declaring it an API. I'd
rather see it localized instead, for now. Any public interface in this
code is *experimental* at best, and should be considered non-stable and
unsupported for now.
Currently all minetest_game PR's are failing travis since the
upstream luacheck now also warns about whitespace issues, and
there are a few of those in the code. This fixes all of them
so we can yet again rely on luacheck.
With mip-mapping enabled, some GPUs cause a visual bug with indexed
textures that use alpha. This bug has been present for a while but
not noticed before. All indexed alpha textures must now be converted
to RGBA, to start this process we revert some textures converted to
indexed in the recent commit af3c918.
When placing boats, align the boat with the player's yaw.
Align drivers yaw with boat yaw when entering a boat, would previously turn
boat yaw by player's yaw + 90° to the right.
Make lava cooling ABM use a new group 'group:cools_lava'.
Nodes other than water can cool lava. We assume snowblock and ice melt,
turn to water and cool lava.
Leave 'group:water' present temporarily to not break mod liquids.
This fixes all cases where the color profile was broken, and
libpng warns about. It also makes almost all textures indexed
instead of RGB where possible (textures that don't have
semi-transparent pixels).
A deeper, darker level of leaves is created by tiling the texture
2 by 2, reducing brightness and offsetting this.
For a denser leaf appearence with the 'simple leaves' setting.
Also used for acacia bush leaves.
The purpose of this is to allow mods to be able to interact (e.g. fill up)
an empty bucket when it is used to punch a node that's not a liquid source
or when punching a custom entity (e.g. milking a cow).
- Use opaque texture for top+bottom of iron bar
- Add color variation for iron bar top/bottom
- Add paramat's texture to credits
- Update license info for paramat's textures
This plays when damage is disabled, an engine bug.
We can remove it because both sounds are identical, now it is removed
the 'player damage' sound still plays when falling damage is taken.
To allow mapgen bushes in green-grass and savanna grasslands.
Nodes for a generic bush and an acacia bush.
Stem nodes are craftable to a single wood node to provide a small
amount of wood resource in grasslands.
Fuel times are that of corresponding 'wood' nodes, 1/4 that of
corresponding tree nodes.
No leafdecay to enable use as hedges or without a nearby tree trunk.
Uses 'default leaves simple' texture for extra visual thickness.
Use 'player damage' sound for both damage and falling damage.
Gains for damage sounds are set in the engine, however we cannot change
those gains as other subgames already use damage sounds based on those
gains.
Sound has been re-edited from source and normalised to 0 dB for
maximum volume, which is only just enough because gain is fixed at 0.5
in the engine.
The check for igniters (fire/lava) will be performed every 10 secs
if the item is flammable.
if the item is found to be in lava it will then burn up and
disappear in a smoke puff.
If a non-lava igniter node is found, a combination of `flammable`
value of the item and `igniter` group value of the node will be used
to determine the chance for the item to be removed.
'jungleleaves simple' had completely different leaf colours to
'jungleleaves', now matched.
'leaves simple' had dark green instead of black colour for transparent
pixels (the 'leaves' texture uses black), normally these pixels would
not be rendered as opaque colours but bush nodes now use this texture
and will be rendering it as opaque. The dark green pixels resulted in
a texture lacking in contrast.
River water needs to be 'liquid_renewable = false' to avoid a mess caused by
spreading of sources, however picking it up with a bucket then creates
a hole in the river. Allow a 'force-renew' of the source node if it has a
source neighbour.
Pass nodename to tnt.burn function where possible to reduce
use of 'get_node'.
Change 'ipairs' to 'pairs'.
Use 'nodeupdate_single(pos)' instead of 'nodeupdate(pos)' to
avoid every node triggering recursion, the loop itself takes
the place of recursion and works upwards through horizontal
planes as required.
Credit to tenplus1 for the suggestion to generalise for mod use.
Mods can add mod nodes to 'group:spreading_dirt_type' enabling the
function to work with mod nodes.
Add some nodes to this group.
Removing 'dirt_with_grass' etc. from 'neighbors' stops the ABM action
running everywhere and constantly, on the dirt nodes immediately below
the surface nodes. Now the action only runs in the rare case of a dirt
node with neighbouring air, grass decorations or snow.
Remove check for air above to allow grass to spread under light-
transmitting nodes such as fences, walls, plants. This causes spread
under slabs, stairs and glass, when near air, but seems worth it.
Remove unnecessary check for nil node.
The collision box still extended into a neighbouring empty node, causing
falling node objects to collide but not transform back into normal nodes.
Completes the fix started in a previous similar commit.
Combine slabs if identical based on orientations using a simple lookup
table if the nodes are identical.
Otherwise relies on place_node() to place the node, which properly
handles rotation compared to adjacent nodes already, and can orient
based on look_dir as well.
Initial slabs placed are oriented based on (1) the orientation of
the pointed "face" (assumes nodes are cubic, of course), and uses
the player look direction to orient the node n/e/w/s if the slab
is horizontal or upside-down. If placed against a vertical face,
the slab is placed against the face without rotation around the axis
perpendicular to that vertical face. This allows upside down placement
and vertical placement without screwdriver.
If a slab is placed on top of an upside down slab, or below a normally
placed slab, the rotation is inverted so that no "floating" slab
is created.
Largely based on kilbith's #807 PR. Slab combining and place_node()
usage by sofar.
Since this relies entirely on `on_place` mechanics, this fails to
combine slabs into a plain node if the space *above* is occupied.
This is unavoidable due to the fact that on_place() happens after
the checks required to see if pointed_thing.above is empty or not.
I've rewritten this to use connected nodeboxes, but with a caveat. In
order to make flat nodes look better, I'm keeping one non-connected
pane that is flat around to convert flat sections to the flat nodes
instead of connected, as these look better and are easier to work
with. Once more sides are needed we convert the panes on the fly to
connected nodes and recalculate the shape.
We don't paint any of the half-panes that the previous generation of
xpanes did. There's no need and it's harder to work with. Updating the
nodes also seems more natural and placement and removal works straight
forward.
The conversion of old panes relies on an LBM, and does a reasonable
conversion job, but it's not exact, since the panes behave slightly
different now.
The game API documentation was wrong to begin with. We discard param
nr. 2 of the API entirely, and correct the tile usage text.
Part 1: All mods except default and xpanes.
Add license.txt files.
Add missing README.txt files.
Check and update copyright years for all contributors.
Improve text format and make more consistent.
Retain definitions for node groups to support mods.
Burn time is unchanged for applewood, and increases in the order:
aspen, pine, apple, acacia, jungle which is also the order of wood
colour darkness.
Indicate in the infotext when a furnace has filled up `dst` but still
has fuel. The info text shows the item as 100% with added "(output
full)" text, indicating that while it can cook the item, there is no
place for it in the `dst`. Emptying the `dst` should make the item
cook immediately and furnace resume normal operation.
Dig time is modified according to difference (leveldiff) between tool
'maxlevel' and node 'level'. Digtime is divided by the larger of leveldiff
and 1. In creative mode, where the hand is redefined to have maxlevel 3,
this results in higher level nodes taking significantly longer to break.
Now, to speed up digging, hand 'maxlevel' and 'digtime' have been
increased such that nodes of differing levels have an insignificant
effect on digtime. Dig time for all nodes is now identical to that of, for
example, dirt nodes.
Make the softer woods, pine and aspen, 'flammable = 3'.
Correct inconsistent flammability of wood and stairs in relation
to all other solid wood nodes in MTGame.
Make the the softer woods, pine and aspen, 'choppy = 3'.
With thanks to contributor tenplus1
Remove leaf cache and globalstep accumulator limiter
Use 'pos' instead of 'p0'
Remove non-essential 'group:liquid' from 'neighbors'
Increase chance value to 10 to compensate for disabled cache
Disable 'catch-up' to avoid the ABM often becoming 10 times more
intensive
Remove use of 'do preserve' bool, instead simply 'return'
Remove unnecessary checks for 'd' and 'd == 0'
Don't 'get' n0, use already present 'node' instead
Swap order two conditionals so that the one most likely is first
Allows walking in, and prevents being trapped in, 2 node high spaces.
Simulates player's feet sinking into snow.
Easier jumping up onto nodes with snow.
Other screwdriver mods, or mods that cause rotation, might operate without the screwdriver mod loaded and have `screwdriver.disallow` unavailable.
This allows nodes to default to full-disallow rather than full-rotation in such a situation.
This fixes the TNT bug that can crash game when blowing up a container
which holds huge stacks above the norm... e.g. give yourself 65535 snow,
place in chest, blow up, stalled!
Previously, the collision box extended into an empty node, causing
falling node objects to land on the open gate but not transform
back into normal nodes. Now fallng node objects will fall through and
either side of the end of the open gate and transform back.
Fix crash when doors are placed under unknown nodes.
Share a can_dig among doors, that does not crash on nil-player.
Only set can_dig if we actually protect the door.
Add mouth, remove jaw shadow, shade eyesockets.
Darker shading for spine and rotate texture using ^[transform2
instead of inverting texture.
Use 'node sound gravel defaults' for sounds.
Add a global 'intersects protection' function to functions.lua for
checking if a specified volume intersects with a protected volume.
A 3D lattice of points are checked with an adjustable interval.
Add a global 'sapling on place' function to avoid duplicated code in
nodes.lua.
Nyancats are independent in the default mod. Nothing else uses them or
their code. Separating it into a separate mod makes it easier for
subgames to remove them. It also makes it easier for a mod to depend
on nyancats, as lots of subgames don't have them.
Default/mapgen.lua: Register biomes, ores and decorations in
singlenode mapgen. These were never disabled anyway because
singlenode was removed from the world creation menu.
* Unused variables
* Unused values (assigned to variables, but overwritten before use)
* Defining already defined variables instead of reassigning to them.
No longer require night to be skipped for resawn position to be saved
Remove constant beds.read_spawns() calls when a player joins as this
is only required once
Preserve overlapping registrations of large and small clusters
below y = -64 but now extend the small clusters up to y = 0 (the
previous highest iron ore level) in a similar to way to coal
Re-order registrations
Add and improve comments
Change sand blob ymax to 0 as sand does not always rise above 0
Remove dirt blobs from sandstone as it is unsuitable for
many sandstone biomes and ugly in stony sandstone desert
Change ymax of first iron region to 0
- Placing liquid inside a protected area no longer returns an empty bucket
- Remove on_place function, tidy up code, return proper itemstack
- Shorten code (changes from HybridDog/patch-35)
- Global functions sethome.set(name, pos) , sethome.get(name) and sethome.go(name)
- Tidy: trim coords to one decimal place and write to table and output table in one go.
- Add error checking
- Add t4im's homepos loader
Allow many crafted nodes to be rotated in any way possible.
These blocks all have slab and stair versions, which can create awkward
patterns if placed together. By allowing these to be rotated players
can create new patterns and appearances that were not before possible.
Since this wasn't possible before, there won't be any effect
to existing builds, as param2 should always be '0'. The current
screwdriver mod also refuses to rotate and alter param2, so this is
safe to enable from now on.
Personally, since these are all *crafted* nodes to begin with, it
should be apparent that they can be rotated to begin with, but I can
see people may disagree from a simplicity perspective. It also may
affect param2 usage that other mods rely on, although I'm not aware
of any mods that do this.
Lowering the top surface to be level with the boat top somehow
causes the boat to fall through world if underwater. Revert to
previous position that is needed for correct behaviour
Allow water to turn cobble slab and stairs to turn into mossy versions.
There is no crafting recipe for mossy stairs and mossy slabs, the
stair/slab API has been modified to allow for a recipeitem that
is `nil`, which will omit adding a crafting recipe for these two
items. The API documentation is updated.
The slabs and stairs will turn mossy when water is adjacent, just like
cobblestone. You can either farm mossy versions by placing them in
water for a while, then collecting them, or run water over your craft.
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
Mese texture is a classic-mese-yellow version
of celeron55's texture used in MTv0.4.0
Add missing texture credits for mese crystal
and mese crystal fragment
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.
Each sapling is given a single node timer that is between
2 and 4 days of game play time (40-80 minutes). If you walk out
of the zone, and come back later, the tree will always grow
to full if the timer has elapsed.
Because trees.lua is all functions, it needs to be parsed before
nodes.lua, since that references some of its functions. Hence,
change the order of parsing here. Otherwise saplings would not
grow to full.
This PR requires @minetest/minetest#3677
Farming and plant growth has traditionally in minetest been
implemented using ABM's. These ABM's periodically tick and cause
plants to grow. The way these ABM's work has several side effects
that can be considered harmful.
Not to mention a comprehensive list of downsides here, but ABM's
are chance-dependent. That results in the chance that some nodes
potentially never get processed by the ABM action, and others get
processed always. One can easily find this effect by planting a large
field of crops, and seeing that some nodes are fully grown really
fast, and some just won't make it to fully grown status even after
hours or play time.
One could solve the problem by making the ABM's slower, and giving them
a 100% of action, but this would cause the entire field to grow a step
instantly at ABM intervals, and is both ugly, and a large number of
node updates that needs to be sent out to each client. Very un-ideal.
With NodeTimers though, each node will see a separate node timer event,
and they will likely not coalesce. This means that we can stop relying
on chance to distribute plant growth, and assign a single timer event
to grow the plant to the next phase. Due to the timer implementation,
we won't ever miss a growth event, and we can re-scehdule them until
the plant has reached full size.
Previously, plants would attempt to grow every 9 seconds, with a
chance of 1/20. This means typically, a plant would need 9*20 seconds
to grow 1 phase, and since there are 8 steps, a typical plant growth
would require 9*20*8 ABM node events. (spread out over 9*8 ABM actual
underlying events per block, roughly).
because plants are likely not growing to full for a very long time
due to statistics working against it (5% of the crops take 20x longer
than the median to grow to full, we'd be seeing ABMs fire possibly
up to 9*20*8*20 with a 95% confidence interval (the actual math
is likely off, but the scale should be correct). That's incredibly
wasteful. We'd reach those conditions easily with 20 plant nodes.
Now, after we convert to NodeTimers, each plant node will see exactly
8 NodeTimer events, and no more. This scales lineairly per plant.
I've tuned the growth rate of crops to be mature in just under 3
whole days. That's about 1hr of game time. Previously, about half
the crops would grow to full in under 2 days, but many plants would
still not be mature by the end of day 3. This is more consistent.
An additional problem in the farming mod was that the final fully-grown
plant was also included in the ABM, causing infinite more ABM's even
after the entire field had grown to completion.
Now, we're left with the problem that none of the pre-existing plants
have actual node timers started on them, and we do not want a new ABM
to fix this issue, since that would be wasteful. Fortunately, there
is now an LBM concept, and we can use it to assure that NodeTimers
on crop nodes are properly started, and only have to do the actual
conversion once per block, ever.
We want to provide a fairly similar growth rate after this conversion
and as such I've resorted to modelling some statistical data. For this
I created a virtual 32x32 crop field with 9 steps (8 transitions)
as is the default wheat crop. We then apply a step where 1 in 20
plants in the field grows a step (randomly chosen) and count the
number of steps needed to get to 25%, 50, 75% and 95% grown.
The resulting data looks as follows:
25% - ~120 steps * 9 sec / abm = 1080s
50% - ~152 steps = 1368s
75% - ~194 steps = 1746s
95% - ~255 steps = 2295s
Next, we want to create a model where the chance that a crop grows
is 100% every node timer. Since there will only be 8 steps ever,
we want the slowest crops to grow in intervals of ~ 2300 / 8 seconds
and the fastest 1/4 of crops to grow 1080 / 8 seconds intervals.
We can roughly compare this to a normal distribution with a median
of 1400 with a stddev of ~350 (thick fingering this one here).
The rest is a bit of thick-fingering to get similar growth rates,
taking into account that ABM's fire regularly so if they're missed
it's fairly painless, but our timers are going to be 1-2 minutes
apart at minimum. I calculate the timer should be around 150s
median, and experimented with several jitter ranges.
Eventually I settled for now on [80,200] with a redo of [40,80],
meaning that each growth step at minimum takes (80 to 200) seconds,
and if a negative growth condition was found (darkness, soil not
wet, etc), then the growth step is retried every (40 to 80) seconds.
The end result is a growth period from seed to full in ~ 2.25
minetest days. This is a little bit shorter than the current
growth rate but the chances you'll miss timer ticks is a bit
larger, so in normal gameplay it should be fairly comparable.
A side effect is that fields grow to full yield fairly quickly
after crops make it to mature growth, and no crops are mature
a very long time before the majority grows to full. The spread
and view over a growing field is also fairly even, there's no
large updates with plenty of nodes. Just a node here or there
every second or so in large fields.
Ultimately, we get rid of ABM rollercoasters that cause tens of
node updates every 9 seconds. This will help multiplayer servers
likely a lot.
Standing on a boat makes you appear to "hover" over it since this
collision box is way too high. Lower it so that it's low enough
to look normal when walking on top of a boat
Removed unnecessary inventory textures
The drinking glass inventory texture now differs from
the node texture to be more clearly a drinking glass
Smaller textures to reduce size as nodes
This pull adds a new global variable called creative.formspec_add
that will allow mods to add to the creative inventory screen
without the need to fork the mod altogether. Simple solution
that works already for inventory_plus' BACK button
This uses a vmanip to count adjacent tnt nodes and explodes them
all at once, using an inverse square law to recalculate the radius.
The maximum explosion becomes 125 nodes of tnt yielding a radius of
15 nodes, which does not break my machine and makes it return
in under a second.
This makes both bigger explosions and less stability issues.
The drop code has been simplified and now drops at all times a
reasonable amount of drops, never blanketing the area with drops,
even at the larges explosion level.
Particles are scaled up according to explosion size as well - a
bigger explosion will show bigger particles.
To scale the tnt:boom particle, we move it to the _effects() function.
Introduces an `on_blast(luaobj, damage)` callback that mods can attach
to an entity def. The function will get called with the damage that
TNT would make.
The function should return three values:
bool do_damage, bool do_knockback, table drops
do_damage allows the mod to tell the TNT code to perform damage on
the entity for the mod. The mod code should not do anything with
the entity HP. The entity should not be immortal. If false, then
the entity will not be damaged by the TNT mod.
do_knockback allows the mod to tell the TNT mod to perform an
entity knockback effect. If false, no knockback effect is applied
to the entity.
the drops table is a list of items to drop. It may be nil. E.g. {
"wool:red" }.
I've documented both on_blast() API methods in game_api.txt. It is
a better place than lua_api.txt.
Any second explosion near a first TNT explosion will punch all
entities found nearby, including item drops. This causes the
item pickup code to think the item was picked up, but by
a `nil` player, thus removing the item.
We query for the immortal entity group, and if the item is in
the immortal group, do not punch the item.
We reuse the tnt:boom texture for a particle that is added by the
on_construct() of tnt:boom, and has a short expiry time (0.2sec).
It is 3 nodes larged, centered on the explosion.
We then make tnt:boom airlike so it doesn't have a texture, and it's
the thing that emits lots of light (we could even make it exist a
bit longer).
The nice thing about particles is that the client is less susceptible
to lag and will always remove them as fast as possible, so this makes
the visual more constant and responsive.
The effect is similar, and the reduction in particles is a small
boost in responsiveness.
To compensate, I've lowered the spawner time and expiration length
as well.
We add a +/- 0.5 random value to the velocity vector of
ejecting nodes.
I've spotted a lot of nodes going exactly straight up if blowing
up sand above TNT. The extra variation looks less artificial.
We apply punch damage to mobs caught in the blast radius, as
this code previously only hurt players.
We "move" players back 1 node if they're caught in the blast, and
slightly up. We can't "eject" players due to missing API code to
support that, unfortunately.
Adds a minor helper function that allows efficient retrieval of
several inventories from a node inventory. We use this helper to
quickly retrieve the items in chests, vessel shelves, book shelves
and furnaces, and return these with the nodes itself to the TNT caller.
The TNT caller then performs the entity physics, and we don't need
to do anything else.
We disable TNT doing anything with bones.
We expose a bug in the code that drops the items - metadata was lost
entirely. This patch corrects that by properly copying the metadata
and creating the drops list inclusive metadata.