mirror of
				https://github.com/IntellectualSites/PlotSquared.git
				synced 2025-11-04 11:13:45 +01:00 
			
		
		
		
	Layer index utility method in LocalChunk
This commit is contained in:
		@@ -93,7 +93,7 @@ public class LocalChunk {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    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);
 | 
			
		||||
        BiomeType[] array = this.biomes[i];
 | 
			
		||||
        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) {
 | 
			
		||||
        final int i = (y >> 4) - minSection;
 | 
			
		||||
        final int i = getLayerIndex(y);
 | 
			
		||||
        final int j = ChunkUtil.getJ(x, y, z);
 | 
			
		||||
        BaseBlock[] array = baseblocks[i];
 | 
			
		||||
        if (array == null) {
 | 
			
		||||
@@ -129,4 +129,8 @@ public class LocalChunk {
 | 
			
		||||
        return this.entities;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private int getLayerIndex(final int y) {
 | 
			
		||||
        return (y >> 4) - minSection;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user