Fix NPE when breeze deflects a projectile (#10535)

This commit is contained in:
Matt authored and GitHub committed 2025-04-19 13:08:10 +01:00
1 parent 207c1997c9
commit 81f7f029c3
5 files changed
+7 -7

No files matched your search

@@ -480,8 +480,8 @@ public final class ForgeEventFactory {
return null;
}
public static PlayLevelSoundEvent.AtEntity onPlaySoundAtEntity(Entity entity, Holder<SoundEvent> name, SoundSource category, float volume, float pitch) {
return fire(new PlayLevelSoundEvent.AtEntity(entity, name, category, volume, pitch));
public static PlayLevelSoundEvent.AtEntity onPlaySoundAtEntity(Level level, Entity entity, Holder<SoundEvent> name, SoundSource category, float volume, float pitch) {
return fire(new PlayLevelSoundEvent.AtEntity(level, entity, name, category, volume, pitch));
}
public static PlayLevelSoundEvent.AtPosition onPlaySoundAtPosition(Level level, double x, double y, double z, Holder<SoundEvent> name, SoundSource category, float volume, float pitch) {
@@ -152,8 +152,8 @@ public class PlayLevelSoundEvent extends Event {
public static class AtEntity extends PlayLevelSoundEvent {
private final Entity entity;
public AtEntity(Entity entity, Holder<SoundEvent> sound, SoundSource source, float volume, float pitch) {
super(entity.level(), sound, source, volume, pitch);
public AtEntity(Level level, @Nullable Entity entity, Holder<SoundEvent> sound, SoundSource source, float volume, float pitch) {
super(level, sound, source, volume, pitch);
this.entity = entity;
}