aboutsummaryrefslogtreecommitdiff
path: root/defaults/src/main
diff options
context:
space:
mode:
authorSHsuperCM <shsupercm@gmail.com>2022-03-04 11:05:49 +0200
committerSHsuperCM <shsupercm@gmail.com>2022-03-04 11:16:52 +0200
commit1f82ebe89c0e98eaea141eea9a493547b9093dac (patch)
tree6baa045bc6774f914f31541ac23b175d911efdb5 /defaults/src/main
parentd5e4cfdad93267d7c3f574451a4ee7e0b4ef4098 (diff)
downloadCITResewn-1f82ebe89c0e98eaea141eea9a493547b9093dac.tar.gz
CITResewn-1f82ebe89c0e98eaea141eea9a493547b9093dac.tar.bz2
CITResewn-1f82ebe89c0e98eaea141eea9a493547b9093dac.zip
Modified elytra type item condition warning
Diffstat (limited to 'defaults/src/main')
-rw-r--r--defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/types/TypeElytra.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/types/TypeElytra.java b/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/types/TypeElytra.java
index d50d084..40e6fbe 100644
--- a/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/types/TypeElytra.java
+++ b/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/types/TypeElytra.java
@@ -1,6 +1,8 @@
package shcm.shsupercm.fabric.citresewn.defaults.cit.types;
import io.shcm.shsupercm.fabric.fletchingtable.api.Entrypoint;
+import net.minecraft.item.ElytraItem;
+import net.minecraft.item.Item;
import net.minecraft.resource.ResourceManager;
import net.minecraft.util.Identifier;
import shcm.shsupercm.fabric.citresewn.api.CITTypeContainer;
@@ -27,8 +29,11 @@ public class TypeElytra extends CITType {
@Override
public void load(List<CITCondition> conditions, PropertyGroup properties, ResourceManager resourceManager) throws CITParsingException {
- if (conditions.removeIf(condition -> condition instanceof ConditionItems))
- warn("Type elytra does not support the items condition", null, properties);
+ for (CITCondition condition : conditions)
+ if (condition instanceof ConditionItems items)
+ for (Item item : items.items)
+ if (!(item instanceof ElytraItem))
+ warn("Non elytra item type condition", null, properties);
texture = resolveAsset(properties.identifier, properties.getLastWithoutMetadata("citresewn", "texture"), "textures", ".png", resourceManager);
if (texture == null)