mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-20 12:19:46 +00:00
Fix #3055
This commit is contained in:
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);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user