initial commit
This commit is contained in:
parent
3c9ee26b06
commit
22186c33b9
1458 changed files with 282792 additions and 0 deletions
25
java/src/game/world/ChunkCache.java
Executable file
25
java/src/game/world/ChunkCache.java
Executable file
|
@ -0,0 +1,25 @@
|
|||
package game.world;
|
||||
|
||||
public class ChunkCache
|
||||
{
|
||||
protected final int chunkX;
|
||||
protected final int chunkZ;
|
||||
protected final Chunk[][] chunkArray;
|
||||
|
||||
public ChunkCache(World worldIn, BlockPos posFromIn, BlockPos posToIn, int subIn)
|
||||
{
|
||||
this.chunkX = posFromIn.getX() - subIn >> 4;
|
||||
this.chunkZ = posFromIn.getZ() - subIn >> 4;
|
||||
int i = posToIn.getX() + subIn >> 4;
|
||||
int j = posToIn.getZ() + subIn >> 4;
|
||||
this.chunkArray = new Chunk[i - this.chunkX + 1][j - this.chunkZ + 1];
|
||||
|
||||
for (int k = this.chunkX; k <= i; ++k)
|
||||
{
|
||||
for (int l = this.chunkZ; l <= j; ++l)
|
||||
{
|
||||
this.chunkArray[k - this.chunkX][l - this.chunkZ] = worldIn.getChunk(k, l);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue