Update patches to latest 1.21.4 #1

Merged
Chaoscaot merged 242 commits from update/1.21.4 into main 2025-04-23 22:27:11 +02:00
Owner
No description provided.
Chaoscaot added 205 commits 2025-03-30 12:25:06 +02:00
The actual property value is final, only the serialized output is changed. This uses the correct value from PlayerList instead
Fixes #11878
Closes #11878
This bug affects vanilla, and was reported as MC-279196
Reimplementation of the itemstack obfuscation config that
leverages the component patch map codec to drop
unwanted components on items or replaces them with
sanitized versions.

Co-authored-by: Bjarne Koll <git@lynxplay.dev>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
This diff was accidentally dropped when updating to hard fork.

This diff importantly:
 - Does not return true if the async catcher is disabled
 - Does not return true during shutdown
 - Returns true for any instance of TickThread (enables
   watchdog and Folia threads to be considered main)
This provides additional debug information that may be useful.
Co-authored-by: leguan <longboard.noah@gmail.com>
Prevent decorated pots from sending their contents to clients as
contents are not needed for rendering.
The fix was causing too many issues, it really needs a client-side fix
MC-235045
Bukkits entity remove event is called at a different time than the
existing paper event, specifically it is called after an entity has been
stored during chunk unloads.

This means that, while the bukkit event can have a defined reason, it
does not allow modification to the entity data. In this regard it
differs from the paper implementation and prevents developers from using
the paper event as an alternative.

Co-authored-by: TonytheMacaroni <tonythemacaroni123@gmail.com>
This is already the default path for the reobf mappings patch.
No longer needed with new build system
Enchantment shouldn't support direct holders despite the ctor
accepting a Holder type. We want to limit the types
to ones that are actually used as direct holders in the game
In 1.15 spigot changed the behavior of all temperature methods to always return height adjusted temperature.
Correctly reflect this in the javadocs.
Dropped during hardfork, now moved to a false-ed out if statement to
prevent dropping in future updates.
Dragon fight data should be read from the now split world instead of the
main world level.dat.
Partial hunk was dropped during hardfork.
This removes a required patch set for forks.
Fixes #11976
"muh checkstyle" more like "muh missing style config"
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.
* fix PlayerChangedMainHandEvent javadoc

* Obsolete

---------

Co-authored-by: Bjarne Koll <lynxplay101@gmail.com>
Vanilla will return true for empty shapes, so we should as well.
This allows the watchdog thread to be seen as the
primary thread during shutdown, which prevents it
from tripping thread checks in various areas.

Fixes https://github.com/PaperMC/Paper/issues/12030
The entity data is more complete, which will help debug problems
on Folia.
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.
This allows plugins to access chunks slightly outside of the
max world border (such as ones which may be loaded naturally
by players) without tripping any logs.
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.
Mojang added this early 2024, however, it wasn't ever added to the actual config option
inside of paper
Fixes compilation issues for plugins from recent API addition with double-annotated parameter (JetBrains annotations are type-use and parameter, so nonnull array of nonnull elements ends up with duplicates)
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.
This allows for the configuration of tripwire hook duping.
Clarify that disabling auto-save does not stop all saving operations. This addition explicitly mentions that the world will still save on shutdown and explains the intended purpose of the method.
Marked ItemStack parameter as `@Nullable` to explicitly indicate it can be null. This improves clarity, avoids nullability problems, and aligns with the method's documented behavior for handling null values.
* add content guard

* use preconditions for null check
* Mention missing impl

* Clean the implementation out of years old code

* Change the jd comment

* Move to default method

---------

Co-authored-by: Bjarne Koll <lynxplay101@gmail.com>
While the paper command system no longer uses redirects for namespaced
registration, vanilla still does. This means that removal of vanilla
redirecting target nodes still causes issues, e.g. the removal of the
vanilla 'msg' node in favour of a command alias one.
Redirecting nodes like tell, minecraft:msg and minecraft:tell are broken
by this and need to by flattened before sending them to the client.
While the running server will still be using the recently introduced
copy-mechanic for vanilla command namespacing, the data converter logic
relies on the fact that namespaced aliases were redirects as well.

To not break the converted, the commands type now takes a modern flag
only set by the running server.
Always passes the respective block to a damage source when passing a
block state. While we could technically use the damageSourcePosition
here by, we'd have to translate it back to a block position by
subtracting .5 from all its components.
Such behaviour however relies on the caller logic's mutation of the
damageSourcePosition and will break once this position is not the centre
of the block.

Passing in the block at the specific callsite is a lot more future
proof.
This reverts commit ab984a0711.

The block damage is null *and has been* null in cases where the block
has already been cleared. Consumers are supposed to use the
getDamagerBlockState instead.
Co-authored-by: Tamion <70228790+notTamion@users.noreply.github.com>
Fixes https://github.com/Tuinity/Moonrise/issues/87

See comments in code
Additionally pins configurate-core as a transitive dependency of
configurate-yml, as the yaml snapshot depends on a snapshot itself.
* Add SpawnReason "Bucket". Fix "DEFAULT" SpawnReason for entity spawning from mob bucket

* Clarify SpawnReason description for bucket entity spawning
Set the old pos/rot to be the same as the current pos/rot for new
entities as the default value for the old pos/rot is zero.

Fixes https://github.com/PaperMC/Folia/issues/302
---------

Co-authored-by: Warrior <50800980+warriorrrr@users.noreply.github.com>
* CraftServerTickManager - silence feedback when sprinting

* CraftServerTickManager - forgot secondary note

* ServerTickRateManager - only set to silent if not already sprinting
we delete old snapshots (age > 10 days), keeping only the last 5 at minimum
This reverts commit a2b0ff0644.
See https://github.com/PaperMC/Paper/pull/12241/
This is important for 1.21.5 servers/clients and non-Vanilla clients that may not be able to match 1.21.5 data hashes anymore
* Refine recipe management API documentation.

Improve Javadoc clarity for recipe addition methods, specifying client update behavior and stability considerations. Adjust formatting for better readability and consistency.

* Fix typo in original javadoc

---------

Co-authored-by: david <mrminecraft00@gmail.com>
* [ci skip] Make compilation logs actually readable

* Specifically disable deprecation and removal warnings instead
* feat: add event to wind charge explode

* fix: use correct parameters

* feat: allow setters to work

* fix: use consts

* Unify paper comments

---------

Co-authored-by: Warrior <50800980+Warriorrrr@users.noreply.github.com>
* Add QOL open method to InventoryView

* Check to ensure the opening isn't a InventoryMenu, allow HorseMenus

* Fix instanceof against API instaed of AbstractContainerMenu

* [ci skip] Remove suggested comment
* Fix Firework not removed when FireworkExplodeEvent is canceled

* JUnit require pass null

* tweaks
Update patches to latest 1.21.4
Some checks failed
SteamWarCI Build failed
da0ba1e34b
Chaoscaot added 1 commit 2025-04-23 19:49:14 +02:00
Fix Build
Some checks failed
SteamWarCI Build failed
42581a1d4b
Chaoscaot added 36 commits 2025-04-23 19:58:13 +02:00
* Update adventure to 4.19.0

The update only includes a new configuration for MiniMessage,
specifically one to prevent it from emitting virtual components.
As virtual components break the generated component tree, items quickly
become unstackable with items generated before adventure 4.18.

Plugin developers may construct their own mini message instance which
will emit virtual components if they so choose.

* Bump to adventure 4.20.0
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>
Fixes #12412
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.
Either to match Vanilla or to update our own
No longer available on javadoc.io apparently after 2.20.0
Ports the follow commits from spigot to paper.
All credits to go the respective commit authors listed below.

Bukkit: 47480cd07c0957a94b220f3087b851594b063e54
CraftBukkit: c6c8165aa0d5679b9b015b209c1645a222f8c3a6
CraftBukkit: d275d3b96e041f6421f3bb7de1e6022ea8be5456

By: md_5 <git@md-5.net>
By: Doc <nachito94@msn.com>
The recent commit 121a7bf4eb added
the interface FeatureElement to the GameRules.Type class to expose the
stored feature flags of gamerules.
This however messed with the reobf mappings spigot uses, as the now
overridden method requiredFeatures needs to be mapped to the same
obfuscated name as FeatureElement#requiredFeatures.

To avoid having this in the mappings patch, the commit removes the
inheritance again and instead exposes a wrapper method.
The exit location passed to PlayerTeleportEvent/PlayerTeleportEndGatewayEvent in ServerPlayer#teleport(TeleportTransition) needs to be cloned, as it is later compared in case it was changed. Not cloning it results in the ability for plugins to mutate it but such changes will be ignored, as the instance of the Location being the same results in a successful equality check.

It is not necessary to clone the location in other instantiations of the event (or subclasses) as those are not compared afterwards to change the outcome.
Chaoscaot merged commit cb9578f90f into main 2025-04-23 22:27:11 +02:00
Chaoscaot deleted branch update/1.21.4 2025-04-23 22:27:11 +02:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SteamWar/Paper#1
No description provided.