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

This commit is contained in:
minoneer 2016-06-09 02:10:27 +02:00
parent 11aa126b80
commit 25cad3afc6

View File

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