get light section count from dimension type, add some missing getters to DimensionType

This commit is contained in:
Matt Worzala 2021-06-06 19:33:21 -04:00
parent 9de6c5aa8f
commit 1065ad346e
No known key found for this signature in database
GPG Key ID: 439DBBE092854841
2 changed files with 13 additions and 1 deletions

View File

@ -391,7 +391,7 @@ public abstract class Chunk implements Viewable, Tickable, DataContainer {
updateLightPacket.chunkX = getChunkX(); updateLightPacket.chunkX = getChunkX();
updateLightPacket.chunkZ = getChunkZ(); updateLightPacket.chunkZ = getChunkZ();
final int sectionCount = 16 + 2; //todo final int sectionCount = (getInstance().getDimensionType().getTotalHeight() / 16) + 2;
final int maskLength = (int) Math.ceil((double) sectionCount / 64); final int maskLength = (int) Math.ceil((double) sectionCount / 64);
updateLightPacket.skyLightMask = new long[maskLength]; updateLightPacket.skyLightMask = new long[maskLength];

View File

@ -199,6 +199,14 @@ public class DimensionType {
return this.piglinSafe; return this.piglinSafe;
} }
public int getMinY() {
return minY;
}
public int getHeight() {
return height;
}
public int getLogicalHeight() { public int getLogicalHeight() {
return this.logicalHeight; return this.logicalHeight;
} }
@ -211,6 +219,10 @@ public class DimensionType {
return this.infiniburn; return this.infiniburn;
} }
public int getTotalHeight() {
return minY + height;
}
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) return true;