mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-27 19:24:44 +02:00
Merge pull request #391 from Glitchfinder/master
Fixing Data Value issues caused by the patch to deprecated ItemStack use.
This commit is contained in:
@ -60,8 +60,7 @@ public class BlockChecks {
|
||||
return true;
|
||||
|
||||
default:
|
||||
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 && CustomBlocksConfig.getInstance().customItems.contains(item)) {
|
||||
return true;
|
||||
@ -79,8 +78,7 @@ public class BlockChecks {
|
||||
* @return true if the block should allow ability activation, false otherwise
|
||||
*/
|
||||
public static boolean abilityBlockCheck(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 && CustomBlocksConfig.getInstance().customAbilityBlocks.contains(item)) {
|
||||
return false;
|
||||
@ -205,8 +203,7 @@ public class BlockChecks {
|
||||
}
|
||||
|
||||
default:
|
||||
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 && CustomBlocksConfig.getInstance().customHerbalismBlocks.contains(item)) {
|
||||
return true;
|
||||
@ -243,8 +240,7 @@ public class BlockChecks {
|
||||
return true;
|
||||
|
||||
default:
|
||||
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 && CustomBlocksConfig.getInstance().customMiningBlocks.contains(item)) {
|
||||
return true;
|
||||
@ -273,8 +269,7 @@ public class BlockChecks {
|
||||
return true;
|
||||
|
||||
default:
|
||||
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 && CustomBlocksConfig.getInstance().customExcavationBlocks.contains(item)) {
|
||||
return true;
|
||||
@ -299,8 +294,7 @@ public class BlockChecks {
|
||||
return true;
|
||||
|
||||
default:
|
||||
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 && CustomBlocksConfig.getInstance().customWoodcuttingBlocks.contains(item)) {
|
||||
return true;
|
||||
|
@ -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) {
|
||||
|
Reference in New Issue
Block a user