1 package com.irtimaled.bbor.common.models;
3 import com.irtimaled.bbor.common.MathHelper;
4 import com.irtimaled.bbor.common.TypeHelper;
5 import net.minecraft.util.math.Vec3d;
6 import net.minecraft.util.math.Vec3i;
13 public Coords(int x, int y, int z) {
19 public Coords(double x, double y, double z) {
20 this.x = MathHelper.floor(x);
21 this.y = MathHelper.floor(y);
22 this.z = MathHelper.floor(z);
25 public Coords(Vec3i pos) {
26 this(pos.getX(), pos.getY(), pos.getZ());
29 public Coords(Vec3d pos) { this(pos.x, pos.y, pos.z); }
44 public int hashCode() {
45 return TypeHelper.combineHashCodes(z, y, x);
49 public boolean equals(Object obj) {
50 if (this == obj) return true;
51 if (obj == null || getClass() != obj.getClass()) return false;
52 Coords other = (Coords) obj;
53 return getX() == other.getX() &&
54 getY() == other.getY() &&
55 getZ() == other.getZ();