MASSIVE config overhaul - most keys are now based on the "proper" name

given to a material or entity by Bukkit.

This WILL wipe some custom values you may have set, so please verify
that your values are what you want them to be after the new config file
is generated.
This commit is contained in:
GJ
2013-02-20 16:44:15 -05:00
parent 17a85c94c6
commit c589c5556b
21 changed files with 356 additions and 780 deletions

View File

@ -51,6 +51,10 @@ public final class ModChecks {
* @return the block if it exists, null otherwise
*/
public static CustomBlock getCustomBlock(Block block) {
if (!Config.getInstance().getBlockModsEnabled()) {
return null;
}
ItemStack item = (new MaterialData(block.getTypeId(), block.getData())).toItemStack(1);
if (!CustomBlocksConfig.getInstance().customItems.contains(item)) {
@ -79,8 +83,9 @@ public final class ModChecks {
return null;
}
/**
* Check if a custom block is a custom block.
* Check if a custom block is a mining block.
*
* @param block The block to check
* @return true if the block is custom, false otherwise
@ -99,6 +104,26 @@ public final class ModChecks {
return false;
}
/**
* Check if a custom block is a mining block.
*
* @param block The block to check
* @return true if the block is custom, false otherwise
*/
public static boolean isCustomExcavationBlock(Block block) {
ItemStack item = (new MaterialData(block.getTypeId(), block.getData())).toItemStack(1);
if (customBlocksEnabled && CustomBlocksConfig.getInstance().customExcavationBlocks.contains(item)) {
for (CustomBlock b : CustomBlocksConfig.getInstance().customBlocks) {
if ((b.getItemID() == block.getTypeId()) && (b.getDataValue() == block.getData())) {
return true;
}
}
}
return false;
}
/**
* Check if a custom block is a leaf block.
*