Skip to content

Commit

Permalink
Fix cape predicate
Browse files Browse the repository at this point in the history
  • Loading branch information
itsmeow committed Feb 1, 2022
1 parent c441e4a commit baceb83
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"replace": false,
"validator_predicates": [
"trinkets:tag",
"betteranimalsplus:cape_allowed"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
}

Expand Down

0 comments on commit baceb83

Please sign in to comment.