mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-22 07:08:47 +01:00
Fix NPE when setting cook multiplier (#5956)
This commit is contained in:
parent
3c58c05c8c
commit
28aacb44dd
2 changed files with 5 additions and 3 deletions
|
@ -223,3 +223,5 @@ public net.minecraft.world.entity.animal.Fox setDefending(Z)V
|
||||||
public net.minecraft.world.entity.animal.Fox isFaceplanted()Z
|
public net.minecraft.world.entity.animal.Fox isFaceplanted()Z
|
||||||
public net.minecraft.world.entity.animal.Fox setFaceplanted(Z)V
|
public net.minecraft.world.entity.animal.Fox setFaceplanted(Z)V
|
||||||
|
|
||||||
|
# Cook speed multipler API
|
||||||
|
public net.minecraft.world.level.block.entity.AbstractFurnaceBlockEntity recipeType
|
||||||
|
|
|
@ -11,7 +11,7 @@ to the nearest Integer when updating its current cook time.
|
||||||
Modified by: Eric Su <ericsu@alumni.usc.edu>
|
Modified by: Eric Su <ericsu@alumni.usc.edu>
|
||||||
|
|
||||||
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
|
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
|
--- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||||
+++ b/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
|
@@ -71,6 +71,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
|
||||||
|
@ -80,7 +80,7 @@ index cfa095d39843dd4963c817b824228a4b48a8c1cd..60cbb6616851758c7b8a9c90f4bb7e16
|
||||||
this.setChanged();
|
this.setChanged();
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java b/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java
|
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
|
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java
|
||||||
+++ b/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
|
@@ -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");
|
+ com.google.common.base.Preconditions.checkArgument(multiplier <= 200, "Furnace speed multiplier cannot more than 200");
|
||||||
+ T snapshot = this.getSnapshot();
|
+ T snapshot = this.getSnapshot();
|
||||||
+ snapshot.cookSpeedMultiplier = multiplier;
|
+ 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
|
+ // Paper end
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue