mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-18 14:50:56 +00:00
use record for SeededVector
This commit is contained in:
+1
-26
@@ -101,31 +101,6 @@ public class BiomePipelineProvider implements BiomeProvider {
|
|||||||
return biomes;
|
return biomes;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final class SeededVector {
|
private record SeededVector(int x, int z, long seed) {
|
||||||
private final int x;
|
|
||||||
private final int z;
|
|
||||||
private final long seed;
|
|
||||||
|
|
||||||
private SeededVector(int x, int z, long seed) {
|
|
||||||
this.x = x;
|
|
||||||
this.z = z;
|
|
||||||
this.seed = seed;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int hashCode() {
|
|
||||||
int result = 0;
|
|
||||||
result = 31 * result + ((int) (seed ^ (seed >>> 32)));
|
|
||||||
result = 31 * result + x;
|
|
||||||
result = 31 * result + z;
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean equals(Object obj) {
|
|
||||||
if(!(obj instanceof SeededVector that)) return false;
|
|
||||||
|
|
||||||
return this.seed == that.seed && this.x == that.x && this.z == that.z;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user