Skip to content

Commit

Permalink
feat: update implementation to 25w07a
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gabizou committed Feb 15, 2025
1 parent 36fa064 commit 6b056e9
Show file tree
Hide file tree
Showing 41 changed files with 365 additions and 142 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ mixinConfigs=mixins.sponge.accessors.json,mixins.sponge.api.json,mixins.sponge.c
mixins.sponge.tracker.json,mixins.sponge.ipforward.json,mixins.sponge.optimization.json
superClassChanges=common.superclasschange

minecraftVersion=25w06a
minecraftVersion=25w07a
recommendedVersion=0-SNAPSHOT

org.gradle.dependency.verification.console=verbose
Expand Down
80 changes: 80 additions & 0 deletions gradle/verification-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2218,6 +2218,14 @@
<sha256 value="94a3581ea9e4ffc385bb237960f68ef1e84089f164eae8629e8fd66d8aaf0139" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-buffer" version="4.1.118.Final">
<artifact name="netty-buffer-4.1.118.Final.jar">
<sha256 value="0eea4e8666a9636a28722661d8ba5fa8564477e75fec6dd2ff3e324e361f8b3c" origin="Generated by Gradle"/>
</artifact>
<artifact name="netty-buffer-4.1.118.Final.pom">
<sha256 value="95cbe6e3e341ee49bcffd3257cf78fa5785e465b77a734bcfc2f93509d43fe64" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-buffer" version="4.1.97.Final">
<artifact name="netty-buffer-4.1.97.Final.jar">
<sha256 value="a4393f5b395486cc74d0325c9b41311abb9513ba0fd7ef8cf46e9345c3bffbea" origin="Generated by Gradle"/>
Expand All @@ -2234,6 +2242,14 @@
<sha256 value="ac166597e81179ca8300276605408910cc030efec12236ce9c38fefc16801aa0" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-codec" version="4.1.118.Final">
<artifact name="netty-codec-4.1.118.Final.jar">
<sha256 value="4abd215fd1ed7ce86509d169cc9cbede5042176c265a79b3b70602b017226c3f" origin="Generated by Gradle"/>
</artifact>
<artifact name="netty-codec-4.1.118.Final.pom">
<sha256 value="0f1d81390dca4588d87d3fe15d8c52f26bb2ea6d80c90ab93a97e64dfd7a1cdd" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-codec" version="4.1.97.Final">
<artifact name="netty-codec-4.1.97.Final.jar">
<sha256 value="bcc96737a0f912fcf031cf8c45ebda352a90a40437db0832caad3d5a63618b38" origin="Generated by Gradle"/>
Expand All @@ -2250,6 +2266,14 @@
<sha256 value="6286361f5dd6a7b26c42909242bb8629e3aeec255ad0d3ff131bcb5152c31b21" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-common" version="4.1.118.Final">
<artifact name="netty-common-4.1.118.Final.jar">
<sha256 value="65cce901ecf0f9d6591cc7750772614ab401a84415dc9aec9da4d046f0f9a77c" origin="Generated by Gradle"/>
</artifact>
<artifact name="netty-common-4.1.118.Final.pom">
<sha256 value="34290415e3f7961b196f7637c82a617d1038112291b31cbbc47200d1da326e82" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-common" version="4.1.97.Final">
<artifact name="netty-common-4.1.97.Final.jar">
<sha256 value="a8aca0c8e9347acc75c885ecc749195d9775369aa520b9276f2d1128210a6c17" origin="Generated by Gradle"/>
Expand All @@ -2266,6 +2290,14 @@
<sha256 value="8c28025a352fc03846ce04960ab9843418bc6c82cbe5459e8060a4f3459efe90" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-handler" version="4.1.118.Final">
<artifact name="netty-handler-4.1.118.Final.jar">
<sha256 value="26e3f8a5e859fd62cf3c13dc6d75e4e18879f000a5d0ad7f58f8679675d23dae" origin="Generated by Gradle"/>
</artifact>
<artifact name="netty-handler-4.1.118.Final.pom">
<sha256 value="64b4b591ac4df4e9683a3fa17f73defb761af072c56dc2de4033e180c56b1049" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-handler" version="4.1.97.Final">
<artifact name="netty-handler-4.1.97.Final.jar">
<sha256 value="bd4771d19149cbc9c7464ed2d58035d79cdfed7adb59d38718b0d8e7a3dcc2de" origin="Generated by Gradle"/>
Expand All @@ -2279,6 +2311,11 @@
<sha256 value="d832942b8e2a71c2ccfdd0247a8b840105ce40aaeec4b8de36358f28d93941e3" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-parent" version="4.1.118.Final">
<artifact name="netty-parent-4.1.118.Final.pom">
<sha256 value="d966daebad7c721dfbf8fecd94f07b126f6fcb2d1f85b9c87999fd999ebc68c8" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-parent" version="4.1.97.Final">
<artifact name="netty-parent-4.1.97.Final.pom">
<sha256 value="8be274418b1bd42b1e31a0d8904042fb2d26eeb74b7affc349810df536d1a7ef" origin="Generated by Gradle"/>
Expand All @@ -2292,6 +2329,14 @@
<sha256 value="53a491cfc876083ebd67e9c315c18c2348bb28f5366ca5d178bd8e8611f0ab4e" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-resolver" version="4.1.118.Final">
<artifact name="netty-resolver-4.1.118.Final.jar">
<sha256 value="3170c225972c18b6850d28add60db15bb28d83c4e3d5b686ca220e0bd7273c8a" origin="Generated by Gradle"/>
</artifact>
<artifact name="netty-resolver-4.1.118.Final.pom">
<sha256 value="872dcbd88229c2e9180a3caa75584c42ced88a516c49a68dd896372164b2a94f" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-resolver" version="4.1.97.Final">
<artifact name="netty-resolver-4.1.97.Final.jar">
<sha256 value="38a018c6d9fb2cb11b72881354782b45080bbd20b9a0ad6cde28b80d431ed0b1" origin="Generated by Gradle"/>
Expand All @@ -2308,6 +2353,14 @@
<sha256 value="9677471c5409adced1f6cdb65a3ad8015e2e970990aba497a4eeca18abc363f9" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-transport" version="4.1.118.Final">
<artifact name="netty-transport-4.1.118.Final.jar">
<sha256 value="ab3751e717daef9c8d91e4d74728a48730bd8530b72e2466b222b2ea3fb07db9" origin="Generated by Gradle"/>
</artifact>
<artifact name="netty-transport-4.1.118.Final.pom">
<sha256 value="621f4c5672204a7b4372397b0bf8d7e446cd9f660affc0d0339c059c500a7032" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-transport" version="4.1.97.Final">
<artifact name="netty-transport-4.1.97.Final.jar">
<sha256 value="197fd2d6c6b4afe677d9e95bf2e36b49a0bcabdfce0583683fb73f29a3f5a407" origin="Generated by Gradle"/>
Expand All @@ -2324,6 +2377,14 @@
<sha256 value="e57cc702f24b733565741ce3a69d89a2b5f5dcbda34c52b779fd02ba68c40987" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-transport-classes-epoll" version="4.1.118.Final">
<artifact name="netty-transport-classes-epoll-4.1.118.Final.jar">
<sha256 value="bd86e6d41e1f6053f9577931655236259778ab045646e1e6ab04150f070864f3" origin="Generated by Gradle"/>
</artifact>
<artifact name="netty-transport-classes-epoll-4.1.118.Final.pom">
<sha256 value="f962b4579a4be0cd4bba23ea89ae3b84e0c9b8d16486e4c1d311346eb6fc731f" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-transport-classes-epoll" version="4.1.97.Final">
<artifact name="netty-transport-classes-epoll-4.1.97.Final.jar">
<sha256 value="ee65fa17fe65f18fd22269f92bddad85bfb3a263cf65eba01e116a2f30b86ff5" origin="Generated by Gradle"/>
Expand All @@ -2343,6 +2404,17 @@
<sha256 value="0f2e546db040b7cbebd911dbdef0f897d7bf36b9cae9a53e047a49cb2c497b0c" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-transport-native-epoll" version="4.1.118.Final">
<artifact name="netty-transport-native-epoll-4.1.118.Final-linux-aarch_64.jar">
<sha256 value="53b3bec1d019bd3db6eeed30c6a770b49052ddd8fa1566796ae759e62b572425" origin="Generated by Gradle"/>
</artifact>
<artifact name="netty-transport-native-epoll-4.1.118.Final-linux-x86_64.jar">
<sha256 value="c95f66b9ab3f7fb6e666a81a5d0120e0c6acddf8fdf440e2ba212bfaf76a7c73" origin="Generated by Gradle"/>
</artifact>
<artifact name="netty-transport-native-epoll-4.1.118.Final.pom">
<sha256 value="cab7bfb6c06d1f88199dc10f8681d92def080d116b7669fc596a750a37f40e50" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-transport-native-epoll" version="4.1.97.Final">
<artifact name="netty-transport-native-epoll-4.1.97.Final-linux-aarch_64.jar">
<sha256 value="93b5fe8f3829dcb5e033d8d40d59159366ff4cf8266c903bbd6a4aeed9e59bac" origin="Generated by Gradle"/>
Expand All @@ -2365,6 +2437,14 @@
<sha256 value="96075271c578faadffec6f133991ea30884a69a41e07245a5ff8d5e7e5dd9f07" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-transport-native-unix-common" version="4.1.118.Final">
<artifact name="netty-transport-native-unix-common-4.1.118.Final.jar">
<sha256 value="69b16793d7b41ea76a762bd2bd144fc4f7c39c156a7a59ebf69baeb560fb10b7" origin="Generated by Gradle"/>
</artifact>
<artifact name="netty-transport-native-unix-common-4.1.118.Final.pom">
<sha256 value="c37dfa448fda576e35d2a788a346a9a4518198acc53759922584abb86d21dfdb" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-transport-native-unix-common" version="4.1.97.Final">
<artifact name="netty-transport-native-unix-common-4.1.97.Final.jar">
<sha256 value="412fe140257c2dda5a5e15bee911298bd61928d03ee6be4db588e82c196c5dc6" origin="Generated by Gradle"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* This file is part of Sponge, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.spongepowered.common.accessor.entity.vehicle;

