Hydrogen biome array fox (#237)
This commit is contained in:
parent
01238800ed
commit
7ba38c4b27
1 changed files with 11 additions and 1 deletions
|
@ -35,7 +35,7 @@ public class ChunkBiomeContainerMixin implements IBiomeArray {
|
|||
int biomeZ = pos.getZ() >> 2;
|
||||
int index = be_getArrayIndex(biomeX, biomeY, biomeZ);
|
||||
|
||||
if (Integrations.hasHydrogen()) {
|
||||
if (Integrations.hasHydrogen() && be_shouldWriteToHydrogen()) {
|
||||
try {
|
||||
ChunkBiomeContainer self = (ChunkBiomeContainer) (Object) this;
|
||||
BitStorage storage = be_getHydrogenStorage(self);
|
||||
|
@ -80,6 +80,16 @@ public class ChunkBiomeContainerMixin implements IBiomeArray {
|
|||
@Final
|
||||
private int quartHeight;
|
||||
|
||||
private boolean be_shouldWriteToHydrogen() {
|
||||
try {
|
||||
Field field = ChunkBiomeContainer.class.getDeclaredField("intArray");
|
||||
return field != null;
|
||||
}
|
||||
catch (NoSuchFieldException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private int be_getArrayIndex(int biomeX, int biomeY, int biomeZ) {
|
||||
int i = biomeX & HORIZONTAL_MASK;
|
||||
int j = Mth.clamp(biomeY - this.quartMinY, 0, this.quartHeight);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue