aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/metatileentity/implementations
diff options
context:
space:
mode:
authorpulsemageadvocate <59131259+pulsemageadvocate@users.noreply.github.com>2022-08-21 16:06:56 +0900
committerGitHub <noreply@github.com>2022-08-21 09:06:56 +0200
commit5d64687a0cb474af97b75229f22015bd23332147 (patch)
tree7e064f7e444f390bab1507b4d774b76d9475c4ff /src/main/java/gregtech/api/metatileentity/implementations
parentcd0868afdd05fd5c3de04a3814e013f008d8c01a (diff)
downloadGT5-Unofficial-5d64687a0cb474af97b75229f22015bd23332147.tar.gz
GT5-Unofficial-5d64687a0cb474af97b75229f22015bd23332147.tar.bz2
GT5-Unofficial-5d64687a0cb474af97b75229f22015bd23332147.zip
fix soundEvent log spam (#1279)
Diffstat (limited to 'src/main/java/gregtech/api/metatileentity/implementations')
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java
index 46c11f5e7a..b09639e292 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java
@@ -965,7 +965,10 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
@Override
public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {
super.startSoundLoop(aIndex, aX, aY, aZ);
- if (aIndex == 1 && GT_Utility.isStringValid(this.mSoundResourceLocation))
+ if (aIndex == 1
+ && this.mSoundResourceLocation != null
+ && GT_Utility.isStringValid(this.mSoundResourceLocation.getResourceDomain())
+ && GT_Utility.isStringValid(this.mSoundResourceLocation.getResourcePath()))
GT_Utility.doSoundAtClient(this.mSoundResourceLocation, 100, 1.0F, aX, aY, aZ);
}
@@ -973,8 +976,11 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
public void startProcess() {
BaseMetaTileEntity myMetaTileEntity = ((BaseMetaTileEntity) this.getBaseMetaTileEntity());
// Added to throttle sounds. To reduce lag, this is on the server side so BlockUpdate packets aren't sent.
- if (myMetaTileEntity.mTickTimer > (myMetaTileEntity.mLastSoundTick+ticksBetweenSounds)) {
- if (GT_Utility.isStringValid(this.mSoundResourceLocation)) this.sendLoopStart((byte) 1);
+ if (myMetaTileEntity.mTickTimer > (myMetaTileEntity.mLastSoundTick + ticksBetweenSounds)) {
+ if (this.mSoundResourceLocation != null
+ && GT_Utility.isStringValid(this.mSoundResourceLocation.getResourceDomain())
+ && GT_Utility.isStringValid(this.mSoundResourceLocation.getResourcePath()))
+ this.sendLoopStart((byte) 1);
// Does not have overflow protection, but they are longs.
myMetaTileEntity.mLastSoundTick = myMetaTileEntity.mTickTimer;
}