diff options
author | Runakai1 <48415331+Runakai1@users.noreply.github.com> | 2022-08-02 10:11:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-02 10:11:05 +0200 |
commit | dd7fffaf3a9fc0fd224df9171175fd2b5fdc5743 (patch) | |
tree | f9047bbf5be1cc4a5d03b14306a32155e39e2596 /src/main/java/gregtech/api | |
parent | 269a9050628c36b26b65bb901109a73f145a0c9e (diff) | |
download | GT5-Unofficial-dd7fffaf3a9fc0fd224df9171175fd2b5fdc5743.tar.gz GT5-Unofficial-dd7fffaf3a9fc0fd224df9171175fd2b5fdc5743.tar.bz2 GT5-Unofficial-dd7fffaf3a9fc0fd224df9171175fd2b5fdc5743.zip |
Crash fix (#1182)
* Crash fix
* Added nullcheck
So that all gt tools work now
Diffstat (limited to 'src/main/java/gregtech/api')
-rw-r--r-- | src/main/java/gregtech/api/util/GT_Utility.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/gregtech/api/util/GT_Utility.java b/src/main/java/gregtech/api/util/GT_Utility.java index 47d66ff816..a1ad2e317c 100644 --- a/src/main/java/gregtech/api/util/GT_Utility.java +++ b/src/main/java/gregtech/api/util/GT_Utility.java @@ -1431,6 +1431,7 @@ public class GT_Utility { } public static boolean doSoundAtClient(String aSoundName, int aTimeUntilNextSound, float aSoundStrength) { + if (aSoundName == null) return false; return doSoundAtClient(aSoundName, aTimeUntilNextSound, aSoundStrength, GT.getThePlayer()); } @@ -1443,7 +1444,7 @@ public class GT_Utility { } public static boolean doSoundAtClient(String aSoundName, int aTimeUntilNextSound, float aSoundStrength, Entity aEntity) { - if (aEntity == null) return false; + if (aEntity == null || aSoundName == null) return false; return doSoundAtClient(aSoundName, aTimeUntilNextSound, aSoundStrength, aEntity.posX, aEntity.posY, aEntity.posZ); } @@ -1462,6 +1463,7 @@ public class GT_Utility { */ @Deprecated public static boolean doSoundAtClient(String aSoundName, int aTimeUntilNextSound, float aSoundStrength, double aX, double aY, double aZ) { + if (aSoundName == null) return false; return doSoundAtClient(new ResourceLocation(aSoundName), aTimeUntilNextSound, aSoundStrength, 1.01818028F, aX, aY, aZ); } |