diff options
3 files changed, 6 insertions, 3 deletions
diff --git a/src/main/java/shcm/shsupercm/fabric/citresewn/ex/CITParseException.java b/src/main/java/shcm/shsupercm/fabric/citresewn/ex/CITParseException.java index e48f857..d44fa5b 100644 --- a/src/main/java/shcm/shsupercm/fabric/citresewn/ex/CITParseException.java +++ b/src/main/java/shcm/shsupercm/fabric/citresewn/ex/CITParseException.java @@ -8,6 +8,6 @@ import net.minecraft.util.Identifier; */ public class CITParseException extends Exception { public CITParseException(ResourcePack resourcePack, Identifier identifier, String message) { - super("Skipped: " + message + " in " + resourcePack.getName() + " -> " + identifier.getPath()); + super("Skipped CIT: " + message + " in " + resourcePack.getName() + " -> " + identifier.getPath()); } } diff --git a/src/main/java/shcm/shsupercm/fabric/citresewn/pack/CITParser.java b/src/main/java/shcm/shsupercm/fabric/citresewn/pack/CITParser.java index fd4e4ba..d04a5c7 100644 --- a/src/main/java/shcm/shsupercm/fabric/citresewn/pack/CITParser.java +++ b/src/main/java/shcm/shsupercm/fabric/citresewn/pack/CITParser.java @@ -56,7 +56,7 @@ public class CITParser { private CITParser() {} citPack.cits.add(parseCIT(citPack, citIdentifier, citProperties)); } catch (Exception e) { - CITResewn.LOG.error(e.getMessage()); //todo be more descriptive + CITResewn.LOG.error(e.getMessage()); } } cits.addAll(citPack.cits); diff --git a/src/main/java/shcm/shsupercm/fabric/citresewn/pack/cits/CIT.java b/src/main/java/shcm/shsupercm/fabric/citresewn/pack/cits/CIT.java index b4960f2..218f28b 100644 --- a/src/main/java/shcm/shsupercm/fabric/citresewn/pack/cits/CIT.java +++ b/src/main/java/shcm/shsupercm/fabric/citresewn/pack/cits/CIT.java @@ -36,6 +36,8 @@ public abstract class CIT { public final Predicate<NbtCompound> nbt; + private final int weight; + public CIT(CITPack pack, Identifier identifier, Properties properties) throws CITParseException { try { for (String itemId : (properties.getProperty("items", properties.getProperty("matchItems", " "))).split(" ")) @@ -214,8 +216,9 @@ public abstract class CIT { return true; }; + this.weight = Integer.parseInt(properties.getProperty("weight", "0")); } catch (Exception e) { - throw new CITParseException(pack.resourcePack, identifier, e.getMessage()); + throw new CITParseException(pack.resourcePack, identifier, (e.getClass() == Exception.class ? "" : e.getClass().getSimpleName() + ": ") + e.getMessage()); } } |