mirror of
				https://github.com/IntellectualSites/PlotSquared.git
				synced 2025-10-24 23:23:44 +02:00 
			
		
		
		
	y index utility method in ChunknQueueCoordinator
This commit is contained in:
		| @@ -101,7 +101,7 @@ public class ChunkQueueCoordinator extends ScopedQueueCoordinator { | ||||
|     } | ||||
|  | ||||
|     private void storeCache(final int x, final int y, final int z, final @NonNull BlockState id) { | ||||
|         int yIndex = y - weWorld.getMinY(); | ||||
|         int yIndex = getYIndex(y); | ||||
|         BlockState[][] resultY = result[yIndex]; | ||||
|         if (resultY == null) { | ||||
|             result[yIndex] = resultY = new BlockState[length][]; | ||||
| @@ -114,7 +114,7 @@ public class ChunkQueueCoordinator extends ScopedQueueCoordinator { | ||||
|     } | ||||
|  | ||||
|     private void storeCacheBiome(final int x, final int y, final int z, final @NonNull BiomeType id) { | ||||
|         int yIndex = y - weWorld.getMinY(); | ||||
|         int yIndex = getYIndex(y); | ||||
|         BiomeType[][] resultY = biomeResult[yIndex]; | ||||
|         if (resultY == null) { | ||||
|             biomeResult[yIndex] = resultY = new BiomeType[length][]; | ||||
| @@ -134,7 +134,7 @@ public class ChunkQueueCoordinator extends ScopedQueueCoordinator { | ||||
|  | ||||
|     @Override | ||||
|     public @Nullable BlockState getBlock(int x, int y, int z) { | ||||
|         BlockState[][] blocksY = result[y - weWorld.getMinY()]; | ||||
|         BlockState[][] blocksY = result[getYIndex(y)]; | ||||
|         if (blocksY != null) { | ||||
|             BlockState[] blocksYZ = blocksY[z]; | ||||
|             if (blocksYZ != null) { | ||||
| @@ -159,4 +159,8 @@ public class ChunkQueueCoordinator extends ScopedQueueCoordinator { | ||||
|         return Location.at(getWorld().getName(), bot.getX(), bot.getY(), bot.getZ()); | ||||
|     } | ||||
|  | ||||
|     private int getYIndex(int y) { | ||||
|         return y - weWorld.getMinY(); | ||||
|     } | ||||
|  | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 dordsor21
					dordsor21