Skip to content

Commit

Permalink
chore: update to 1.21.2-pre3
Browse files Browse the repository at this point in the history
Signed-off-by: Gabriel Harris-Rouquette <[email protected]>
  • Loading branch information
gabizou committed Oct 12, 2024
1 parent 29e4beb commit c588b3d
Show file tree
Hide file tree
Showing 21 changed files with 39 additions and 37 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=1.21.2-pre1
minecraftVersion=1.21.2-pre3
recommendedVersion=0-SNAPSHOT

org.gradle.dependency.verification.console=verbose
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ public final class SpongeSoundBuilder extends AbstractResourceKeyedBuilder<Sound

@Override
public SoundType build0() {
return (SoundType) SoundEventAccessor.accessor$createVariableRangeEvent((ResourceLocation) (Object) this.key);
return (SoundType) (Object) SoundEventAccessor.accessor$createVariableRangeEvent((ResourceLocation) (Object) this.key);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -717,14 +717,14 @@ public static PlaySoundEvent.AtEntity callPlaySoundAtEntityEvent(final Cause cau
final SoundEvent name, final float pitch, final float volume) {
final ServerLocation location = ServerLocation.of((ServerWorld) worldMixin, x, y, z);
final PlaySoundEvent.AtEntity event = SpongeEventFactory.createPlaySoundEventAtEntity(cause, location,
Optional.ofNullable((ServerPlayer) entity), SpongeAdventure.asAdventure(category), (SoundType) name, pitch, volume);
Optional.ofNullable((ServerPlayer) entity), SpongeAdventure.asAdventure(category), (SoundType) (Object) name, pitch, volume);
SpongeCommon.post(event);
return event;
}

public static PlaySoundEvent.NoteBlock callPlaySoundNoteBlockEvent(final Cause cause, final World world, final BlockPos pos, final SoundEvent soundEvent, final InstrumentType instrument, final NotePitch notePitch, final Float pitch) {
final ServerLocation location = ServerLocation.of((ServerWorld) world, pos.getX(), pos.getY(), pos.getZ());
final PlaySoundEvent.NoteBlock event = SpongeEventFactory.createPlaySoundEventNoteBlock(cause, instrument, location, notePitch, Sound.Source.RECORD, (SoundType)soundEvent, pitch, 3.0F);
final PlaySoundEvent.NoteBlock event = SpongeEventFactory.createPlaySoundEventNoteBlock(cause, instrument, location, notePitch, Sound.Source.RECORD, (SoundType) (Object) soundEvent, pitch, 3.0F);
SpongeCommon.post(event);
return event;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public EffectResult processSideEffect(final BlockPipeline pipeline, final Pipeli

final LevelChunk chunk = pipeline.getAffectedChunk();
// this.unsaved = true; // Vanilla, we'll just call the accessor available
chunk.setUnsaved(true);
chunk.markUnsaved();
return new EffectResult(oldState.state(), true);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

import net.minecraft.core.Registry;
import net.minecraft.core.registries.Registries;
import net.minecraft.world.level.Level;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.BonemealableBlock;
Expand Down Expand Up @@ -73,9 +73,9 @@ public BlockChange associateBlockChangeWithSnapshot(
if (newBlock instanceof BonemealableBlock) {
return BlockChange.GROW;
} else if (phaseContext.tickingBlock instanceof final StemBlock stemBlock) {
final Registry<Block> 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<Block> 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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public abstract class ChunkAccessMixin_API<P extends Chunk<P>> 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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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).
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -130,7 +132,7 @@ public LevelChunkMixin(

@Override
public void bridge$markChunkDirty() {
this.unsaved = true;
this.shadow$markUnsaved();
}

@Override
Expand Down Expand Up @@ -399,14 +401,14 @@ public String toString() {
@Override
public <E> DataTransactionResult bridge$offer(final Key<@NonNull ? extends Value<E>> key, final E value) {
final DataTransactionResult result = DataHolderProcessor.bridge$offer(this, key, value);
this.unsaved = true;
this.shadow$markUnsaved();
return result;
}

@Override
public <E> DataTransactionResult bridge$remove(final Key<@NonNull ? extends Value<E>> key) {
final DataTransactionResult result = DataHolderProcessor.bridge$remove(this, key);
this.unsaved = true;
this.shadow$markUnsaved();
return result;
}

Expand Down

0 comments on commit c588b3d

Please sign in to comment.