-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed vein mining not working properly, also fixed sneak not being im…
…plemented when vein mining
- Loading branch information
Showing
7 changed files
with
117 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 90 additions & 0 deletions
90
src/main/java/reforged/mods/gravisuite/utils/pos/Vec3i.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
package reforged.mods.gravisuite.utils.pos; | ||
|
||
import com.google.common.base.Objects; | ||
import net.jcip.annotations.Immutable; | ||
import net.minecraft.util.MathHelper; | ||
|
||
@Immutable | ||
public class Vec3i implements Comparable<Vec3i> { | ||
/** | ||
* X coordinate | ||
*/ | ||
private final int x; | ||
/** | ||
* Y coordinate | ||
*/ | ||
private final int y; | ||
/** | ||
* Z coordinate | ||
*/ | ||
private final int z; | ||
|
||
public Vec3i(int xIn, int yIn, int zIn) { | ||
this.x = xIn; | ||
this.y = yIn; | ||
this.z = zIn; | ||
} | ||
|
||
public Vec3i(double xIn, double yIn, double zIn) { | ||
this(MathHelper.floor_double(xIn), MathHelper.floor_double(yIn), MathHelper.floor_double(zIn)); | ||
} | ||
|
||
/** | ||
* Gets the X coordinate. | ||
*/ | ||
public int getX() { | ||
return this.x; | ||
} | ||
|
||
/** | ||
* Gets the Y coordinate. | ||
*/ | ||
public int getY() { | ||
return this.y; | ||
} | ||
|
||
/** | ||
* Gets the Z coordinate. | ||
*/ | ||
public int getZ() { | ||
return this.z; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object p_equals_1_) { | ||
if (this == p_equals_1_) { | ||
return true; | ||
} else if (!(p_equals_1_ instanceof Vec3i)) { | ||
return false; | ||
} else { | ||
Vec3i vec3i = (Vec3i) p_equals_1_; | ||
|
||
if (this.getX() != vec3i.getX()) { | ||
return false; | ||
} else if (this.getY() != vec3i.getY()) { | ||
return false; | ||
} else { | ||
return this.getZ() == vec3i.getZ(); | ||
} | ||
} | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return (this.getY() + this.getZ() * 31) * 31 + this.getX(); | ||
} | ||
|
||
@Override | ||
public int compareTo(Vec3i p_compareTo_1_) { | ||
if (this.getY() == p_compareTo_1_.getY()) { | ||
return this.getZ() == p_compareTo_1_.getZ() ? this.getX() - p_compareTo_1_.getX() : this.getZ() - p_compareTo_1_.getZ(); | ||
} else { | ||
return this.getY() - p_compareTo_1_.getY(); | ||
} | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return Objects.toStringHelper(this).add("x", this.getX()).add("y", this.getY()).add("z", this.getZ()).toString(); | ||
} | ||
} |