Fix errors

This commit is contained in:
Sollace 2024-10-01 19:46:21 +01:00
parent 75e50f72d6
commit 3795e11ff5
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB

View file

@ -386,13 +386,13 @@ public abstract class Living<T extends LivingEntity> implements Equine<T>, Caste
ItemStack glasses = GlassesItem.getForEntity(entity).stack(); ItemStack glasses = GlassesItem.getForEntity(entity).stack();
BreaksIntoItemComponent afterBroken = glasses.get(UDataComponentTypes.ITEM_AFTER_BREAKING); BreaksIntoItemComponent afterBroken = glasses.get(UDataComponentTypes.ITEM_AFTER_BREAKING);
if (afterBroken != null && afterBroken.damageType().contains(magical.getTypeRegistryEntry())) { if (afterBroken != null && magical.isIn(afterBroken.damageType())) {
if (afterBroken != null) { if (afterBroken != null) {
afterBroken.getItemAfterBreaking().ifPresent(b -> { afterBroken.getItemAfterBreaking().ifPresent(b -> {
ItemStack broken = glasses.withItem(b); ItemStack broken = glasses.withItem(b);
TrinketsDelegate.getInstance(entity).setEquippedStack(entity, TrinketsDelegate.FACE, broken); TrinketsDelegate.getInstance(entity).setEquippedStack(entity, TrinketsDelegate.FACE, broken);
afterBroken.getBreakingSound().ifPresent(sound -> { afterBroken.getBreakingSound().ifPresent(sound -> {
playSound(USounds.ITEM_SUNGLASSES_SHATTER, 1, 1); playSound(sound, 1, 1);
}); });
}); });
} }