1
0
mirror of https://github.com/mcMMO-Dev/mcMMO.git synced 2026-02-21 03:03:02 +01:00

Fixing issues caused by the patch to deprecated ItemStack changes.

This commit is contained in:
Glitchfinder
2012-12-29 12:59:18 -08:00
parent cafed2d98c
commit aa70c82824
8 changed files with 29 additions and 55 deletions

View File

@@ -49,8 +49,7 @@ public class ModChecks {
* @return the block if it exists, null otherwise
*/
public static CustomBlock getCustomBlock(Block block) {
ItemStack item = new ItemStack(block.getTypeId(), 1, (short) 0);
item.setData(new MaterialData(block.getTypeId(), block.getData()));
ItemStack item = (new MaterialData(block.getTypeId(), block.getData())).toItemStack(1);
if (!blocksInstance.customItems.contains(item)) {
return null;
@@ -72,8 +71,7 @@ public class ModChecks {
* @return true if the block is custom, false otherwise
*/
public static boolean isCustomMiningBlock(Block block) {
ItemStack item = new ItemStack(block.getTypeId(), 1, (short) 0);
item.setData(new MaterialData(block.getTypeId(), block.getData()));
ItemStack item = (new MaterialData(block.getTypeId(), block.getData())).toItemStack(1);
if (customBlocksEnabled && blocksInstance.customMiningBlocks.contains(item)) {
for (CustomBlock b : blocksInstance.customBlocks) {
@@ -93,8 +91,7 @@ public class ModChecks {
* @return true if the block represents leaves, false otherwise
*/
public static boolean isCustomLeafBlock(Block block) {
ItemStack item = new ItemStack(block.getTypeId(), 1, (short) 0);
item.setData(new MaterialData(block.getTypeId(), block.getData()));
ItemStack item = (new MaterialData(block.getTypeId(), block.getData())).toItemStack(1);
if (blocksInstance.customLeaves.contains(item)) {
for (CustomBlock b : blocksInstance.customBlocks) {
@@ -114,8 +111,7 @@ public class ModChecks {
* @return true if the block represents a log, false otherwise
*/
public static boolean isCustomLogBlock(Block block) {
ItemStack item = new ItemStack(block.getTypeId(), 1, (short) 0);
item.setData(new MaterialData(block.getTypeId(), block.getData()));
ItemStack item = (new MaterialData(block.getTypeId(), block.getData())).toItemStack(1);
if (blocksInstance.customLogs.contains(item)) {
for (CustomBlock b : blocksInstance.customBlocks) {
@@ -135,8 +131,7 @@ public class ModChecks {
* @return true if the block represents an ore, false otherwise
*/
public static boolean isCustomOreBlock(Block block) {
ItemStack item = new ItemStack(block.getTypeId(), 1, (short) 0);
item.setData(new MaterialData(block.getTypeId(), block.getData()));
ItemStack item = (new MaterialData(block.getTypeId(), block.getData())).toItemStack(1);
if (blocksInstance.customOres.contains(item)) {
for (CustomBlock b : blocksInstance.customBlocks) {