浏览代码

Fix brewing stands consuming all remaining fuel items when the fuel bar is refilled

minoneer 9 年之前
父节点
当前提交
25cad3afc6
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6 2
      src/main/java/com/gmail/nossr50/runnables/skills/AlchemyBrewTask.java

+ 6 - 2
src/main/java/com/gmail/nossr50/runnables/skills/AlchemyBrewTask.java

@@ -28,6 +28,7 @@ public class AlchemyBrewTask extends BukkitRunnable {
     private double brewTimer;
     private Player player;
     private int fuel;
+    private boolean firstRun = true;
 
     public AlchemyBrewTask(BlockState brewingStand, Player player) {
         this.brewingStand = brewingStand;
@@ -69,8 +70,11 @@ public class AlchemyBrewTask extends BukkitRunnable {
 
             return;
         }
-        
-        ((BrewingStand) brewingStand).setFuelLevel(fuel);
+
+        if (firstRun) {
+            firstRun = false;
+            ((BrewingStand) brewingStand).setFuelLevel(fuel);
+        }
 
         brewTimer -= brewSpeed;