mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-22 13:09:59 +00:00
Fix NPE when breeze deflects a projectile (#10535)
This commit is contained in:
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user