GT5-Unofficial/src/main/java/gregtech/api/util/GT_PlayedSound.java

28 lines
747 B
Java
Raw Normal View History

2015-04-23 16:14:22 +00:00
package gregtech.api.util;
import static gregtech.api.enums.GT_Values.E;
public class GT_PlayedSound {
public final String mSoundName;
public final int mX, mY, mZ;
public GT_PlayedSound(String aSoundName, double aX, double aY, double aZ) {
mSoundName = aSoundName==null?E:aSoundName;
mX = (int)aX;
mY = (int)aY;
mZ = (int)aZ;
}
@Override
public boolean equals(Object aObject) {
if (aObject != null && aObject instanceof GT_PlayedSound) {
return ((GT_PlayedSound)aObject).mX == mX && ((GT_PlayedSound)aObject).mY == mY && ((GT_PlayedSound)aObject).mZ == mZ && ((GT_PlayedSound)aObject).mSoundName.equals(mSoundName);
}
return false;
}
@Override
public int hashCode() {
return mX+mY+mZ+mSoundName.hashCode();
}
}