From bb8e3f0643691db485cf81974fefac1cc7fc383c Mon Sep 17 00:00:00 2001 From: Gabriel Harris-Rouquette Date: Mon, 25 Nov 2024 19:19:06 -0800 Subject: [PATCH] chore: update to 1.21.4-pre2 - Furnaces changed field names for burn times and cooking times - I assume these fields are correctly renamed for their accessors, they appear to function the same way for their Data API Keys --- gradle.properties | 2 +- .../entity/AbstractFurnaceBlockEntityAccessor.java | 12 ++++++------ .../entity/AbstractFurnaceBlockEntityMixin_API.java | 12 ++++++------ .../entity/AbstractFurnaceBlockEntityMixin.java | 6 +++--- .../AbstractFurnaceBlockEntityMixin_Vanilla.java | 6 +++--- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/gradle.properties b/gradle.properties index a672366bc6c..ce9cfb79194 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.4-pre1 +minecraftVersion=1.21.4-pre2 recommendedVersion=0-SNAPSHOT org.gradle.dependency.verification.console=verbose diff --git a/src/accessors/java/org/spongepowered/common/accessor/world/level/block/entity/AbstractFurnaceBlockEntityAccessor.java b/src/accessors/java/org/spongepowered/common/accessor/world/level/block/entity/AbstractFurnaceBlockEntityAccessor.java index 2ec3b5a53e5..784fb5e1a0c 100644 --- a/src/accessors/java/org/spongepowered/common/accessor/world/level/block/entity/AbstractFurnaceBlockEntityAccessor.java +++ b/src/accessors/java/org/spongepowered/common/accessor/world/level/block/entity/AbstractFurnaceBlockEntityAccessor.java @@ -34,17 +34,17 @@ @Mixin(AbstractFurnaceBlockEntity.class) public interface AbstractFurnaceBlockEntityAccessor { - @Accessor("litTime") int accessor$litTime(); + @Accessor("litTotalTime") int accessor$litTime(); - @Accessor("litTime") void accessor$litTime(final int litTime); + @Accessor("litTotalTime") void accessor$litTime(final int litTime); - @Accessor("litDuration") int accessor$litDuration(); + @Accessor("litTimeRemaining") int accessor$litDuration(); - @Accessor("litDuration") void accessor$litDuration(final int litDuration); + @Accessor("litTimeRemaining") void accessor$litDuration(final int litDuration); - @Accessor("cookingProgress") int accessor$cookingProgress(); + @Accessor("cookingTimer") int accessor$cookingProgress(); - @Accessor("cookingProgress") void accessor$cookingProgress(final int cookingProgress); + @Accessor("cookingTimer") void accessor$cookingProgress(final int cookingProgress); @Accessor("cookingTotalTime") int accessor$cookingTotalTime(); diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/block/entity/AbstractFurnaceBlockEntityMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/block/entity/AbstractFurnaceBlockEntityMixin_API.java index d2f65b5e945..6daaeeea2f3 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/block/entity/AbstractFurnaceBlockEntityMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/block/entity/AbstractFurnaceBlockEntityMixin_API.java @@ -42,9 +42,9 @@ public abstract class AbstractFurnaceBlockEntityMixin_API extends BaseContainerBlockEntityMixin_API implements FurnaceBlockEntity { // @formatter:off - @Shadow int litTime; - @Shadow int litDuration; - @Shadow int cookingProgress; + @Shadow int litTimeRemaining; + @Shadow int litTotalTime; + @Shadow int cookingTimer; @Shadow int cookingTotalTime; @Shadow protected NonNullList items; // @formatter:on @@ -64,9 +64,9 @@ public abstract class AbstractFurnaceBlockEntityMixin_API extends BaseContainerB @Override public DataContainer toContainer() { return super.toContainer() - .set(Constants.TileEntity.Furnace.BURN_TIME, this.litTime) - .set(Constants.TileEntity.Furnace.BURN_TIME_TOTAL, this.litDuration) - .set(Constants.TileEntity.Furnace.COOK_TIME, this.cookingProgress) + .set(Constants.TileEntity.Furnace.BURN_TIME, this.litTimeRemaining) + .set(Constants.TileEntity.Furnace.BURN_TIME_TOTAL, this.litTotalTime) + .set(Constants.TileEntity.Furnace.COOK_TIME, this.cookingTimer) .set(Constants.TileEntity.Furnace.COOK_TIME_TOTAL, this.cookingTotalTime); } diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/world/level/block/entity/AbstractFurnaceBlockEntityMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/world/level/block/entity/AbstractFurnaceBlockEntityMixin.java index 37dbda079b0..b3cd4278e08 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/world/level/block/entity/AbstractFurnaceBlockEntityMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/world/level/block/entity/AbstractFurnaceBlockEntityMixin.java @@ -65,7 +65,7 @@ public abstract class AbstractFurnaceBlockEntityMixin extends BaseContainerBlock // @Formatter:off @Shadow protected NonNullList items; - @Shadow int cookingProgress; + @Shadow int cookingTimer; @Shadow int cookingTotalTime; // @Formatter:on @@ -130,7 +130,7 @@ public abstract class AbstractFurnaceBlockEntityMixin extends BaseContainerBlock shift = At.Shift.BEFORE, value = "FIELD", opcode = Opcodes.PUTFIELD, - target = "Lnet/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity;cookingProgress:I" + target = "Lnet/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity;cookingTimer:I" ), slice = @Slice( from = @At( @@ -149,7 +149,7 @@ public abstract class AbstractFurnaceBlockEntityMixin extends BaseContainerBlock } private void impl$callInteruptSmeltEvent() { - if (this.cookingProgress > 0) { + if (this.cookingTimer > 0) { final ItemStackSnapshot fuel = ItemStackUtil.snapshotOf(this.items.get(1)); final Cause cause = PhaseTracker.getCauseStackManager().currentCause(); final var recipe = this.bridge$getCurrentRecipe(); diff --git a/vanilla/src/mixins/java/org/spongepowered/vanilla/mixin/core/world/level/block/entity/AbstractFurnaceBlockEntityMixin_Vanilla.java b/vanilla/src/mixins/java/org/spongepowered/vanilla/mixin/core/world/level/block/entity/AbstractFurnaceBlockEntityMixin_Vanilla.java index 24ac7f4ffd7..d836ecb8c41 100644 --- a/vanilla/src/mixins/java/org/spongepowered/vanilla/mixin/core/world/level/block/entity/AbstractFurnaceBlockEntityMixin_Vanilla.java +++ b/vanilla/src/mixins/java/org/spongepowered/vanilla/mixin/core/world/level/block/entity/AbstractFurnaceBlockEntityMixin_Vanilla.java @@ -70,7 +70,7 @@ public abstract class AbstractFurnaceBlockEntityMixin_Vanilla extends BaseContai // @formatter:off @Shadow protected NonNullList items; - @Shadow int cookingProgress; + @Shadow int cookingTimer; // @formatter:on private boolean vanilla$filledWaterBucket; @@ -92,7 +92,7 @@ public abstract class AbstractFurnaceBlockEntityMixin_Vanilla extends BaseContai final ItemStackSnapshot fuel = ItemStackUtil.snapshotOf(slots.get(1)); final Cause cause = PhaseTracker.getCauseStackManager().currentCause(); - if (entity.cookingProgress == 0) { // Start + if (entity.cookingTimer == 0) { // Start final CookingEvent.Start event = SpongeEventFactory.createCookingEventStart(cause, (FurnaceBlockEntity) entityIn, Optional.of(fuel), Optional.of((CookingRecipe) recipe.value()), Optional.of((ResourceKey) (Object) recipe.id().location())); SpongeCommon.post(event); @@ -122,7 +122,7 @@ public abstract class AbstractFurnaceBlockEntityMixin_Vanilla extends BaseContai recipe.map(r -> (CookingRecipe) r.value()), recipe.map(r -> (ResourceKey) (Object) r.id().location())); SpongeCommon.post(event); if (event.isCancelled()) { - return entity.cookingProgress; // dont tick down + return entity.cookingTimer; // dont tick down } return clampedCookTime;