aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSHsuperCM <shsupercm@gmail.com>2021-09-14 05:25:58 +0300
committerSHsuperCM <shsupercm@gmail.com>2021-09-14 05:25:58 +0300
commit87e4e3cdbab3c0da7dedd1c8254e992619304f23 (patch)
treeb3c2e361ecd9d7123acb649b3a443849272c28a6
parent4fb9c09fb4f5178a85b37915524b2836fe059a6a (diff)
downloadCITResewn-87e4e3cdbab3c0da7dedd1c8254e992619304f23.tar.gz
CITResewn-87e4e3cdbab3c0da7dedd1c8254e992619304f23.tar.bz2
CITResewn-87e4e3cdbab3c0da7dedd1c8254e992619304f23.zip
Added support for item type assumption based on properties file name
Closes #18
-rw-r--r--src/main/java/shcm/shsupercm/fabric/citresewn/pack/cits/CIT.java9
1 files changed, 9 insertions, 0 deletions
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 e618a6f..98e94f6 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
@@ -54,6 +54,15 @@ public abstract class CIT {
throw new Exception("Unknown item " + itemId);
this.items.add(Registry.ITEM.get(itemIdentifier));
}
+ if (this.items.isEmpty())
+ try {
+ String id = propertiesIdentifier.getPath().substring(0, propertiesIdentifier.getPath().length() - 11);
+ String[] split = id.split("/");
+ id = split[split.length - 1];
+ Identifier itemId = new Identifier(propertiesIdentifier.getNamespace(), id);
+ if (Registry.ITEM.containsId(itemId))
+ this.items.add(Registry.ITEM.get(itemId));
+ } catch (Exception ignored) { }
String damage = properties.getProperty("damage");
if (damageAny = damage == null) {