Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ChunkProviderArcana implements IChunkProvider{
- private ArrayList Rooms;
- private ArrayList BossRooms;
- private DungeonCeiling Ceiling;
- private World worldObj;
- private Random random;
- public ChunkProviderArcana(World world, long seed){
- worldObj = world;
- random = new Random(seed);
- Rooms = new ArrayList(21);
- BossRooms = new ArrayList(2);
- Rooms.add(new DungeonComponent());
- Rooms.add(new DungeonComponent1());
- Rooms.add(new DungeonComponent2());
- Rooms.add(new DungeonComponent3());
- Rooms.add(new DungeonComponent4());
- Rooms.add(new DungeonComponent5());
- Rooms.add(new DungeonComponent6());
- Rooms.add(new DungeonComponent7());
- Rooms.add(new DungeonComponent9());
- Rooms.add(new DungeonComponent10());
- Rooms.add(new DungeonComponent11());
- Rooms.add(new DungeonComponent12());
- Rooms.add(new DungeonComponent13());
- Rooms.add(new DungeonComponent14());
- Rooms.add(new DungeonComponent15());
- Rooms.add(new DungeonComponent16());
- Rooms.add(new DungeonComponent17());
- Rooms.add(new DungeonComponent22());
- Rooms.add(new DungeonComponenet18());
- Rooms.add(new DungeonComponenet19());
- Rooms.add(new DungeonComponent8());
- BossRooms.add(new DungeonComponentParasecta());
- BossRooms.add(new DungeonComponentDramix());
- Ceiling = new DungeonCeiling();
- }
- @Override
- public boolean chunkExists(int i, int j) {
- return false;
- }
- @Override
- public Chunk provideChunk(int par1, int par2) {
- ArcanaChunk c = new ArcanaChunk();
- int l;
- int roomToGenerate;
- for (int i = 4; i > 0; i--) {
- roomToGenerate = random.nextInt(21);
- DungeonComponentBase room = (DungeonComponentBase)(Rooms.get(roomToGenerate));
- if(room instanceof DungeonComponent8 && i >= 3) room = (DungeonComponentBase)(Rooms.get(this.random.nextInt(10)+10));
- room.generate(c, random, 0, i * 8, 0);
- }
- Ceiling.generate(c, random, 0, 40, 0);
- Chunk chunk = new Chunk(this.worldObj, c.getChunkData(), c.getChunkMetadata(), par1, par2);
- chunk.generateSkylightMap();
- BiomeGenBase[] abiomegenbase = this.worldObj.getWorldChunkManager().loadBlockGeneratorData((BiomeGenBase[])null, par1 * 16, par2 * 16, 16, 16);
- byte[] abyte = chunk.getBiomeArray();
- for (l = 0; l < abyte.length; ++l)
- {
- abyte[l] = (byte)abiomegenbase[l].biomeID;
- }
- chunk.generateSkylightMap();
- return chunk;
- }
- @Override
- public Chunk loadChunk(int i, int j) {
- return this.provideChunk(i, j);
- }
- @Override
- public void populate(IChunkProvider chunkProvider, int chunkX, int chunkY) {
- int x = chunkX * 16;
- int y = chunkY * 16;
- BiomeGenBase biome = this.worldObj.getBiomeGenForCoords(x + 16, y + 16);
- boolean flag = false;
- this.random.setSeed(this.worldObj.getSeed());
- long var8 = this.random.nextLong() / 2L * 2L + 1L;
- long var10 = this.random.nextLong() / 2L * 2L + 1L;
- this.random.setSeed(chunkX * var8 + chunkY * var10 ^ this.worldObj.getSeed());
- int roomToGenerate;
- Random rand = random;
- Chunk chunk = this.worldObj.getChunkFromChunkCoords(chunkX, chunkY);
- for(int i = 1; i < 4; i++) {
- roomToGenerate = rand.nextInt(2);
- if(this.random.nextInt(50) == 0){
- ((WorldGenerator)(BossRooms.get(roomToGenerate))).generate(this.worldObj, rand, x, i * 8, y);
- this.random.setSeed(chunkX * var8 + chunkY * var10 ^ this.worldObj.getSeed() * i << 2 | var10);
- }
- }
- }
- @Override
- public boolean saveChunks(boolean flag, IProgressUpdate iprogressupdate) {
- return true;
- }
- @Override
- public boolean unloadQueuedChunks() {
- return false;
- }
- @Override
- public boolean canSave() {
- return true;
- }
- @Override
- public String makeString() {
- return "Arcana";
- }
- @Override
- public List getPossibleCreatures(EnumCreatureType enumcreaturetype, int i, int j, int k) {
- BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(i, k);
- return biomegenbase == null ? null : biomegenbase.getSpawnableList(enumcreaturetype);
- }
- @Override
- public int getLoadedChunkCount() {
- return 0;
- }
- @Override
- public void recreateStructures(int i, int j) {}
- @Override
- public void saveExtraData() { }
- @Override
- public ChunkPosition func_147416_a(World var1, String var2, int var3, int var4, int var5) {
- return null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment