mirror of
https://github.com/Minestom/Minestom.git
synced 2024-11-05 02:10:24 +01:00
get light section count from dimension type, add some missing getters to DimensionType
This commit is contained in:
parent
9de6c5aa8f
commit
1065ad346e
@ -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];
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user