Check if brewing stand still exists before processing AlchemyBrewTask

This commit is contained in:
TfT_02 2014-01-18 19:11:15 +01:00
parent 3b794c897d
commit 9349416326
2 changed files with 26 additions and 15 deletions

View File

@ -1,6 +1,7 @@
package com.gmail.nossr50.runnables.skills;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BrewingStand;
import org.bukkit.entity.Player;
@ -57,6 +58,16 @@ public class AlchemyBrewTask extends BukkitRunnable {
@Override
public void run() {
if (brewingStand.getType() != Material.BREWING_STAND) {
if (Alchemy.brewingStandMap.containsKey(brewingStand)) {
Alchemy.brewingStandMap.remove(brewingStand);
}
this.cancel();
return;
}
brewTimer -= brewSpeed;
// Vanilla potion brewing completes when BrewingTime == 1