From c588b3d7078ad9f0e258d9247f25af0acfeb0253 Mon Sep 17 00:00:00 2001 From: Gabriel Harris-Rouquette Date: Sat, 12 Oct 2024 10:39:32 -0700 Subject: [PATCH] chore: update to 1.21.2-pre3 Signed-off-by: Gabriel Harris-Rouquette --- gradle.properties | 2 +- .../common/effect/sound/SpongeSoundBuilder.java | 2 +- .../common/event/SpongeCommonEventFactory.java | 4 ++-- .../transaction/effect/ChunkChangeCompleteEffect.java | 2 +- .../event/tracking/phase/tick/BlockTickPhaseState.java | 8 ++++---- .../common/world/biome/SpongeBiomeTemplate.java | 2 +- .../world/biome/ambient/SpongeSoundConfigFactory.java | 6 +++--- .../common/world/volume/VolumeStreamUtils.java | 2 +- .../api/minecraft/block/BlockSoundGroupMixin_API.java | 10 +++++----- .../mixin/api/minecraft/sounds/MusicMixin_API.java | 2 +- .../api/minecraft/world/item/JukeboxSongMixin_API.java | 2 +- .../minecraft/world/level/LevelAccessorMixin_API.java | 2 +- .../level/biome/AmbientAdditionsSettingsMixin_API.java | 2 +- .../level/biome/AmbientMoodSettingsMixin_API.java | 2 +- .../state/properties/NoteBlockInstrumentMixin_API.java | 2 +- .../world/level/chunk/ChunkAccessMixin_API.java | 4 ++-- .../world/level/chunk/LevelChunkMixin_API.java | 2 +- .../mixin/core/server/level/ServerLevelMixin.java | 2 +- .../common/mixin/core/world/entity/EntityMixin.java | 2 +- .../world/entity/projectile/AbstractArrowMixin.java | 6 +++--- .../mixin/core/world/level/chunk/LevelChunkMixin.java | 10 ++++++---- 21 files changed, 39 insertions(+), 37 deletions(-) diff --git a/gradle.properties b/gradle.properties index 7d619435edd..a51d9f41d21 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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=1.21.2-pre1 +minecraftVersion=1.21.2-pre3 recommendedVersion=0-SNAPSHOT org.gradle.dependency.verification.console=verbose diff --git a/src/main/java/org/spongepowered/common/effect/sound/SpongeSoundBuilder.java b/src/main/java/org/spongepowered/common/effect/sound/SpongeSoundBuilder.java index d6f6dbb9a6a..9b99d2bfb6c 100644 --- a/src/main/java/org/spongepowered/common/effect/sound/SpongeSoundBuilder.java +++ b/src/main/java/org/spongepowered/common/effect/sound/SpongeSoundBuilder.java @@ -33,6 +33,6 @@ public final class SpongeSoundBuilder extends AbstractResourceKeyedBuilder registry = ((Level) phaseContext.world).registryAccess().registryOrThrow(Registries.BLOCK); - final @Nullable Block fruitBlock = registry.get(((StemBlockAccessor) stemBlock).accessor$fruit()); - final @Nullable Block attachedStemBlock = registry.get(((StemBlockAccessor) stemBlock).accessor$attachedStem()); + final Registry registry = ((ServerLevel) phaseContext.world).registryAccess().lookupOrThrow(Registries.BLOCK); + final @Nullable Block fruitBlock = registry.getValue(((StemBlockAccessor) stemBlock).accessor$fruit()); + final @Nullable Block attachedStemBlock = registry.getValue(((StemBlockAccessor) stemBlock).accessor$attachedStem()); if (newBlock == fruitBlock || newBlock == attachedStemBlock) { return BlockChange.GROW; } diff --git a/src/main/java/org/spongepowered/common/world/biome/SpongeBiomeTemplate.java b/src/main/java/org/spongepowered/common/world/biome/SpongeBiomeTemplate.java index 9849bc7e832..481ed65a69c 100644 --- a/src/main/java/org/spongepowered/common/world/biome/SpongeBiomeTemplate.java +++ b/src/main/java/org/spongepowered/common/world/biome/SpongeBiomeTemplate.java @@ -195,7 +195,7 @@ protected BiomeTemplate build0() { foliageColor.ifPresent(c -> effectsBuilder.foliageColorOverride(c.rgb())); grassColor.ifPresent(c -> effectsBuilder.grassColorOverride(c.rgb())); particleSettings.ifPresent(ps -> effectsBuilder.ambientParticle((AmbientParticleSettings) ps)); - ambientSound.ifPresent(s -> effectsBuilder.ambientLoopSound(Holder.direct((SoundEvent) s))); + ambientSound.ifPresent(s -> effectsBuilder.ambientLoopSound(Holder.direct((SoundEvent) (Object) s))); ambientMood.ifPresent(m -> effectsBuilder.ambientMoodSound((net.minecraft.world.level.biome.AmbientMoodSettings) m)); additionalSound.ifPresent(s -> effectsBuilder.ambientAdditionsSound((AmbientAdditionsSettings) s)); backgroundMusic.ifPresent(m -> effectsBuilder.backgroundMusic((Music) m)); diff --git a/src/main/java/org/spongepowered/common/world/biome/ambient/SpongeSoundConfigFactory.java b/src/main/java/org/spongepowered/common/world/biome/ambient/SpongeSoundConfigFactory.java index 425d535c24c..286d309f889 100644 --- a/src/main/java/org/spongepowered/common/world/biome/ambient/SpongeSoundConfigFactory.java +++ b/src/main/java/org/spongepowered/common/world/biome/ambient/SpongeSoundConfigFactory.java @@ -36,16 +36,16 @@ public class SpongeSoundConfigFactory implements SoundConfig.Factory { @Override public SoundConfig.Mood ofAmbientMood(final SoundType sound, final int tickDelay, final int searchRadius, final double distanceModifier) { - return (SoundConfig.Mood) new AmbientMoodSettings(Holder.direct((SoundEvent) sound), tickDelay, searchRadius, distanceModifier); + return (SoundConfig.Mood) new AmbientMoodSettings(Holder.direct((SoundEvent) (Object) sound), tickDelay, searchRadius, distanceModifier); } @Override public SoundConfig.Additional ofAdditional(final SoundType sound, final double tickChance) { - return (SoundConfig.Additional) new AmbientAdditionsSettings(Holder.direct((SoundEvent) sound), tickChance); + return (SoundConfig.Additional) new AmbientAdditionsSettings(Holder.direct((SoundEvent) (Object) sound), tickChance); } @Override public SoundConfig.BackgroundMusic ofBackroundMusic(final SoundType sound, final int minDelay, final int maxDelay, final boolean replacesCurrent) { - return (SoundConfig.BackgroundMusic) new Music(Holder.direct((SoundEvent) sound), minDelay, maxDelay, replacesCurrent); + return (SoundConfig.BackgroundMusic) new Music(Holder.direct((SoundEvent) (Object) sound), minDelay, maxDelay, replacesCurrent); } } diff --git a/src/main/java/org/spongepowered/common/world/volume/VolumeStreamUtils.java b/src/main/java/org/spongepowered/common/world/volume/VolumeStreamUtils.java index e76db24809d..d611184cbdb 100644 --- a/src/main/java/org/spongepowered/common/world/volume/VolumeStreamUtils.java +++ b/src/main/java/org/spongepowered/common/world/volume/VolumeStreamUtils.java @@ -321,7 +321,7 @@ public static boolean setBiome(final ChunkAccess chunk, final int x, final int y ) { final boolean result = VolumeStreamUtils.setBiome(chunk.getSection(chunk.getSectionIndex(y)), x, y, z, biome); if (result) { - chunk.setUnsaved(true); + chunk.markUnsaved(); } return result; } diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/block/BlockSoundGroupMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/block/BlockSoundGroupMixin_API.java index 69aa244b41b..8c72f740ca9 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/block/BlockSoundGroupMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/block/BlockSoundGroupMixin_API.java @@ -56,26 +56,26 @@ public double pitch() { @Override public org.spongepowered.api.effect.sound.SoundType breakSound() { - return (org.spongepowered.api.effect.sound.SoundType) this.breakSound; + return (org.spongepowered.api.effect.sound.SoundType) (Object) this.breakSound; } @Override public org.spongepowered.api.effect.sound.SoundType stepSound() { - return (org.spongepowered.api.effect.sound.SoundType) this.stepSound; + return (org.spongepowered.api.effect.sound.SoundType) (Object) this.stepSound; } @Override public org.spongepowered.api.effect.sound.SoundType placeSound() { - return (org.spongepowered.api.effect.sound.SoundType) this.placeSound; + return (org.spongepowered.api.effect.sound.SoundType) (Object) this.placeSound; } @Override public org.spongepowered.api.effect.sound.SoundType hitSound() { - return (org.spongepowered.api.effect.sound.SoundType) this.hitSound; + return (org.spongepowered.api.effect.sound.SoundType) (Object) this.hitSound; } @Override public org.spongepowered.api.effect.sound.SoundType fallSound() { - return (org.spongepowered.api.effect.sound.SoundType) this.fallSound; + return (org.spongepowered.api.effect.sound.SoundType) (Object) this.fallSound; } } diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/sounds/MusicMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/sounds/MusicMixin_API.java index 102078cbe50..55c04b7c5d3 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/sounds/MusicMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/sounds/MusicMixin_API.java @@ -45,7 +45,7 @@ public abstract class MusicMixin_API implements SoundConfig.BackgroundMusic { @Override public SoundType sound() { - return (SoundType) this.event.value(); + return (SoundType) (Object) this.event.value(); } @Override diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/item/JukeboxSongMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/item/JukeboxSongMixin_API.java index 7b7fa4a636a..1ac5dd00437 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/item/JukeboxSongMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/item/JukeboxSongMixin_API.java @@ -40,6 +40,6 @@ public abstract class JukeboxSongMixin_API implements MusicDisc { @Override public SoundType sound() { - return (SoundType) this.soundEvent.value(); + return (SoundType) (Object) this.soundEvent.value(); } } diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/LevelAccessorMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/LevelAccessorMixin_API.java index 7e88eb2b746..8b51058fdbd 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/LevelAccessorMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/LevelAccessorMixin_API.java @@ -98,7 +98,7 @@ default boolean setBiome(final int x, final int y, final int z, final org.sponge return false; } - return VolumeStreamUtils.setBiomeOnNativeChunk(x, y, z, biome, () -> iChunk.getSection(iChunk.getSectionIndex(y)), () -> iChunk.setUnsaved(true)); + return VolumeStreamUtils.setBiomeOnNativeChunk(x, y, z, biome, () -> iChunk.getSection(iChunk.getSectionIndex(y)), iChunk::markUnsaved); } // Volume diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/biome/AmbientAdditionsSettingsMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/biome/AmbientAdditionsSettingsMixin_API.java index d7be89e3af2..5aecb500911 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/biome/AmbientAdditionsSettingsMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/biome/AmbientAdditionsSettingsMixin_API.java @@ -43,7 +43,7 @@ public abstract class AmbientAdditionsSettingsMixin_API implements SoundConfig.A @Override public SoundType sound() { - return (SoundType) this.soundEvent.value(); + return (SoundType) (Object) this.soundEvent.value(); } @Override diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/biome/AmbientMoodSettingsMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/biome/AmbientMoodSettingsMixin_API.java index e047a72155d..4b93d6398b0 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/biome/AmbientMoodSettingsMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/biome/AmbientMoodSettingsMixin_API.java @@ -45,7 +45,7 @@ public abstract class AmbientMoodSettingsMixin_API implements SoundConfig.Mood { @Override public SoundType sound() { - return (SoundType) this.soundEvent.value(); + return (SoundType) (Object) this.soundEvent.value(); } @Override diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/block/state/properties/NoteBlockInstrumentMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/block/state/properties/NoteBlockInstrumentMixin_API.java index 5686585dcdb..ae1a8fae1be 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/block/state/properties/NoteBlockInstrumentMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/block/state/properties/NoteBlockInstrumentMixin_API.java @@ -41,6 +41,6 @@ public abstract class NoteBlockInstrumentMixin_API implements InstrumentType { @Override public SoundType sound() { - return (SoundType) this.shadow$getSoundEvent().value(); + return (SoundType) (Object) this.shadow$getSoundEvent().value(); } } diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/chunk/ChunkAccessMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/chunk/ChunkAccessMixin_API.java index 8d124e6d6b5..f1ea1749899 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/chunk/ChunkAccessMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/chunk/ChunkAccessMixin_API.java @@ -67,7 +67,7 @@ public abstract class ChunkAccessMixin_API

> implements Chunk< @Shadow public abstract ChunkPos shadow$getPos(); @Shadow public abstract int shadow$getHeight(Heightmap.Types var1, int var2, int var3); @Shadow public abstract LevelChunkSection shadow$getSection(int p_187657_); - @Shadow public abstract void shadow$setUnsaved(boolean p_62094_); + @Shadow public abstract void shadow$markUnsaved(); // @formatter:on @SuppressWarnings("unchecked") @Override @@ -96,7 +96,7 @@ public boolean isEmpty() { @Override public boolean setBiome(final int x, final int y, final int z, final Biome biome) { - return VolumeStreamUtils.setBiomeOnNativeChunk(x, y, z, biome, () -> this.shadow$getSection(this.getSectionIndex(y)), () -> this.shadow$setUnsaved(true)); + return VolumeStreamUtils.setBiomeOnNativeChunk(x, y, z, biome, () -> this.shadow$getSection(this.getSectionIndex(y)), this::shadow$markUnsaved); } @Override diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/chunk/LevelChunkMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/chunk/LevelChunkMixin_API.java index cbd945278b9..29080211aac 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/chunk/LevelChunkMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/chunk/LevelChunkMixin_API.java @@ -143,7 +143,7 @@ public Biome biome(final int x, final int y, final int z) { @Override public boolean setBiome(final int x, final int y, final int z, final Biome biome) { - return VolumeStreamUtils.setBiomeOnNativeChunk(x, y, z, biome, () -> this.getSection(this.getSectionIndex(y)), () -> this.setUnsaved(true)); + return VolumeStreamUtils.setBiomeOnNativeChunk(x, y, z, biome, () -> this.getSection(this.getSectionIndex(y)), this::markUnsaved); } @Intrinsic diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/server/level/ServerLevelMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/server/level/ServerLevelMixin.java index 814729115da..5a96da6bd3c 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/server/level/ServerLevelMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/server/level/ServerLevelMixin.java @@ -515,7 +515,7 @@ public void save(@Nullable final ProgressListener progress, final boolean flush, } } - @Redirect(method = "lambda$onBlockStateChange$13", + @Redirect(method = "lambda$onBlockStateChange$14", at = @At( value = "INVOKE", target = "Lnet/minecraft/world/entity/ai/village/poi/PoiManager;add(Lnet/minecraft/core/BlockPos;Lnet/minecraft/core/Holder;)V" diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/EntityMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/EntityMixin.java index 50f98456499..971e4b85784 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/EntityMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/EntityMixin.java @@ -743,7 +743,7 @@ public void stopRiding() { } - @Redirect(method = "applyEffectsFromBlocks(Lnet/minecraft/world/phys/Vec3;Lnet/minecraft/world/phys/Vec3;)V", + @Redirect(method = "checkInsideBlocks(Ljava/util/List;Ljava/util/Set;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/state/BlockState;entityInside(Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/entity/Entity;)V" ) diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/projectile/AbstractArrowMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/projectile/AbstractArrowMixin.java index b5c3ba26b91..7dde827bfc2 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/projectile/AbstractArrowMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/projectile/AbstractArrowMixin.java @@ -51,7 +51,6 @@ public abstract class AbstractArrowMixin extends ProjectileMixin implements Abst // @formatter:off @Shadow private int life; - @Shadow protected boolean inGround; @Shadow public int shakeTime; @Shadow public AbstractArrow.Pickup pickup; @Shadow @Nullable private BlockState lastState; @@ -60,9 +59,10 @@ public abstract class AbstractArrowMixin extends ProjectileMixin implements Abst @Shadow public abstract void shadow$setPierceLevel(byte level); @Shadow protected abstract ItemStack shadow$getPickupItem(); @Shadow protected abstract void resetPiercedEntities(); - + @Shadow protected abstract void shadow$setInGround(boolean $$0); // @formatter:on + @Nullable private Double impl$customKnockback; // Not all ProjectileSources are entities (e.g. BlockProjectileSource). @@ -97,7 +97,7 @@ private void onProjectileHit(final BlockHitResult hitResult, final CallbackInfo this.shadow$setDeltaMovement(vec3d); final Vec3 vec3d1 = vec3d.normalize().scale(0.05F); this.shadow$setPos(this.shadow$getX() - vec3d1.x, this.shadow$getY() - vec3d1.y, this.shadow$getZ() - vec3d1.z); - this.inGround = true; + this.shadow$setInGround(true); this.shakeTime = 7; this.shadow$setCritArrow(false); this.shadow$setPierceLevel((byte)0); diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/world/level/chunk/LevelChunkMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/world/level/chunk/LevelChunkMixin.java index 07a4474a29c..7a6618479d1 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/world/level/chunk/LevelChunkMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/world/level/chunk/LevelChunkMixin.java @@ -92,7 +92,9 @@ public abstract class LevelChunkMixin extends ChunkAccess implements LevelChunkB @Shadow @Nullable public abstract BlockEntity shadow$getBlockEntity(BlockPos pos, net.minecraft.world.level.chunk.LevelChunk.EntityCreationType p_177424_2_); @Shadow public abstract BlockState shadow$getBlockState(BlockPos pos); @Shadow public abstract void shadow$addEntity(net.minecraft.world.entity.Entity param0); - // @formatter:on + @Shadow public abstract void shadow$markUnsaved(); +// @formatter:on + private long impl$scheduledForUnload = -1; // delay chunk unloads private boolean impl$persistedChunk = false; @@ -130,7 +132,7 @@ public LevelChunkMixin( @Override public void bridge$markChunkDirty() { - this.unsaved = true; + this.shadow$markUnsaved(); } @Override @@ -399,14 +401,14 @@ public String toString() { @Override public DataTransactionResult bridge$offer(final Key<@NonNull ? extends Value> key, final E value) { final DataTransactionResult result = DataHolderProcessor.bridge$offer(this, key, value); - this.unsaved = true; + this.shadow$markUnsaved(); return result; } @Override public DataTransactionResult bridge$remove(final Key<@NonNull ? extends Value> key) { final DataTransactionResult result = DataHolderProcessor.bridge$remove(this, key); - this.unsaved = true; + this.shadow$markUnsaved(); return result; }