mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
38 lines
744 B
Java
38 lines
744 B
Java
package com.hbm.util;
|
|
|
|
import net.minecraft.world.ChunkCoordIntPair;
|
|
|
|
import java.util.Objects;
|
|
|
|
/**
|
|
* Unique identifier for sub-chunks.
|
|
* @author mlbv
|
|
*/
|
|
public class ChunkKey {
|
|
public final ChunkCoordIntPair pos;
|
|
public final int subY;
|
|
|
|
public ChunkKey(int cx, int cz, int sy) {
|
|
this.pos = new ChunkCoordIntPair(cx, cz);
|
|
this.subY = sy;
|
|
}
|
|
|
|
public ChunkKey(ChunkCoordIntPair pos, int sy) {
|
|
this.pos = pos;
|
|
this.subY = sy;
|
|
}
|
|
|
|
@Override
|
|
public boolean equals(Object o) {
|
|
if (this == o) return true;
|
|
if (!(o instanceof ChunkKey)) return false;
|
|
ChunkKey k = (ChunkKey) o;
|
|
return subY == k.subY && pos.equals(k.pos);
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
return Objects.hash(pos.chunkXPos, pos.chunkZPos, subY);
|
|
}
|
|
}
|