2013-12-27 23:59:59 +01:00
|
|
|
package appeng.spatial;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
|
|
|
2014-03-05 08:27:42 +01:00
|
|
|
import net.minecraft.block.Block;
|
2013-12-27 23:59:59 +01:00
|
|
|
import net.minecraft.entity.EnumCreatureType;
|
|
|
|
import net.minecraft.world.World;
|
|
|
|
import net.minecraft.world.chunk.Chunk;
|
|
|
|
import net.minecraft.world.chunk.IChunkProvider;
|
|
|
|
import net.minecraft.world.gen.ChunkProviderGenerate;
|
2014-03-05 08:27:42 +01:00
|
|
|
import appeng.api.AEApi;
|
|
|
|
import appeng.core.AEConfig;
|
2013-12-27 23:59:59 +01:00
|
|
|
|
|
|
|
public class StorageChunkProvider extends ChunkProviderGenerate implements IChunkProvider
|
|
|
|
{
|
|
|
|
|
2014-07-03 01:20:42 +02:00
|
|
|
final static Block[] ablock;
|
|
|
|
|
|
|
|
static {
|
|
|
|
|
|
|
|
ablock = new Block[255 * 256];
|
|
|
|
|
|
|
|
Block matrixFrame = AEApi.instance().blocks().blockMatrixFrame.block();
|
|
|
|
for (int x = 0; x < ablock.length; x++)
|
|
|
|
ablock[x] = matrixFrame;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2013-12-27 23:59:59 +01:00
|
|
|
World w;
|
|
|
|
|
|
|
|
public StorageChunkProvider(World wrd, long i) {
|
|
|
|
super( wrd, i, false );
|
|
|
|
this.w = wrd;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean unloadQueuedChunks()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public Chunk provideChunk(int x, int z)
|
|
|
|
{
|
2014-03-05 08:27:42 +01:00
|
|
|
Chunk chunk = new Chunk( w, ablock, x, z );
|
|
|
|
|
|
|
|
byte[] abyte = chunk.getBiomeArray();
|
|
|
|
AEConfig config = AEConfig.instance;
|
|
|
|
|
|
|
|
for (int k = 0; k < abyte.length; ++k)
|
|
|
|
abyte[k] = (byte) config.storageBiomeID;
|
2013-12-27 23:59:59 +01:00
|
|
|
|
|
|
|
if ( !chunk.isTerrainPopulated )
|
|
|
|
{
|
|
|
|
chunk.isTerrainPopulated = true;
|
|
|
|
chunk.resetRelightChecks();
|
|
|
|
}
|
|
|
|
|
|
|
|
return chunk;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void populate(IChunkProvider par1iChunkProvider, int par2, int par3)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public List getPossibleCreatures(EnumCreatureType a, int b, int c, int d)
|
|
|
|
{
|
|
|
|
return new ArrayList();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|