mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-27 23:10:16 +01:00
Fix NPE when setting cook multiplier (#5956)
This commit is contained in:
parent
5b8a29a0cc
commit
7c2140bc63
2 changed files with 3 additions and 1 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 setFaceplanted(Z)V
|
||||
|
||||
# Cook speed multipler API
|
||||
public net.minecraft.world.level.block.entity.AbstractFurnaceBlockEntity recipeType
|
||||
|
|
|
@ -100,7 +100,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ 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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue