Skip to content

feat(content): Update to Minecraft 1.21.5#4193

Merged
gabizou merged 53 commits intoapi-15from
update/1.21.5
Apr 20, 2025
Merged

feat(content): Update to Minecraft 1.21.5#4193
gabizou merged 53 commits intoapi-15from
update/1.21.5

Conversation

@gabizou
Copy link
Member

@gabizou gabizou commented Mar 26, 2025

SpongeAPI | Sponge

Each snapshot commit has several details about the implementation changes and some gotchas.

gabizou and others added 30 commits January 12, 2025 15:00
A lot of small changes to note:
- TicketTypes are now registered
- Tickets are just dummy holders of the pending timeout
- Entities referencing an "Owner" now use EntityReference for the
  duality of UUID + live Entity references
    - I've got concerns that the reference may be problematic with
      entity instances being recreated for various reasons.
- Chat events have become records
- ArmorItem has completely disappeared, so no more referencable
  characteristic to determine an ItemStack is an armor piece or not,
  short of checking the DataComponents applied
- Tools have an added ability to be "destructive" in creative mode
- SpawnLists for spawns are now using a WeightedList
- A new block change flag being applied to prevent BlockEntities "drops"
  during a block change. This appears to be specific to MC-117574
- Sounds are now being played by entities, not just players, this is
  a signature change.
Changes:
- Entity.moveTo is renamed snapTo
- Entities are moving slowly to components and hiding their data
  accessors, but nothing monumental yet on this front.

There will be more developments in the future to harness the usage of
the now-fully-included GameTest framework from Mojang. We'll be able to
use this to our better advantage to verify several thousand interactions
that otherwise manual testing will often forget.

See https://minecraft.wiki/w/Java_Edition_25w03a
Mainly event generation changes

Signed-off-by: Gabriel Harris-Rouquette <gabizou@me.com>
Notable changes:
- Several client related resources now are built as ClientAssets
- SmithingRecipes now require a base ingredient
- Hidden attributes for items is now in a separated component so Data
  needs to be fixed in several places
- GameProfile lookups seems to have changed, need to fix our cache
- Attack Events need to handle capturing the BlockDamage component
- Hidden Flags are a new component that uses component keys to hide
  tooltips.
Breaking Changes
- Raids no longer have a ServerWorld link

Additions
- Mainly new type entries and tag entries are updated
Signed-off-by: Gabriel Harris-Rouquette <gabizou@me.com>
Notable changes:
- EntityEquipment now contains item slots/data for non-player inventory
  - This has a change with how slots are tracked I believe, we could
   consider reviewing the current transaction operations to verify if we
   need as many slot index based tracking as we currently do.
- Ticking weather is now written as wrap operations or WrapMethods
- Entity dropping items is centered in LivingEntity, a better mixing in
  opportunity
Signed-off-by: Gabriel Harris-Rouquette <gabizou@me.com>
Notable changes:
- Minecart fields are getting slowly inlined, likely the next targets to
  get components
- Turtles are also experiencing a similar field change
- BossEvents now persist data in a record, also codec'ed, so this should
  simplify the Adventure implementation.
- Player respawn data is now a record/component-like, which required a
  few WrapOperations to sort out which World is used to resawn in.
- Entities have a "functional" approach to applying "inside block effect
  interactions" which makes some of the mixins harder to interact with.
  - This was noticeable in the BaseFireBlockMixin where the consumer has
    to be replaced to properly support the BlockDamageSource.
- All UUIDs are now set on CompoundTags via Codecs.
  - This has a greater feeling that defining the schema once via Codec
    is the way Mojang is going, since it means the data can be applied
    whether in NBT or in a binary stream payload via chunks. Time will
    tell.
- A larger refactor of how SavedTicksMixin works to save custom data, as
 the above point mentioned, things are migrating to Codecs, which means
 we have to add on to the existing codec as well in certain places.
A significant change is with Entity related data becoming DataComponent
accessible. It's far higher likely to be able to access different pieces
generically with the components, provided it's a flat mapping.
Signed-off-by: Gabriel Harris-Rouquette <gabizou@me.com>
Notes:
- nbt.Tag is now more consolidated and can be used in better switch
 statements
- ComponentTag is now more directed to use Codecs to parse/store data,
  we may have to seriously look at migrating to Codecs in prior versions
  to have better support moving forward.
- A seemingly archaic ComponentArgument fix no longer applies per Mojang
  fixes to command parsing tag components

Issues:
- Concurrent modifications occur on upgrading data from prior versions
  with respect to Sponge data specifically
- Some odd behavior of the Client sending a movement packet that causes
  a NoSuchElementException when loading a signleplayer world. This is
  easily remedied by a mixin on Entity.removeLatestMovementRecordingBatch
  but more investigation is required whether this is a fundamental bug
  in Vanilla, or something that Sponge is introducing.
With the changes to eneity teleports, Mojang now attempts to clear any
recorded movement packets, but this can lead to a NoSuchElementException
being thrown at the server which crashes the game entirely.
Signed-off-by: Gabriel Harris-Rouquette <gabizou@me.com>
Signed-off-by: Gabriel Harris-Rouquette <gabizou@me.com>
Signed-off-by: Gabriel Harris-Rouquette <gabizou@me.com>
The underlying bug was fixed now with the same isEmpty check.

This reverts commit b039b78.
gabizou added 2 commits March 25, 2025 18:22
Signed-off-by: Gabriel Harris-Rouquette <gabizou@me.com>
Minimal changes required here since all the snapshots have been updates.
Faithcaio and others added 21 commits March 29, 2025 09:11
# Conflicts:
#	src/mixins/java/org/spongepowered/common/mixin/core/server/level/ServerLevelMixin.java
#	src/mixins/resources/mixins.sponge.core.json
# Conflicts:
#	gradle/libs.versions.toml
#	src/mixins/java/org/spongepowered/common/mixin/core/server/MinecraftServerMixin.java
#	src/mixins/resources/mixins.sponge.core.json
* Rewrite attack and damage events

* Damage step API improvements

* Update and optimize attack injections

* Optimize damage injections

* Only allow adding modifiers

* Rename methods in DamageModifier
Signed-off-by: Gabriel Harris-Rouquette <gabizou@me.com>
- Updated MinecraftForge version to 1.21.5-55.0.6
- Introduced a mixin for NamespacedWrapper to address registry hierarchy
  changes from MinecraftForge
- Refined scope of damage steps in LivingEntity for Forge
- Updates Gradle to 8.11.1
- Improve changes for damage event handling with the three platforms
- Improve Registry loader handling between the three platforms
@gabizou gabizou merged commit 382e226 into api-15 Apr 20, 2025
10 of 11 checks passed
@gabizou gabizou deleted the update/1.21.5 branch April 20, 2025 02:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants