Goggles function in any curio slot (#6520)

This commit is contained in:
littlej541 2024-07-15 06:14:48 -07:00 committed by GitHub
parent 1722d4dda0
commit 54f760feb1
Failed to generate hash of commit

View file

@ -43,13 +43,16 @@ public class Curios {
modEventBus.addListener(Curios::onClientSetup);
GogglesItem.addIsWearingPredicate(player -> resolveCuriosMap(player)
.map(curiosMap -> curiosMap.get("head"))
.map(stacksHandler -> {
// Check all the Head slots for Goggles existing
int slots = stacksHandler.getSlots();
for (int slot = 0; slot < slots; slot++)
if (AllItems.GOGGLES.isIn(stacksHandler.getStacks().getStackInSlot(slot)))
return true;
.map(curiosMap -> {
for (ICurioStacksHandler stacksHandler : curiosMap.values()) {
// Search all the curio slots for Goggles existing
int slots = stacksHandler.getSlots();
for (int slot = 0; slot < slots; slot++) {
if (AllItems.GOGGLES.isIn(stacksHandler.getStacks().getStackInSlot(slot))) {
return true;
}
}
}
return false;
})