This commit is contained in:
Vincent Lee committed 2019-12-22 16:55:24 -06:00
1 parent da5918e46c
commit c7431c7bc7
1 file changed
+16 -13
@@ -100,21 +100,24 @@ public class ItemMonocle extends ItemBauble implements IBurstViewerBauble, ICosm
}
public static boolean hasMonocle(PlayerEntity player) {
ItemStack stack = EquipmentHandler.findOrEmpty(ModItems.monocle, player);
if(!stack.isEmpty()) {
Item item = stack.getItem();
if(item instanceof IBurstViewerBauble)
return true;
return EquipmentHandler.getAllWorn(player).map(inv -> {
for (int i = 0; i < inv.getSlots(); i++) {
ItemStack stack = inv.getStackInSlot(i);
if(!stack.isEmpty()) {
Item item = stack.getItem();
if(item instanceof IBurstViewerBauble)
return true;
if(item instanceof ICosmeticAttachable) {
ICosmeticAttachable attach = (ICosmeticAttachable) item;
ItemStack cosmetic = attach.getCosmeticItem(stack);
if(cosmetic != null && cosmetic.getItem() instanceof IBurstViewerBauble)
return true;
if(item instanceof ICosmeticAttachable) {
ICosmeticAttachable attach = (ICosmeticAttachable) item;
ItemStack cosmetic = attach.getCosmeticItem(stack);
if(!cosmetic.isEmpty() && cosmetic.getItem() instanceof IBurstViewerBauble)
return true;
}
}
}
}
return false;
return false;
}).orElse(false);
}
}