-
Notifications
You must be signed in to change notification settings - Fork 497
/
ModelKeyStation.java
35 lines (28 loc) · 1.08 KB
/
ModelKeyStation.java
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
32
33
34
35
package buildcraft.robotics.render;
import java.util.Arrays;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumWorldBlockLayer;
import buildcraft.api.transport.pluggable.PluggableModelKey;
import buildcraft.robotics.RobotStationPluggable.EnumRobotStationState;
public class ModelKeyStation extends PluggableModelKey<ModelKeyStation> {
public final EnumRobotStationState state;
private final int hash;
public ModelKeyStation(EnumFacing side, EnumRobotStationState state) {
super(EnumWorldBlockLayer.CUTOUT, RobotStationModel.INSTANCE, side);
this.state = state;
this.hash = Arrays.hashCode(new int[] { super.hashCode(), state.hashCode() });
}
@Override
public int hashCode() {
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (!super.equals(obj)) return false;
if (getClass() != obj.getClass()) return false;
ModelKeyStation other = (ModelKeyStation) obj;
if (state != other.state) return false;
return true;
}
}