aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/util/GT_PlayedSound.java
blob: 8604d9b81f1359be4c8b173623f679460cd6d3f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package gregtech.api.util;

import net.minecraft.util.ResourceLocation;

public class GT_PlayedSound {

    public final String mSoundName;
    public final int mX, mY, mZ;

    public GT_PlayedSound(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 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();
    }
}