1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-29 22:13:25 +01:00

Lets ignore materials which don't exist in older versions

This commit is contained in:
Zrips 2021-02-19 16:32:39 +02:00
parent 33bcbd6d62
commit 526bc78fd7

View File

@ -447,7 +447,7 @@ public class ConfigManager {
if (Version.isCurrentLower(Version.v1_13_R1) && meta.isEmpty()) if (Version.isCurrentLower(Version.v1_13_R1) && meta.isEmpty())
meta = String.valueOf(material.getData()); meta = String.valueOf(material.getData());
c: if (material != CMIMaterial.NONE && material.getMaterial() != null) { c: if (material != CMIMaterial.NONE && material.getMaterial() != null && !material.isAir()) {
// Need to include those ones and count as regular blocks // Need to include those ones and count as regular blocks
switch (myKey.replace("_", "").toLowerCase()) { switch (myKey.replace("_", "").toLowerCase()) {
case "itemframe": case "itemframe":
@ -471,7 +471,7 @@ public class ConfigManager {
// Break and Place actions MUST be blocks // Break and Place actions MUST be blocks
if (actionType == ActionType.BREAK || actionType == ActionType.PLACE || actionType == ActionType.STRIPLOGS) { if (actionType == ActionType.BREAK || actionType == ActionType.PLACE || actionType == ActionType.STRIPLOGS) {
if (!material.isBlock()) { if (!material.isBlock() || material.getMaterial().toString().equalsIgnoreCase("AIR")) {
Jobs.getPluginLogger().warning("Job " + jobName + " has an invalid " + actionType.getName() + " type property: " + material Jobs.getPluginLogger().warning("Job " + jobName + " has an invalid " + actionType.getName() + " type property: " + material
+ " (" + myKey + ")! Material must be a block! Use \"/jobs blockinfo\" on a target block"); + " (" + myKey + ")! Material must be a block! Use \"/jobs blockinfo\" on a target block");
return null; return null;