Skip to content

Commit 8a6fe45

Browse files
committed
Fix SpongeNeo furnace mixin
1 parent 7f150a0 commit 8a6fe45

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

neoforge/src/mixins/java/org/spongepowered/neoforge/mixin/core/world/level/block/entity/AbstractFurnaceBlockEntityMixin_Neo.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public abstract class AbstractFurnaceBlockEntityMixin_Neo extends BaseContainerB
7070

7171
// @formatter:off
7272
@Shadow protected NonNullList<ItemStack> items;
73-
@Shadow int cookingProgress;
73+
@Shadow int cookingTimer;
7474
// @formatter:on
7575

7676
private boolean neo$filledWaterBucket;
@@ -93,13 +93,13 @@ public abstract class AbstractFurnaceBlockEntityMixin_Neo extends BaseContainerB
9393
final ItemStackSnapshot fuel = ItemStackUtil.snapshotOf(slots.get(1));
9494

9595
final Cause cause = PhaseTracker.getCauseStackManager().currentCause();
96-
if (entity.cookingProgress == 0) { // Start
96+
if (entity.cookingTimer == 0) { // Start
9797
final CookingEvent.Start event = SpongeEventFactory.createCookingEventStart(cause, (FurnaceBlockEntity) entityIn, Optional.of(fuel),
9898
Optional.of((CookingRecipe) recipe.value()), Optional.of((ResourceKey) (Object) recipe.id().location()));
9999
SpongeCommon.post(event);
100100
return !event.isCancelled();
101101
} else { // Tick up
102-
final ItemStackSnapshot cooking = ItemStackUtil.snapshotOf(entity.items.get(0));
102+
final ItemStackSnapshot cooking = ItemStackUtil.snapshotOf(entity.items.getFirst());
103103
final CookingEvent.Tick event = SpongeEventFactory.createCookingEventTick(cause, (FurnaceBlockEntity) entityIn, cooking, Optional.of(fuel),
104104
Optional.of((CookingRecipe) recipe.value()), Optional.of((ResourceKey) (Object) recipe.id().location()));
105105
SpongeCommon.post(event);
@@ -124,7 +124,7 @@ public abstract class AbstractFurnaceBlockEntityMixin_Neo extends BaseContainerB
124124
recipe.map(r -> (CookingRecipe) r.value()), recipe.map(r -> (ResourceKey) (Object) r.id()));
125125
SpongeCommon.post(event);
126126
if (event.isCancelled()) {
127-
return entity.cookingProgress; // dont tick down
127+
return entity.cookingTimer; // dont tick down
128128
}
129129

130130
return clampedCookTime;

0 commit comments

Comments
 (0)