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) {
30 this(pos.x, pos.y, pos.z);
46 public int hashCode() {
47 return TypeHelper.combineHashCodes(z, y, x);
51 public boolean equals(Object obj) {
52 if (this == obj) return true;
53 if (obj == null || getClass() != obj.getClass()) return false;
54 Coords other = (Coords) obj;
55 return getX() == other.getX() &&
56 getY() == other.getY() &&
57 getZ() == other.getZ();