More deprecation fixes.

This commit is contained in:
GJ
2013-09-05 16:36:02 -04:00
parent fd8d9b02a9
commit d2bbbb0fe7
6 changed files with 54 additions and 24 deletions

View File

@ -7,6 +7,8 @@ import org.bukkit.Material;
import org.bukkit.NetherWartsState;
import org.bukkit.block.BlockState;
import org.bukkit.material.CocoaPlant;
import org.bukkit.material.Crops;
import org.bukkit.material.SmoothBrick;
import org.bukkit.material.CocoaPlant.CocoaPlantSize;
import org.bukkit.material.NetherWarts;
@ -103,6 +105,8 @@ public final class BlockUtils {
return true;
case SMOOTH_BRICK:
return ((SmoothBrick) blockState.getData()).getMaterial() == Material.STONE;
case COBBLE_WALL:
return blockState.getRawData() == (byte) 0x0;
@ -132,10 +136,12 @@ public final class BlockUtils {
return true;
case CARROT:
case CROPS:
case POTATO:
return blockState.getRawData() == CropState.RIPE.getData();
case CROPS:
return ((Crops) blockState.getData()).getState() == CropState.RIPE;
case NETHER_WARTS:
return ((NetherWarts) blockState.getData()).getState() == NetherWartsState.RIPE;
@ -281,7 +287,7 @@ public final class BlockUtils {
public static boolean affectedByBlockCracker(BlockState blockState) {
switch (blockState.getType()) {
case SMOOTH_BRICK:
return blockState.getRawData() == (byte) 0x0;
return ((SmoothBrick) blockState.getData()).getMaterial() == Material.STONE;
default:
return false;

View File

@ -142,8 +142,7 @@ public final class ChimaeraWing {
}
public static ItemStack getChimaeraWing(int amount) {
Material ingredient = Material.getMaterial(Config.getInstance().getChimaeraItemId());
ItemStack itemStack = new ItemStack(ingredient, amount);
ItemStack itemStack = new ItemStack(Config.getInstance().getChimaeraItemId(), amount);
ItemMeta itemMeta = itemStack.getItemMeta();
itemMeta.setDisplayName(ChatColor.GOLD + LocaleLoader.getString("Item.ChimaeraWing.Name"));
@ -164,8 +163,8 @@ public final class ChimaeraWing {
amount = 9;
}
ShapelessRecipe ChimaeraWing = new ShapelessRecipe(getChimaeraWing(1));
ChimaeraWing.addIngredient(amount, ingredient);
return ChimaeraWing;
ShapelessRecipe chimeraWing = new ShapelessRecipe(getChimaeraWing(1));
chimeraWing.addIngredient(amount, ingredient);
return chimeraWing;
}
}