import net.minecraft.world.entity.vehicle.AbstractMinecart;
import net.minecraft.world.level.block.state.BlockState;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Invoker;

import java.util.Optional;

@Mixin(AbstractMinecart.class)
public interface AbstractMinecartAccessor {

@Invoker("getCustomDisplayBlockState") Optional<BlockState> accessor$getCustomDisplayBlockState();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* This file is part of Sponge, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.spongepowered.common.accessor.world;

import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.damagesource.DamageSources;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;

@Mixin(DamageSources.class)
public interface DamageSourcesAccessor {

@Accessor("inFire") void accessor$setInFire(DamageSource source);
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,24 @@
import net.minecraft.core.BlockPos;
import net.minecraft.world.entity.animal.Turtle;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
import org.spongepowered.asm.mixin.gen.Invoker;

@Mixin(Turtle.class)
public interface TurtleAccessor {

@Invoker("getHomePos") BlockPos invoker$getHomePos();
@Accessor("homePos") BlockPos invoker$getHomePos();

@Invoker("getTravelPos") BlockPos invoker$getTravelPos();
@Accessor("travelPos") BlockPos invoker$getTravelPos();

@Invoker("setTravelPos") void invoker$setTravelPos(final BlockPos travelPos);
@Accessor("travelPos") void invoker$setTravelPos(final BlockPos travelPos);

@Invoker("setHasEgg") void invoker$setHasEgg(final boolean hasEgg);

@Invoker("setLayingEgg") void invoker$setLayingEgg(final boolean layingEgg);

@Invoker("isGoingHome") boolean invoker$isGoingHome();
@Accessor("goingHome") boolean invoker$isGoingHome();

@Invoker("setGoingHome") void invoker$setGoingHome(final boolean goingHome);

@Invoker("isTravelling") boolean invoker$isTravelling();

@Invoker("setTravelling") void invoker$setTravelling(final boolean travelling);
@Accessor("goingHome") void invoker$setGoingHome(final boolean goingHome);

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.spongepowered.common.accessor.world.entity.animal;
package org.spongepowered.common.accessor.world.entity.animal.sheep;

import net.minecraft.network.syncher.EntityDataAccessor;
import net.minecraft.world.entity.animal.Sheep;
import net.minecraft.world.entity.animal.sheep.Sheep;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
import org.spongepowered.common.UntransformedAccessorError;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/
package org.spongepowered.common.accessor.world.entity.monster;

import net.minecraft.world.entity.animal.Sheep;
import net.minecraft.world.entity.animal.sheep.Sheep;
import net.minecraft.world.entity.monster.Evoker;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
Expand Down
6 changes: 4 additions & 2 deletions src/accessors/resources/mixins.sponge.accessors.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"core.MappedRegistryAccessor",
"entity.animal.frog.FrogAccessor",
"entity.passive.AbstractChestedHorseEntityAccessor",
"entity.vehicle.AbstractMinecartAccessor",
"network.ConnectionAccessor",
"network.chat.StyleAccessor",
"network.protocol.game.ClientboundAddEntityPacketAccessor",
Expand Down Expand Up @@ -53,9 +54,10 @@
"sounds.SoundEventAccessor",
"stats.StatsCounterAccessor",
"tags.TagEntryAccessor",
"util.datafix.schemas.V100Accessor",
"util.datafix.schemas.V100Accessor",
"util.thread.AbstractConsecutiveExecutorAccessor",
"world.CompoundContainerAccessor",
"world.DamageSourcesAccessor",
"world.damagesource.CombatTrackerAccessor",
"world.entity.AgableMobAccessor",
"world.entity.AreaEffectCloudAccessor",
Expand All @@ -82,14 +84,14 @@
"world.entity.animal.PigAccessor",
"world.entity.animal.PufferfishAccessor",
"world.entity.animal.RabbitAccessor",
"world.entity.animal.SheepAccessor",
"world.entity.animal.TropicalFishAccessor",
"world.entity.animal.TurtleAccessor",
"world.entity.animal.WolfAccessor",
"world.entity.animal.horse.AbstractHorseAccessor",
"world.entity.animal.horse.HorseAccessor",
"world.entity.animal.horse.LlamaAccessor",
"world.entity.animal.horse.TraderLlamaAccessor",
"world.entity.animal.sheep.SheepAccessor",
"world.entity.boss.enderdragon.phases.EnderDragonPhaseAccessor",
"world.entity.boss.wither.WitherBossAccessor",
"world.entity.decoration.ArmorStandAccessor",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ public Collection<String> getAliasesThatStartWithForCause(final CommandCause cau
final Object2BooleanMap<CommandMapping> testedMappings = new Object2BooleanOpenHashMap<>();
for (final Map.Entry<String, SpongeCommandMapping> mappingEntry : this.commandMappings.entrySet()) {
if (mappingEntry.getKey().startsWith(toCompare)) {
if (testedMappings.computeBooleanIfAbsent(mappingEntry.getValue(), mapping -> mapping.registrar().canExecute(cause, mapping))) {
if (testedMappings.computeIfAbsent(mappingEntry.getValue(), (CommandMapping mapping) -> mapping.registrar().canExecute(cause, mapping))) {
aliases.add(toCompare);
}
}
Expand Down
Loading

0 comments on commit 6b056e9

Please sign in to comment.