forked from PaperMC/Paper
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix NPE when setting cook multiplier (PaperMC#5956)
- Loading branch information
1 parent
3c58c05
commit 28aacb4
Showing
2 changed files
with
5 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ to the nearest Integer when updating its current cook time. | |
Modified by: Eric Su <[email protected]> | ||
|
||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java | ||
index cfa095d39843dd4963c817b824228a4b48a8c1cd..60cbb6616851758c7b8a9c90f4bb7e169358f123 100644 | ||
index e43fd7185b4570713d8ee2361d633c94d187fe2b..6c8518cdf768bd2b613f3f2159d977d2035921c1 100644 | ||
--- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java | ||
+++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java | ||
@@ -71,6 +71,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit | ||
|
@@ -80,7 +80,7 @@ index cfa095d39843dd4963c817b824228a4b48a8c1cd..60cbb6616851758c7b8a9c90f4bb7e16 | |
this.setChanged(); | ||
} | ||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java b/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java | ||
index 5028a6388f95a14df8d1590cddd7414d8de5bf78..a05704665f7718b189f0c60ae42c615fce408b0c 100644 | ||
index 5028a6388f95a14df8d1590cddd7414d8de5bf78..92c156b09cc46e5d70ed7d803683787248495a62 100644 | ||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java | ||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java | ||
@@ -63,4 +63,20 @@ public abstract class CraftFurnace<T extends AbstractFurnaceBlockEntity> extends | ||
|
@@ -100,7 +100,7 @@ index 5028a6388f95a14df8d1590cddd7414d8de5bf78..a05704665f7718b189f0c60ae42c615f | |
+ com.google.common.base.Preconditions.checkArgument(multiplier <= 200, "Furnace speed multiplier cannot more than 200"); | ||
+ T snapshot = this.getSnapshot(); | ||
+ snapshot.cookSpeedMultiplier = multiplier; | ||
+ snapshot.cookingTotalTime = AbstractFurnaceBlockEntity.getTotalCookTime(this.world.getHandle(), snapshot.getCurrentRecipe().getType(), ((CraftInventoryFurnace) this.getInventory()).getInventory(), snapshot.cookSpeedMultiplier); // Update the snapshot's current total cook time to scale with the newly set multiplier | ||
+ snapshot.cookingTotalTime = AbstractFurnaceBlockEntity.getTotalCookTime(this.world.getHandle(), snapshot.recipeType, snapshot, snapshot.cookSpeedMultiplier); // Update the snapshot's current total cook time to scale with the newly set multiplier | ||
+ } | ||
+ // Paper end | ||
} |