Commit Graph

96 Commits

Author SHA1 Message Date
Spottedleaf
6101c8af5b Fix infinite loop in RegionFile IO
If an exception is thrown during decompress then the read process
would be started again, which of course would eventually throw in
the decompress process.
2025-06-09 03:04:38 -07:00
Lulu13022002
c5fc0dc84b support block state mutation of already placed block entity in BlockStateListPopulator
As seen in https://github.com/PaperMC/Paper/issues/12645, the BlockStateListPopulator always destroy
block entity data when the block state change. However this is something that should be supported
so plugin can retrieve block entity data of captured blocks.
Additionally only create snapshots at the end of the capture so we don't need to refresh block entity
data for decorator like the beehive, this is possible since multiple capture
at the same position is not supported and will overwrite the previous data anyway.
2025-06-08 19:55:19 +02:00
Owen1212055
c986ce54d9 Fix V4307 ordering issues
The underlying components seem to still be appended in a different order compared to vanilla but that is fine as the order does not really matter in an ItemStack's component map.

However, 'hidden_components' seem to have defined order that must be respected. We use a hashset and keep the fixing order that is on the vanilla datafixer.
2025-06-07 15:09:22 -04:00
Bjarne Koll
ec548f93dd 1.21.6-pre3 2025-06-04 16:22:28 +02:00
Spottedleaf
cb705c41ff Add DataConverter patch 2025-06-03 13:15:20 -07:00
Spottedleaf
4fa21c21fc Update Moonrise to 1.21.6-pre2
See b312be2921
2025-06-03 12:58:11 -07:00
Bjarne Koll
c136222eeb Moonrise compile fixes and changes
Kept in separate patch for easier revert once leaf smites me.
2025-06-03 16:58:23 +02:00
Bjarne Koll
b15c51cea1 Rest of feature patches
Needs indepth testing of collision improvements on player move packet.
2025-06-03 14:30:33 +02:00
Bjarne Koll
767e99c963 Moonrise attempt
Notable changes:
 - Mojang now force loads a 1 radius large block around the player,
   including entities.

Do not smite me leaf.
2025-06-03 12:12:30 +02:00
Lulu13022002
0c3879ac21 track block for lava/conduit damage
dropped diff
2025-06-02 22:02:52 +02:00
Bjarne Koll
ff05a2df63 Hacky EAR 2.0 fixes
EAR yields immunity to entities that are not on the ground and are not
"flying entities". What this "flying entity" filter actually entails
however is undocumented. The previous implementation checked for
FlyingMob, which only covered ghasts and phantoms, leaving entities like
the blaze and wither untouched for *some* reason.

