From baceb833a92352715d309ecdd45d08ae808a47a2 Mon Sep 17 00:00:00 2001 From: itsmeow Date: Tue, 1 Feb 2022 01:16:27 -0500 Subject: [PATCH] Fix cape predicate --- common/src/main/resources/data/trinkets/slots/chest/cape.json | 1 + .../betteranimalsplus/compat/trinkets/TrinketsModCompat.java | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/common/src/main/resources/data/trinkets/slots/chest/cape.json b/common/src/main/resources/data/trinkets/slots/chest/cape.json index fbea51d4..dbba1d79 100644 --- a/common/src/main/resources/data/trinkets/slots/chest/cape.json +++ b/common/src/main/resources/data/trinkets/slots/chest/cape.json @@ -1,6 +1,7 @@ { "replace": false, "validator_predicates": [ + "trinkets:tag", "betteranimalsplus:cape_allowed" ] } \ No newline at end of file diff --git a/fabric/src/main/java/dev/itsmeow/betteranimalsplus/compat/trinkets/TrinketsModCompat.java b/fabric/src/main/java/dev/itsmeow/betteranimalsplus/compat/trinkets/TrinketsModCompat.java index 33eb2d88..aede8466 100644 --- a/fabric/src/main/java/dev/itsmeow/betteranimalsplus/compat/trinkets/TrinketsModCompat.java +++ b/fabric/src/main/java/dev/itsmeow/betteranimalsplus/compat/trinkets/TrinketsModCompat.java @@ -13,10 +13,10 @@ public class TrinketsModCompat { public static void init() { ItemCape.can_equip = (stack, armorType, entity) -> !TrinketsApi.getTrinketComponent((LivingEntity) entity).get().isEquipped(s -> s.getItem() instanceof ItemCape); TrinketsApi.registerTrinketPredicate(new ResourceLocation(Ref.MOD_ID, "cape_allowed"), (stack, slot, entity) -> { - if (stack.getItem() instanceof ItemCape && entity.getItemBySlot(EquipmentSlot.CHEST).getItem() instanceof ItemCape) { + if (stack.getItem() instanceof ItemCape && (entity.getItemBySlot(EquipmentSlot.CHEST).getItem() instanceof ItemCape || !ItemCape.can_equip.canEquip(stack, EquipmentSlot.CHEST, entity))) { return TriState.FALSE; } - return TriState.TRUE; + return TriState.DEFAULT; }); }