Skip to content

Commit

Permalink
Fix Sound Event Crash the Game if it null
Browse files Browse the repository at this point in the history
  • Loading branch information
MrScautHD committed Jan 12, 2022
1 parent d2bafcb commit 6b54279
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ public static LayerDefinition createBodyLayer() {

@Override
public void setupAnim(T entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) {

}

@Override
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/mrscauthd/beyond_earth/events/Events.java
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,9 @@ public static void interact(PlayerInteractEvent.EntityInteract event) {
@OnlyIn(Dist.CLIENT)
@SubscribeEvent
public static void SpaceSounds(PlaySoundEvent event) {
if (Minecraft.getInstance().player != null && Minecraft.getInstance().player.level != null && Methods.checkSound(event.getSound().getSource()) && Methods.isSpaceWorldWithoutOxygen(Minecraft.getInstance().player.level)) {
if (event.getSound() != null) {
if (Minecraft.getInstance().player != null && Minecraft.getInstance().player.level != null && Methods.checkSound(event.getSound().getSource()) && Methods.isSpaceWorldWithoutOxygen(Minecraft.getInstance().player.level)) {

if (event.getSound() != null) {
if (!(event.getSound() instanceof TickableSoundInstance)) {
event.setSound(new SpaceSoundSystem(event.getSound()));

Expand Down

0 comments on commit 6b54279

Please sign in to comment.