Add missing null check to allowed_entities rewrite

Fixes #4568
This commit is contained in:
Nassim Jahnke committed 2025-07-05 13:55:55 +02:00
1 parent dfbe57e304
commit b162dbdff0
1 file changed
+1 -1
@@ -139,7 +139,7 @@ public record Equippable(int equipmentSlot, Holder<SoundEvent> soundEvent, @Null
public Equippable rewrite(final UserConnection connection, final Protocol<?, ?, ?, ?> protocol, final boolean clientbound) {
final Holder<SoundEvent> soundEvent = SoundEvent.rewriteHolder(this.soundEvent, Rewritable.soundRewriteFunction(protocol, clientbound));
final Holder<SoundEvent> shearingSound = SoundEvent.rewriteHolder(this.shearingSound, Rewritable.soundRewriteFunction(protocol, clientbound));
final HolderSet allowedEntities = this.allowedEntities.rewrite(Rewritable.entityRewriteFunction(protocol, clientbound));
final HolderSet allowedEntities = this.allowedEntities != null ? this.allowedEntities.rewrite(Rewritable.entityRewriteFunction(protocol, clientbound)) : null;
return soundEvent == this.soundEvent && shearingSound == this.shearingSound && allowedEntities == this.allowedEntities ? this
: new Equippable(equipmentSlot, soundEvent, model, cameraOverlay, allowedEntities, dispensable, swappable, damageOnHurt, equipOnInteract, canBeSheared, shearingSound);
}