Cleanup & Silk Touch changes.

This commit is contained in:
GJ
2012-05-18 11:15:30 -04:00
parent 6da43b15c8
commit a622707608
4 changed files with 192 additions and 104 deletions

View File

@ -1,5 +1,7 @@
package com.gmail.nossr50.util;
import org.bukkit.CropState;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.inventory.ItemStack;
@ -158,7 +160,6 @@ public class BlockChecks {
switch (block.getType()) {
case BROWN_MUSHROOM:
case CACTUS:
case CROPS:
case MELON_BLOCK:
case NETHER_WARTS:
case PUMPKIN:
@ -170,6 +171,14 @@ public class BlockChecks {
case YELLOW_FLOWER:
return true;
case CROPS:
if (block.getData() == CropState.RIPE.getData()) {
return true;
}
else {
return false;
}
default:
if (customBlocksEnabled && CustomBlocksConfig.getInstance().customHerbalismBlocks.contains(new ItemStack(block.getTypeId(), 1, (short) 0, block.getData()))) {
return true;
@ -263,4 +272,13 @@ public class BlockChecks {
}
}
}
public static boolean isLog (Block block){
if (block.getType().equals(Material.LOG) || (customBlocksEnabled && ModChecks.isCustomLogBlock(block))) {
return true;
}
else {
return false;
}
}
}