mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-23 21:56:45 +01:00
Layer index utility method in LocalChunk
This commit is contained in:
parent
c5ff743c9e
commit
7c48fe198d
@ -93,7 +93,7 @@ public class LocalChunk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setBiome(final int x, final int y, final int z, final @NonNull BiomeType biomeType) {
|
public void setBiome(final int x, final int y, final int z, final @NonNull BiomeType biomeType) {
|
||||||
final int i = (y >> 4) - minSection;
|
final int i = getLayerIndex(y);
|
||||||
final int j = ChunkUtil.getJ(x, y, z);
|
final int j = ChunkUtil.getJ(x, y, z);
|
||||||
BiomeType[] array = this.biomes[i];
|
BiomeType[] array = this.biomes[i];
|
||||||
if (array == null) {
|
if (array == null) {
|
||||||
@ -108,7 +108,7 @@ public class LocalChunk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setBlock(final int x, final int y, final int z, final @NonNull BaseBlock baseBlock) {
|
public void setBlock(final int x, final int y, final int z, final @NonNull BaseBlock baseBlock) {
|
||||||
final int i = (y >> 4) - minSection;
|
final int i = getLayerIndex(y);
|
||||||
final int j = ChunkUtil.getJ(x, y, z);
|
final int j = ChunkUtil.getJ(x, y, z);
|
||||||
BaseBlock[] array = baseblocks[i];
|
BaseBlock[] array = baseblocks[i];
|
||||||
if (array == null) {
|
if (array == null) {
|
||||||
@ -129,4 +129,8 @@ public class LocalChunk {
|
|||||||
return this.entities;
|
return this.entities;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int getLayerIndex(final int y) {
|
||||||
|
return (y >> 4) - minSection;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user