if (myKey.contains("-")) {
// uses subType
subType = ":" + myKey.split("-")[1];
myKey = myKey.split("-")[0];
}
Material material = Material.matchMaterial(myKey);
if (material == null) {
// try integer method
Integer matId = null;
try {
matId = Integer.decode(myKey);
} catch (NumberFormatException e) {}
if (matId != null) {
material = Material.getMaterial(matId);
if (material != null) {
Jobs.getPluginLogger().warning("Job " + jobKey + " " + actionType.getName() + " is using a block by number ID: " + key + "!");
Jobs.getPluginLogger().warning("Please switch to using the Material name instead: "+material.toString()+"!");
Jobs.getPluginLogger().warning("Blocks by number IDs may break in a future release!");
}
}
}
if (material != null) {
// Break and Place actions MUST be blocks
if (actionType == ActionType.BREAK || actionType == ActionType.PLACE) {
if (!material.isBlock()) {
Jobs.getPluginLogger().warning("Job " + jobKey + " has an invalid " + actionType.getName() + " type property: " + key + "! Material must be a block!");
continue;
}
}
// START HACK
/*
* Historically, GLOWING_REDSTONE_ORE would ONLY work as REDSTONE_ORE, and putting
* GLOWING_REDSTONE_ORE in the configuration would not work. Unfortunately, this is
* completely backwards and wrong.
*
* To maintain backwards compatibility, all instances of REDSTONE_ORE should normalize
* to GLOWING_REDSTONE_ORE, and warn the user to change their configuration. In the
* future this hack may be removed and anybody using REDSTONE_ORE will have their
* configurations broken.
*/
if (material == Material.REDSTONE_ORE) {
Jobs.getPluginLogger().warning("Job "+jobKey+" is using REDSTONE_ORE instead of GLOWING_REDSTONE_ORE.");
Jobs.getPluginLogger().warning("Automatically changing block to GLOWING_REDSTONE_ORE. Please update your configuration.");
Jobs.getPluginLogger().warning("In vanilla minecraft, REDSTONE_ORE changes to GLOWING_REDSTONE_ORE when interacted with.");
Jobs.getPluginLogger().warning("In the future, Jobs using REDSTONE_ORE instead of GLOWING_REDSTONE_ORE may fail to work correctly.");
material = Material.GLOWING_REDSTONE_ORE;
}
// END HACK
type = material.toString();
} else if (actionType == ActionType.KILL) {
// check entities
EntityType entity = EntityType.fromName(key);
if (entity == null) {
try {