Commit Graph

78 Commits

Author SHA1 Message Date
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
Tamion
ab1b312064 Call PlayerItemDamageEvent for tridents (#11899) 2025-01-12 15:29:52 -08:00
Jake Potrebic
5e23d28ad2 Remove entity tag selector tag completion fix (#11964)
The fix was causing too many issues, it really needs a client-side fix
MC-235045
2025-01-12 15:07:24 -08:00
Tamion
eb4db794eb Make CommandSourceStack respect hidden players (#11898) 2025-01-12 17:50:08 +01:00
Strokkur24
c2f24e1567 Feat: Add 'with' methods to CommandSourceStack (#11868) 2025-01-11 13:29:16 -08:00
SoSeDiK
b242f1eb15 Prevent day cycle on the client when using fixed time (#11924) 2025-01-11 10:59:50 +01:00
Nassim Jahnke
2b73d1957c More var name fixes 2024-12-27 13:45:04 +01:00
SoSeDiK
aac246ae29 Expand on entity serialization API (#11807) 2024-12-27 00:08:00 +01:00
Jake Potrebic
af2812fb0f For new registry values, allow copying from existing (#11796)
Co-authored-by: Bjarne Koll <git@lynxplay.dev>
2024-12-26 13:41:15 -08:00
Warrior
763b32d825 Fix framed maps looping through all players in world (#11819) 2024-12-25 12:31:03 +01:00
Bjarne Koll
17d76ae42b Correctly die when cancelling EntityResurrectEvent (#11785)
The existing logic in LivingEntity#checkTotemDeathProtection completes
by checking whether the death protection component is null or not.
In cases where the event was cancelled, the component needs to be nulled
out to prevent the method from returning true, causing the player to
properly die.
2024-12-23 19:38:10 +01:00
Shane Freeder
cbf630d5b5 Move missing import into feature patches to fix pre-features compile
Came across this in my complete utter failure to use the commands to
apply patches properly
2024-12-23 09:28:58 +00:00
Lulu13022002
3bfdf6a07a fix flying too long check 2024-12-21 19:27:59 +01:00
Bjarne Koll
286e3468d7 Some more cleanup 2024-12-21 16:03:34 +01:00
Nassim Jahnke
3b0b3a0aef and some more 2024-12-21 13:45:04 +01:00
Nassim Jahnke
82216a59fe Apply some feature patches to files instead
They're small and/or really shouldn't be left unapplied
2024-12-21 13:21:47 +01:00
Nassim Jahnke
e0593e9286 More diff/changed variable name cleanup 2024-12-21 12:15:25 +01:00
Nassim Jahnke
13b890950d Apply remaining feature patches 2024-12-20 23:24:23 +01:00
Lulu13022002
2213ce5bbc fix enderpearl across portals 2024-12-20 21:22:58 +01:00