papermc/Spigot-Server-Patches/0074-Fix-Furnace-cook-time-bug.patch

27 lines
1.2 KiB
Diff
Raw Normal View History

From 07a7621aa33ff2427947824eb0dcafdc3fc77537 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 18 Mar 2016 14:24:53 -0400
Subject: [PATCH] Fix Furnace cook time bug
If the server lags out and skips multiple ticks, Furnace cooking behavior would not
cook in the expected amount of time as the cook time was not decremented correctly.
This patch ensures that furnaces cook to the correct wall time expectation.
diff --git a/src/main/java/net/minecraft/server/TileEntityFurnace.java b/src/main/java/net/minecraft/server/TileEntityFurnace.java
index 2f1f3ed..ef63236 100644
--- a/src/main/java/net/minecraft/server/TileEntityFurnace.java
+++ b/src/main/java/net/minecraft/server/TileEntityFurnace.java
2016-11-17 02:23:38 +00:00
@@ -165,7 +165,7 @@ public class TileEntityFurnace extends TileEntityContainer implements ITickable,
2016-03-19 02:32:31 +00:00
if (this.isBurning() && this.canBurn()) {
this.cookTime += elapsedTicks;
if (this.cookTime >= this.cookTimeTotal) {
2016-03-19 02:32:31 +00:00
- this.cookTime = 0;
2016-11-17 02:23:38 +00:00
+ this.cookTime -= this.a(this.items.get(0)); // Paper
this.cookTimeTotal = this.a((ItemStack) this.items.get(0));
this.burn();
flag1 = true;
--
2.9.3