Before this patch, wearing a pumpkin would make body armor render as a
corrupted item held in the player's left hand instead of on their body.
Some parts of their armor would also get rendered on the player's feet.
(cherry picked from commit 12192d1a8ddffdae1ec13ea8f6efc6fe2465c2b8)
Before this patch it was possible for any user to to crash Minetest in
creative mode. This was possible because queries in the search field
were interpreted as search patterns for string.find().
A search for a single square bracket would reliably crash the server.
Also, a search for 6000 times the string “a?” would hang the server.
The solution to both bugs is to not interpret the query as a pattern.
Before this patch, growing a gourd (e.g. melon, pumpkin) would always
convert a node west of the node below the stem to dirt if belonged to
the group “dirtifies_below_solid”. This happened because of a loop in
which the variables floorpos and floor were re-used without setting a
new value … therefore, both floorpos and floor were always containing
the last values set in a previous loop instead of the correct values.
This patch fixes the problem by setting both variables in both loops.
The comparison and setting logic in the previous patch that set player
bone positions and properties conditionally incorrectly did not update
some values (like player eye level position) when they changed. This
patch fixes it and adds asserts to ensure the code works as intended.
Before this patch, Mineclonia set (and therefore sent) player bone
positions and player properties in every globalstep. This results in
about 30 TOCLIENT_ACTIVE_OBJECT_MESSAGE per second per player. This
patch adds conditional functions to set bone positions and properties.
The functions set values only when they have changed, reducing traffic.
Commit 5252952555 used string.gsub() to
strip newlines from tools in death messages. The second return value of
string.gsub() (the number of substitutions) was erroneously returned too
by get_tool_name(). This bug caused a crash whenever a skeleton killed a
player using its bow.
Players naming their tools with newlines can mess up chat with death
messages. This commit strips out newlines (\r and \n ) in the tool
name for death messages.
The minetest world is already so small that you can reach world
border from spawn in about 2 hours. I think the regen and fire
resistance are good enough to make them special.
Before this patch, the light level that makes mobs that burn in sunlight
catch fire had been mistakenly specified as minetest.LIGHT_MAX or more.
The correct light level for sunlight is LIGHT_SUN, which is one higher
than minetest.LIGHT_MAX. Since minetest.LIGHT_MAX is the maximum light
value that a node can have and torches emit light at that light level,
mobs that burn in sunlight caught fire inside torch nodes.
• By emerging test areas, the test gets real map data and does not block.
• The test now also ensures that any return values are compared exactly.
• minetest.find_nodes_in_area() is tested with the “grouped” parameter.
For some specific out of bounds values, the volume calculation in
minetest.find_nodes_in_area() is off by about four million nodes.
Unfortunately that behaviour made it trivial to crash Mineclonia,
as Minetest immediately crashes upon encountering large numbers.
This commit introduces a wrapper around minetest.find_nodes_in_area()
which should avoid a crash. Additionally, three self tests are executed
when a server starts; they crash Mineclonia in case the workaround fails.
Without this fix, the banner pattern preview generation does not mask
the banner pattern, so the alpha channel of the banner pattern is not
taken into account. This lead to preview banners with color gradients
showing up as a solid color banner and opaque pixel artifacts for the
bottom triangle pattern.
When a player joins and immediately leaves the game before a function is
called by minetest.after() in mods/PLAYER/wieldview/init.lua, it gets an
invalidated player object. This results in the player methods returning
nil (since Minetest 5.2); perhaps surprisingly, the player is not nil.
Not checking that the result of player:get_pos() is not nil could lead
to a server crash if a client crashed when joining. It has been reported
that a syntax error in a client side mod was enough to trigger that.
The “getwrittenbook” command gives a player that has the “debug” privilege a book
with a configurable amount of characters. This was added as a debug aid, to help
reproducing situations in which items with lots of metadata trigger issues like
heavy lag or server crashes.
Some items, like shulkers or books, can have so much metadata that the
corresponding item entity can not be serialized by the Minetest engine.
Without this patch, dropping such an item and then moving away crashes
Minetest, as it can not serialize the entity with serializeString16()
when unloading a map block.
The patch resets the overlong metadata of non-serializable item entities.
This avoids a crash and makes it possible to retrieve a “sanitized” item
without metadata when the mapblock containing the item entity is reloaded.
Originally sfan5 guessed the maximum possible item entity serialization size
that would not lead to a crash as 65530 bytes, but anon5 calculated it to be
actually 65487 bytes. This has been experimentally verified by erlehmann.
In Minecraft Java Edition, when the map generator generates a spawner,
it can generates a pig spawner instead of the spawner it should create.
That behaviour is very rare, but has never been removed from Minecraft.
This patch changes 1 in 1000 spawners in a mineshaft to be a pig spawner
instead of a cave spider spawner.
Several mods set or unset the visibility of a HUD bar way too often (e.g.
in a globalstep handler), causing the server to send a lot of superfluous
HUDCHANGE packets to each client. Returning from hb.hide_hudbar() early
if HUD bar visibility would not change prevents sending these packets.