aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/util/GTPlayedSound.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gregtech/api/util/GTPlayedSound.java')
-rw-r--r--src/main/java/gregtech/api/util/GTPlayedSound.java31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/main/java/gregtech/api/util/GTPlayedSound.java b/src/main/java/gregtech/api/util/GTPlayedSound.java
new file mode 100644
index 0000000000..0b527136b3
--- /dev/null
+++ b/src/main/java/gregtech/api/util/GTPlayedSound.java
@@ -0,0 +1,31 @@
+package gregtech.api.util;
+
+import net.minecraft.util.ResourceLocation;
+
+public class GTPlayedSound {
+
+ public final String mSoundName;
+ public final int mX, mY, mZ;
+
+ public GTPlayedSound(ResourceLocation aSoundResourceLocation, double aX, double aY, double aZ) {
+ mSoundName = aSoundResourceLocation.toString();
+ mX = (int) aX;
+ mY = (int) aY;
+ mZ = (int) aZ;
+ }
+
+ @Override
+ public boolean equals(Object aObject) {
+ if (aObject instanceof GTPlayedSound) {
+ return ((GTPlayedSound) aObject).mX == mX && ((GTPlayedSound) aObject).mY == mY
+ && ((GTPlayedSound) aObject).mZ == mZ
+ && ((GTPlayedSound) aObject).mSoundName.equals(mSoundName);
+ }
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+ return mX + mY + mZ + mSoundName.hashCode();
+ }
+}