Commit Graph

5460 Commits

Author SHA1 Message Date
cora d0540c3a1c add a setting to opt-in for selftests 2021-12-14 00:21:34 +01:00
Elias Fleckenstein dfa56f229f
Spawn small chest entities only if animated chests are enabled 2021-12-10 22:15:53 +01:00
cora 5deaabdb47
Fix player bone positions and properties setting
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.
2021-12-09 04:53:45 +01:00
cora d77f31eab8
Only set/send player properties if necessary
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.
2021-12-09 04:26:22 +01:00
Nils Dagsson Moskopp 609105e091
Add test cases for get_tool_name() 2021-12-06 04:11:55 +01:00
cora f9e3c4fd6d
Fix crash when skeleton kills player using bow
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.
2021-12-06 03:48:39 +01:00
Elias Fleckenstein cacddd3fb4
Fix access to ender inventory without an ender chest 2021-12-03 21:23:10 +01:00
Nils Dagsson Moskopp 54b36c42a9
Add debug command to show ender chest inventory formspec. 2021-12-02 19:44:22 +01:00
cora 5252952555 strip newlines from tools in death messages
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.
2021-12-01 13:25:57 +00:00
Nils Dagsson Moskopp f8b5066c61
Add packed ice crafting recipe 2021-11-24 06:06:26 +01:00
cora 5087e8194a remove swiftness from egapps
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.
2021-11-20 02:14:16 +01:00
Nils Dagsson Moskopp 66dd87af25
Give mobs sunburn at correct light level
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.
2021-11-19 03:14:36 +01:00
Nils Dagsson Moskopp 6bd4b0e62c
Fix typo in mcl_colors API documentation 2021-11-18 19:23:57 +01:00
AFCMS 3473f55136
Add API documentation to mcl_colors 2021-11-18 19:14:21 +01:00
Elias Fleckenstein af7f7c3574
Add mcl_colors 2021-11-18 19:13:08 +01:00
Nils Dagsson Moskopp 76d2846c59
Improve test for minetest.find_nodes_in_area()
• 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.
2021-11-18 04:47:03 +01:00
Nils Dagsson Moskopp 526c25aa57
Add crash fix and tests for minetest.find_nodes_in_area()
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.
2021-11-18 00:55:59 +01:00
cora 84194b71e6 burning: prevent adding multiple entities+huds 2021-11-12 01:16:16 +01:00
cora 0b7097cb28 add a burning animation fps setting 2021-11-12 01:16:16 +01:00
Nils Dagsson Moskopp 253100380c
Add debug command to burn a player 2021-11-11 21:37:26 +01:00
cora df98db1d8c Merge pull request 'ITEMS/mcl_banners: Render preview banners with transparent patterns correctly' (#158) from banner-mask-fix-4 into master
Reviewed-on: https://git.minetest.land/Mineclonia/Mineclonia/pulls/158
Reviewed-by: cora <cora@noreply.git.minetest.land>
2021-11-08 12:21:50 +00:00
Nils Dagsson Moskopp f410de485a
Render preview banners with transparent patterns correctly
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.
2021-10-31 20:53:18 +01:00
cora eee94658e7 mcl_maps: send hud_flags only if actually changed 2021-09-13 14:15:32 +02:00
NO11 3759d50344
Add german translation for stripped wood 2021-09-07 00:48:40 +02:00
NO11 50e913b370
Add template for stripped wood translation 2021-09-07 00:48:39 +02:00
NO11 508b08dfd3
Add specific help text for stripped wood 2021-09-07 00:48:38 +02:00
NO11 68646b62b3
Add some spaces 2021-09-07 00:48:38 +02:00
NO11 d3348ef8b7
Add stripped trunk / wood textures
Stripped trunk / wood nodes exist for acacia, birch, dark oak, jungle
tree, oak, and spruce. This patch adds the textures for all of these.
2021-09-07 00:48:37 +02:00
NO11 eadb96dd40
Refactor wooden plank crafting
This patch makes it possible to craft planks out of stripped wood.
2021-09-07 00:48:36 +02:00
NO11 616b009452
Add stripped trunk and stripped wood nodes 2021-09-07 00:48:35 +02:00
NO11 a92e1c05a3
Add debarking by right clicking wood using an axe 2021-09-07 00:48:10 +02:00
Nils Dagsson Moskopp 10ce37d887
Fix server crash by client leaving after joining
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.
2021-08-22 04:21:35 +02:00
Nils Dagsson Moskopp ce6d6c26cc
Add debug command to acquire a written book
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.
2021-07-30 17:22:33 +02:00
Nils Dagsson Moskopp a0c9f11af6
Log warning for non-serializable item entity fix 2021-07-30 17:15:13 +02:00
sfan5 62d5b547a0
Fix non-serializable item entity unload crash
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.
2021-07-30 17:13:26 +02:00
Nils Dagsson Moskopp 71cff7051f
Generate pig spawners in mineshafts
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.
2021-07-23 04:11:33 +02:00
Wuzzy 280aed484c
Do not send useless HUDCHANGE packets
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.
2021-07-21 10:28:04 +02:00
Elias Fleckenstein 920ca96764
Make dragon egg teleport on punching 2021-07-13 09:11:48 +02:00
Nils Dagsson Moskopp 76e3a00e18
Make potion arrows able to hit end crystals 2021-07-12 22:21:15 +02:00
Nils Dagsson Moskopp 2033a9bf1d
Refactor potion arrow flight time calculation 2021-07-12 16:07:20 +02:00
Nils Dagsson Moskopp 99ebf08873
Refactor regular arrow flight time calculation 2021-07-12 16:06:44 +02:00
Nils Dagsson Moskopp c45c0df118
Play no hit sound when potion arrow hits shooter 2021-07-12 04:59:53 +02:00
Nils Dagsson Moskopp 39023f1adf
Play no hit sound when regular arrow hits shooter 2021-07-12 04:59:39 +02:00
Nils Dagsson Moskopp 689054f904
Fix sound_play invocation when player hit by potion arrow 2021-07-12 03:49:05 +02:00
cora 8ed5fd4740
Let players shoot themselves with potion arrows 2021-07-12 02:44:17 +02:00
epCode 6951ecdfc9
Let players shoot themselves with regular arrows 2021-07-12 02:09:47 +02:00
Nils Dagsson Moskopp 275f0826ed
Send FOV packets only when necessary
Before this change, about 10 to 30 FOV packets were sent from the server
to each connected client each second. This patch only sends FOV packets
when the FOV actually needs to be changed, i.e. when the player starts
or stops sprinting.
2021-07-04 03:25:05 +02:00
Nils Dagsson Moskopp f8c58262bc
Fix Ender chests from MineClone2
Commit 819dbc6224c3b96ad4094cccf3d9150f3ef61d45 of MineClone2 introduced
an LBM that removed Ender chest formspecs stored in the node meta. That
change makes Ender chests that were loaded in MineClone2 versions past
that commit not show the Ender chest inventory form on right-click.

This patch makes those broken Ender chests work by introducing an LBM
that writes the formspec to the node meta for Ender chest nodes once.

Since the LBM name is suffixed with a hash of the Ender chest formspec,
changes to the Ender chest formspec (even removing it entirely) should
not require manual adjustment of the LBM code.
2021-06-28 22:54:00 +02:00
cora f1ac39eaad Merge branch 'master' into fix_inventory_depends 2021-06-25 15:12:05 +00:00
Nils Dagsson Moskopp 1e42c37895
Reduce snow layer silk touch drop amount
It was possible to duplicate snow layers by placing them and then mining
them using a tool enchanted with silk touch. This commit fixes the “snow
dupe” by reducing the amount of snow layers dropped in this case by one.
2021-06-23 03:06:24 +02:00