aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/shcm/shsupercm/fabric/citresewn/pack
diff options
context:
space:
mode:
authorSHsuperCM <shsupercm@gmail.com>2021-10-09 17:44:19 +0300
committerSHsuperCM <shsupercm@gmail.com>2021-10-09 17:44:19 +0300
commit3e60c7b5cf646fbda1c15b38877ba7e5022dd2e2 (patch)
tree33caefca8ec95d254070d8f8158c148b2b2a543b /src/main/java/shcm/shsupercm/fabric/citresewn/pack
parente3ddc19843e7a70a391782e835091bb0bda9e2a6 (diff)
downloadCITResewn-3e60c7b5cf646fbda1c15b38877ba7e5022dd2e2.tar.gz
CITResewn-3e60c7b5cf646fbda1c15b38877ba7e5022dd2e2.tar.bz2
CITResewn-3e60c7b5cf646fbda1c15b38877ba7e5022dd2e2.zip
Setup for enchantment layer application
#15
Diffstat (limited to 'src/main/java/shcm/shsupercm/fabric/citresewn/pack')
-rw-r--r--src/main/java/shcm/shsupercm/fabric/citresewn/pack/cits/CIT.java5
-rw-r--r--src/main/java/shcm/shsupercm/fabric/citresewn/pack/cits/CITEnchantment.java2
2 files changed, 4 insertions, 3 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 ebfcaf1..db29fdd 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
@@ -251,7 +251,10 @@ public abstract class CIT {
}
}
- public boolean test(ItemStack stack, Hand hand, World world, LivingEntity entity) {
+ public boolean test(ItemStack stack, Hand hand, World world, LivingEntity entity, boolean ignoreItemType) {
+ if (!ignoreItemType && !items.contains(stack.getItem()))
+ return false;
+
if (!damageAny && stack.getItem().isDamageable()) {
int damage = stack.getDamage();
if (damageMask != null)
diff --git a/src/main/java/shcm/shsupercm/fabric/citresewn/pack/cits/CITEnchantment.java b/src/main/java/shcm/shsupercm/fabric/citresewn/pack/cits/CITEnchantment.java
index b1c37db..cd0b604 100644
--- a/src/main/java/shcm/shsupercm/fabric/citresewn/pack/cits/CITEnchantment.java
+++ b/src/main/java/shcm/shsupercm/fabric/citresewn/pack/cits/CITEnchantment.java
@@ -36,8 +36,6 @@ public class CITEnchantment extends CIT {
rotation = Float.parseFloat(properties.getProperty("rotation", "0"));
duration = Float.max(0f, Float.parseFloat(properties.getProperty("duration", "0")));
-
-
} catch (Exception e) {
throw new CITParseException(pack.resourcePack, identifier, (e.getClass() == Exception.class ? "" : e.getClass().getSimpleName() + ": ") + e.getMessage());
}