From 2c6fa42bf092ddceec242c50ddf0dd46878a32fd Mon Sep 17 00:00:00 2001 From: George Paton Date: Wed, 7 Feb 2024 13:48:18 +1100 Subject: [PATCH] Fucking murder the sound loop, this way it'll call .stop() every update until it is disposed --- .../com/hbm/tileentity/TileEntityDoorGeneric.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/hbm/tileentity/TileEntityDoorGeneric.java b/src/main/java/com/hbm/tileentity/TileEntityDoorGeneric.java index 5cca88f4c..0fb24cdb2 100644 --- a/src/main/java/com/hbm/tileentity/TileEntityDoorGeneric.java +++ b/src/main/java/com/hbm/tileentity/TileEntityDoorGeneric.java @@ -246,7 +246,10 @@ public class TileEntityDoorGeneric extends TileEntityLockableBase implements IAn DoorDecl doorType = getDoorType(); if(this.state == 0 && state == 3){ // Door transitioning to open - if(audio != null) audio.stopSound(); + if(audio != null) { + audio.stopSound(); + audio.setKeepAlive(0); + } if(doorType.getOpenSoundLoop() != null){ audio = MainRegistry.proxy.getLoopedSound(doorType.getOpenSoundLoop(), xCoord, yCoord, zCoord, doorType.getSoundVolume(), 10F, 1F); @@ -266,7 +269,10 @@ public class TileEntityDoorGeneric extends TileEntityLockableBase implements IAn } if(this.state == 1 && state == 2){ // Door transitioning to closed - if(audio != null) audio.stopSound(); + if(audio != null) { + audio.stopSound(); + audio.setKeepAlive(0); + } if(doorType.getCloseSoundLoop() != null){ audio = MainRegistry.proxy.getLoopedSound(doorType.getCloseSoundLoop(), xCoord, yCoord, zCoord, doorType.getSoundVolume(), 10F, 1F); @@ -288,10 +294,12 @@ public class TileEntityDoorGeneric extends TileEntityLockableBase implements IAn if(state == 1 || state == 0){ // Door finished any transition if(audio != null){ audio.stopSound(); + audio.setKeepAlive(0); audio = null; } if(audio2 != null){ audio2.stopSound(); + audio.setKeepAlive(0); audio2 = null; } }