Skip to content

Commit

Permalink
fix ConcurrentModificationException
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoLezury committed Oct 13, 2024
1 parent 3f83e70 commit f2354bb
Showing 1 changed file with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,18 @@
public class CClientSetupEvents {
@SubscribeEvent
private static void onClientSetup(FMLClientSetupEvent event) {
ItemProperties.register(CItems.PARTY_HAT.get(), Celebrations.id("party_hat_type"), (itemStack, clientLevel, livingEntity, i) -> {
PartyHat partyHat = itemStack.get(CDataComponents.PART_HAT.get());
if (partyHat != null) {
return switch (partyHat.type()) {
case STRIPES -> 0.1f;
case TILT_STRIPES -> 0.2f;
case DOTS -> 0.3f;
};
}
return Float.NEGATIVE_INFINITY;
event.enqueueWork(() -> {
ItemProperties.register(CItems.PARTY_HAT.get(), Celebrations.id("party_hat_type"), (itemStack, clientLevel, livingEntity, i) -> {
PartyHat partyHat = itemStack.get(CDataComponents.PART_HAT.get());
if (partyHat != null) {
return switch (partyHat.type()) {
case STRIPES -> 0.1f;
case TILT_STRIPES -> 0.2f;
case DOTS -> 0.3f;
};
}
return Float.NEGATIVE_INFINITY;
});
});
}

Expand Down

0 comments on commit f2354bb

Please sign in to comment.