Don't store Block objects, use BlockState

Fixes #1811, Closes #1822
This commit is contained in:
TfT_02
2014-01-30 20:45:21 +01:00
parent b50ba9c02e
commit 6264bfa15f
5 changed files with 20 additions and 18 deletions

View File

@ -3,7 +3,7 @@ package com.gmail.nossr50.skills.alchemy;
import java.util.HashMap;
import java.util.Map;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.AdvancedConfig;
@ -49,7 +49,7 @@ public final class Alchemy {
public static double catalysisMinSpeed = AdvancedConfig.getInstance().getCatalysisMinSpeed();
public static double catalysisMaxSpeed = AdvancedConfig.getInstance().getCatalysisMaxSpeed();
public static Map<Block, AlchemyBrewTask> brewingStandMap = new HashMap<Block, AlchemyBrewTask>();
public static Map<BlockState, AlchemyBrewTask> brewingStandMap = new HashMap<BlockState, AlchemyBrewTask>();
private Alchemy() {}

View File

@ -3,7 +3,7 @@ package com.gmail.nossr50.skills.alchemy;
import java.util.List;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
import org.bukkit.block.BrewingStand;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
@ -119,12 +119,12 @@ public final class AlchemyPotionBrewer {
}
}
public static void finishBrewing(Block brewingStand, Player player, boolean forced) {
if (!(brewingStand.getState() instanceof BrewingStand)) {
public static void finishBrewing(BlockState brewingStand, Player player, boolean forced) {
if (!(brewingStand instanceof BrewingStand)) {
return;
}
BrewerInventory inventory = ((BrewingStand) brewingStand.getState()).getInventory();
BrewerInventory inventory = ((BrewingStand) brewingStand).getInventory();
ItemStack ingredient = inventory.getIngredient() == null ? null : inventory.getIngredient().clone();
if (!removeIngredient(inventory, player)) {