Skip to content

Commit 8fa0e2c

Browse files
committed
Fix furnace ticking errors on modded platforms
1 parent fd7af74 commit 8fa0e2c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

forge/src/mixins/java/org/spongepowered/forge/mixin/core/world/level/block/entity/AbstractFurnaceBlockEntityMixin_Forge.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,13 @@ public abstract class AbstractFurnaceBlockEntityMixin_Forge implements AbstractF
9898
final Cause cause = PhaseTracker.getCauseStackManager().currentCause();
9999
if (entity.cookingProgress == 0) { // Start
100100
final CookingEvent.Start event = SpongeEventFactory.createCookingEventStart(cause, (FurnaceBlockEntity) entityIn, Optional.of(fuel),
101-
Optional.of((CookingRecipe) recipe.value()), Optional.of((ResourceKey) (Object) recipe.id()));
101+
Optional.of((CookingRecipe) recipe.value()), Optional.of((ResourceKey) (Object) recipe.id().location()));
102102
SpongeCommon.post(event);
103103
return !event.isCancelled();
104104
} else { // Tick up
105105
final ItemStackSnapshot cooking = ItemStackUtil.snapshotOf(entity.items.get(0));
106106
final CookingEvent.Tick event = SpongeEventFactory.createCookingEventTick(cause, (FurnaceBlockEntity) entityIn, cooking, Optional.of(fuel),
107-
Optional.of((CookingRecipe) recipe.value()), Optional.of((ResourceKey) (Object) recipe.id()));
107+
Optional.of((CookingRecipe) recipe.value()), Optional.of((ResourceKey) (Object) recipe.id().location()));
108108
SpongeCommon.post(event);
109109
return !event.isCancelled();
110110
}
@@ -173,7 +173,7 @@ public abstract class AbstractFurnaceBlockEntityMixin_Forge implements AbstractF
173173
}
174174
final Optional<ItemStackSnapshot> fuel = hasFuel && !slots.get(1).isEmpty() ? Optional.of(ItemStackUtil.snapshotOf(slots.get(1))) : Optional.empty();
175175
final CookingEvent.Finish event = SpongeEventFactory.createCookingEventFinish(PhaseTracker.getCauseStackManager().currentCause(), entity,
176-
fuel, Optional.of((CookingRecipe) recipe.value()), Optional.of((ResourceKey) (Object) recipe.id()), Collections.unmodifiableList(transactions));
176+
fuel, Optional.of((CookingRecipe) recipe.value()), Optional.of((ResourceKey) (Object) recipe.id().location()), Collections.unmodifiableList(transactions));
177177
SpongeCommon.post(event);
178178

179179
for (final SlotTransaction transaction : transactions) {

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,13 @@ public abstract class AbstractFurnaceBlockEntityMixin_Neo extends BaseContainerB
9595
final Cause cause = PhaseTracker.getCauseStackManager().currentCause();
9696
if (entity.cookingProgress == 0) { // Start
9797
final CookingEvent.Start event = SpongeEventFactory.createCookingEventStart(cause, (FurnaceBlockEntity) entityIn, Optional.of(fuel),
98-
Optional.of((CookingRecipe) recipe.value()), Optional.of((ResourceKey) (Object) recipe.id()));
98+
Optional.of((CookingRecipe) recipe.value()), Optional.of((ResourceKey) (Object) recipe.id().location()));
9999
SpongeCommon.post(event);
100100
return !event.isCancelled();
101101
} else { // Tick up
102102
final ItemStackSnapshot cooking = ItemStackUtil.snapshotOf(entity.items.get(0));
103103
final CookingEvent.Tick event = SpongeEventFactory.createCookingEventTick(cause, (FurnaceBlockEntity) entityIn, cooking, Optional.of(fuel),
104-
Optional.of((CookingRecipe) recipe.value()), Optional.of((ResourceKey) (Object) recipe.id()));
104+
Optional.of((CookingRecipe) recipe.value()), Optional.of((ResourceKey) (Object) recipe.id().location()));
105105
SpongeCommon.post(event);
106106
return !event.isCancelled();
107107
}
@@ -181,7 +181,7 @@ public abstract class AbstractFurnaceBlockEntityMixin_Neo extends BaseContainerB
181181
}
182182
final Optional<ItemStackSnapshot> fuel = hasFuel && !slots.get(1).isEmpty() ? Optional.of(ItemStackUtil.snapshotOf(slots.get(1))) : Optional.empty();
183183
final CookingEvent.Finish event = SpongeEventFactory.createCookingEventFinish(cause, entity,
184-
fuel, Optional.of((CookingRecipe) recipe.value()), Optional.of((ResourceKey) (Object) recipe.id()), Collections.unmodifiableList(transactions));
184+
fuel, Optional.of((CookingRecipe) recipe.value()), Optional.of((ResourceKey) (Object) recipe.id().location()), Collections.unmodifiableList(transactions));
185185
SpongeCommon.post(event);
186186

187187
for (final SlotTransaction transaction : transactions) {

0 commit comments

Comments
 (0)