aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorRunakai1 <48415331+Runakai1@users.noreply.github.com>2022-08-02 10:11:05 +0200
committerGitHub <noreply@github.com>2022-08-02 10:11:05 +0200
commitdd7fffaf3a9fc0fd224df9171175fd2b5fdc5743 (patch)
treef9047bbf5be1cc4a5d03b14306a32155e39e2596 /src/main
parent269a9050628c36b26b65bb901109a73f145a0c9e (diff)
downloadGT5-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')
-rw-r--r--src/main/java/gregtech/api/util/GT_Utility.java4
-rw-r--r--src/main/java/gregtech/common/tools/GT_Tool_Scoop.java1
2 files changed, 4 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);
}
diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Scoop.java b/src/main/java/gregtech/common/tools/GT_Tool_Scoop.java
index 674a30548f..64c40c3b2a 100644
--- a/src/main/java/gregtech/common/tools/GT_Tool_Scoop.java
+++ b/src/main/java/gregtech/common/tools/GT_Tool_Scoop.java
@@ -2,6 +2,7 @@ package gregtech.common.tools;
import cpw.mods.fml.common.Loader;
import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.SoundResource;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.IIconContainer;
import gregtech.api.items.GT_MetaGenerated_Tool;