To be improved by consulting the elders (cat).
2025-06-01 20:33:10 +02:00
Bjarne Koll
ed3b39e944 14 first feature patches 2025-06-01 20:07:10 +02:00
Bjarne Koll
f3bad8c86f Prepare work on feature patches 2025-06-01 20:05:43 +02:00
brickmonster
fa360aa836 Add some missing annotations and an incorrect one (#12204) 2025-05-18 18:31:49 -04:00
Nassim Jahnke
358e72ec0d Remove simplify remote item matching stuff for now
Twas broken for some time and I haven't had time to address it, this may be revisited later in a different way
2025-05-09 14:47:24 +02:00
Spottedleaf
d2ad2e668d Add missing EntityLookup#getAllMapped from Moonrise
Not used but the sources should remain synced.
2025-05-07 18:31:25 -07:00
Owen
6c3964d2f5 Properly save level data async (#12530)
Previously we added a parameter allowing for level data to be saved asynchronously which was then overriden by a vanilla parameter which does the opposite.

This reverts back to the previous behavior that we were doing before.

Co-authored-by: Warrior <50800980+Warriorrrr@users.noreply.github.com>
2025-05-07 17:34:58 -04:00
David
cbcf75a57c Update visual fire handling with TriState support (#12303)
Replaced the Boolean-based visual fire system with TriState for improved clarity and flexibility, enabling three distinct states: TRUE, FALSE, and NOT_SET. Deprecated older methods in favor of new ones and updated internal handling to reflect these changes. Adjusted serialization and deserialization logic to accommodate the new TriState implementation.
2025-05-07 23:33:41 +02:00
Jakub Zacek
ab0253fecd Expand PlayerDeathEvent API (#12221) 2025-05-06 20:14:58 -04:00
David
825685f82f Add PlayerPickBlockEvent and PlayerPickEntityEvent (#12425)
Extensions of the existing PlayerPickItemEvent that allow more fine grained access to relevant context, like the picked block or the entity.
2025-05-02 22:14:27 +02:00
Lulu13022002
567f63ae34 Parity for respawn events (#11792) 2025-04-30 20:04:24 +02:00
Pedro
5acfdd6af4 Fix save/load NaN Entity Motion (#12269) 2025-04-30 19:53:32 +02:00
Bjarne Koll
b9d3147d3b Use correct placed block position for sound (#12410)
Previously the server attempted to compute the block placed by using the
BlockPlaceContext. This approach however fails on replacable blocks, as
the BlockPlaceContext computes this during its construction, which
happened after the actual world modification.

The commit reworks this approach and now stores metadata in the
InteractionResult which can later be read.
The diff is structured to allow for easy future expansion of the tracked
metadata.
2025-04-27 14:19:42 +02:00
Gero
3e3b42cdf5 Update player chat session sync (#12382) 2025-04-26 23:26:20 +02:00
Bjarne Koll
3222985e43 [ci skip] Rebuild patches 2025-04-25 20:06:10 +02:00
Spottedleaf
5f0b82925e Re-add chunk position check to regionfile recalculation patch 2025-04-19 12:40:59 -07:00
Bjarne Koll
8f62e0fb31 Correctly order getArmorContents
Mojangs EQUIPMENT_SLOT_MAPPING uses an Int2ObjectArrayMap and hence
technically does provide iteration stability, however it is filled from
a MapN, which destroys the well order of the entries.
To iterate from smallest to largest inventory index correctly, this
commit introduces a sorted array based on the EQUIPMENT_SLOT_MAPPING.
2025-04-13 11:41:59 +02:00
Nassim Jahnke
f00727c57e 1.21.5
Co-authored-by: Bjarne Koll <git@lynxplay.dev>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com>
Co-authored-by: MiniDigger | Martin <admin@minidigger.dev>
Co-authored-by: Nassim Jahnke <nassim@njahnke.dev>
Co-authored-by: Noah van der Aa <ndvdaa@gmail.com>
Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
Co-authored-by: Shane Freeder <theboyetronic@gmail.com>
Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
Co-authored-by: Tamion <70228790+notTamion@users.noreply.github.com>
Co-authored-by: Warrior <50800980+Warriorrrr@users.noreply.github.com>
2025-04-12 17:27:00 +02:00
Pedro
f225858235 Fix firework entity not being removed when FireworkExplodeEvent is cancelled (#12268)
* Fix Firework not removed when FireworkExplodeEvent is canceled

* JUnit require pass null

* tweaks
2025-03-24 00:20:14 +01:00
Shane Freeder
2aad131e74 Add config option for command spam whitelist 2025-03-23 18:31:39 +00:00
Tamion
6ea42025a4 Send all attributes on respawn (#12274) 2025-03-13 12:41:03 +01:00
0x22
743346a5da Force update attributes
See https://github.com/PaperMC/Paper/pull/12241/
2025-03-09 11:11:02 -07:00
Bjarne Koll
e5d988df85 Revert "Fix cancelling PlayerInteractEvent at (0, 0, 0) (#12215)"
This reverts commit a2b0ff0644.
2025-03-09 18:39:08 +01:00
0x22
0a4eb8f3bb Send the pong response packet immediately. This packet is similar to the keep alive packet and is processed async. (#12242) 2025-03-07 19:40:58 -08:00
okx-code
0a6e7435b3 Fix invulnerability damage and armour (#12190) 2025-02-26 14:06:42 +01:00
Spottedleaf
636ae0cd87 Add missing Paper comments to player movement patch 2025-02-24 21:32:39 -08:00
Jason Penilla
fcb2e81590 Clear lastSection on game event listener removal
Fixes https://github.com/Tuinity/Moonrise/issues/87

See comments in code
2025-02-24 21:32:39 -08:00
Creeam
a3781ff3be Separate tick count to ensure vanilla parity (#12077) 2025-02-16 20:46:37 +01:00
Lulu13022002
7bee99714a Cleanup damage source a bit (#12106) 2025-02-16 20:14:00 +01:00
Pedro
cb25c0cf31 [ci skip] Fix annotation fields used in NMS getBukkitEntity (#12120) 2025-02-16 19:17:26 +01:00
Space Walker
9b9de82706 Update Alternate Current patch to v1.9.1 (#12115) 2025-02-15 12:40:31 +01:00
Dreeam
cafef9ce9b [ci skip] Move EntityUtil to correct directory (#12092) 2025-02-10 13:34:52 +01:00
Bjarne Koll
edacfdf462 Do not queue player info packets (#12080)
Player info packets carry chat state to other clients since the
introduction of chat signatures. Queuing these packets while force
pushing chat packets allows for potentially inverted packet order, which
may cause chain corruption on clients.
2025-02-09 11:51:11 +01:00
Spottedleaf
8927091a08 Do not record movement for vehicles/players unaffected by blocks
If the player is not affected by movement through blocks, then
storing the movement would eventually invoke logic to apply effects
caused by moving through such blocks. For example, moving through
a portal in spectator mode and then later switching to creative mode
would portal the player.
2025-02-02 11:16:59 -08:00
Lulu13022002
5bcfb12a99 Fix activation range config and water animal status (#12047) 2025-01-31 13:13:14 +01:00
Spottedleaf
e2f0efd1af Remove nms.Entity#isChunkLoaded
This method was used pre 1.17 era where an Entity was explicitly
tied to a (then called) Chunk's entity slices. If an entity
was not inside a Chunk, then it was considered invalid as
it was not possible to save the entity.

In 1.17+, entities are now tied to a separately tracked entity
section management system. This system is far more reliable now
as it no longer requires a full chunk load to properly track
entities for saving. As a result, an Entity if inside the world
is always attached to some entity chunk section (except in rare
cases in Vanilla which are fixed in Moonrise).

As a result, whether the chunk the entity is in is loaded is no
longer an indication of whether they are tracked in the world
and we can reliably infer that the entity is correctly in the
world through the valid field alone.

Additionally drop the isInWorld() check, as valid=true implies
isInWorld=true. More importantly, the isInWorld() check invokes
getHandle which may trip a thread check on Folia. This will fix
World#getEntities() and friends exploding on Folia.

However, World#getEntities() on Folia still cannot reliably return
all entities in the world as actions such as cross-region
(not cross-world) teleporting will remove entities from the world.
2025-01-28 17:33:48 -08:00
Spottedleaf
1004374a83 Add further information to thread check errors
The entity data is more complete, which will help debug problems
on Folia.
2025-01-28 13:43:34 -08:00
Spottedleaf
5a34bf0425 Correctly retrun true for empty input shapes in EntityGetter#isUnobstructed
Vanilla will return true for empty shapes, so we should as well.
2025-01-27 13:45:44 -08:00
EnZaXD
fb5b173c6a Add PlayerClientLoadedWorldEvent (#11940) 2025-01-25 21:47:08 +01:00
Spottedleaf
88bbead13b Flush regionfiles on save configuration option
The windows file system does not write metadata unless
the FileChannel is explicitly flushed with metaData=true.

Note: Setting SYNC (not DSYNC) on the FileChannel does not appear
to write the metadata.

Specifically, we are interested in writing the last modified
timestamp so that fs watchers can detect when RegionFiles are
modified.
2025-01-22 11:55:39 -08:00