public BiomeProviderATG(World world) { this.world = world; this.settings = WorldSettings.loadWorldSettings(world).biomeSettings; this.noise = new CoreNoise(world.getSeed()); this.fuzz = new Random(); this.biomeCache = new BiomeCache(this); this.biomesToSpawnIn = Lists.newArrayList(allowedBiomes); this.biomeRegistry = new BiomeRegistry(); this.biomeRegistry.populate(this.settings); // TODO: Set things based on the world settings }
/** * Returns a biome cache block at location specified. */ @Override public BiomeCache.Block getBiomeCacheBlock(int x, int z) { x = x >> 4; z = z >> 4; long i = (long)x & 4294967295L | ((long)z & 4294967295L) << 32; BiomeCache.Block biomecache$block = this.cacheMap.get(i); if (biomecache$block == null) { biomecache$block = new BiomeCache.Block(x, z); this.cacheMap.put(i, biomecache$block); this.cache.add(biomecache$block); } biomecache$block.lastAccessTime = MinecraftServer.getCurrentTimeMillis(); return biomecache$block; }
/** * Removes BiomeCacheBlocks from this cache that haven't been accessed in at least 30 seconds. */ @Override public void cleanupCache() { long i = MinecraftServer.getCurrentTimeMillis(); long j = i - this.lastCleanupTime; if (j > 1000L || j < 0L) { this.lastCleanupTime = i; for (int k = 0; k < this.cache.size(); ++k) { BiomeCache.Block biomecache$block = this.cache.get(k); long l = i - biomecache$block.lastAccessTime; if (l > 3000L || l < 0L) { this.cache.remove(k--); long i1 = (long)biomecache$block.x & 4294967295L | ((long)biomecache$block.z & 4294967295L) << 32; this.cacheMap.remove(i1); } } } }
public ChunkManagerPlanet(long seed, WorldType default1, DimensionProperties properties) { this.biomeCache = new BiomeCache(this);//new BiomeCacheExtended(this); //TODO: more biomes //TODO: remove rivers GenLayer[] agenlayer = initializeAllBiomeGenerators(seed, default1, properties);//GenLayer.initializeAllBiomeGenerators(seed, default1); //; agenlayer = getModdedBiomeGenerators(default1, seed, agenlayer); this.genBiomes = agenlayer[0]; this.biomeIndexLayer = agenlayer[1]; fBiomeCache = ReflectionHelper.findField(BiomeCache.class, "cache", "field_76841_d"); fBiomeCache.setAccessible(true); fBiomeCacheMap = ReflectionHelper.findField(BiomeCache.class, "cacheMap", "field_76843_c"); fBiomeCacheMap.setAccessible(true); }
public FirmaBiomeProvider(long seed, WorldType worldTypeIn, String options) { this.biomeCache = new BiomeCache(this); FirmaBiome[] allowedBiomesFirma = { FirmaBiome.PLAINS, FirmaBiome.HILLS ,FirmaBiome.SWAMP }; this.biomesToSpawnIn = Lists.newArrayList(allowedBiomesFirma); GenLayer[] agenlayer = FirmaGenLayer.initialize(seed, worldTypeIn); this.genBiomes = agenlayer[0]; this.biomeIndexLayer = agenlayer[1]; }
@SuppressWarnings({ "unchecked", "rawtypes" }) public WorldChunkManagerEpic() { this.biomeCache = new BiomeCache(this); this.biomesToSpawnIn = new ArrayList(); this.biomesToSpawnIn.add(BiomeRegistry.biomePat); this.biomesToSpawnIn.add(BiomeRegistry.biomeJen); }
public BiomeProviderPaintedBiomes(World world, BiomeProvider biomeProviderParent, ImageHandler imageHandler) { super(world.getWorldInfo()); this.parent = biomeProviderParent; this.imageHandler = imageHandler; this.biomeCache = new BiomeCache(this); }
@SuppressWarnings("unchecked") protected WorldChunkManagerNowhere() { this.biomeCache = new BiomeCache(this); this.biomesToSpawnIn = new ArrayList<BiomeGenBase>(); this.biomesToSpawnIn.add(ModBiomes.biomeNowhere); }
@SuppressWarnings("unchecked") protected WorldChunkManagerCretaceous() { this.biomeCache = new BiomeCache(this); this.biomesToSpawnIn = new ArrayList<BiomeGenBase>(); this.biomesToSpawnIn.add(ModBiomes.biomeCretaceousDry); }
@SuppressWarnings({ "unchecked", "rawtypes" }) public WorldChunkManagerTDE() { this.biomeCache = new BiomeCache(this); this.biomesToSpawnIn = new ArrayList(); this.biomesToSpawnIn.addAll(allowedBiomes); }
protected WorldChunkManagerMultiBiome(){ this.myBiomeCache = new BiomeCache(this); this.myBiomesToSpawnIn = new ArrayList<BiomeGenBase>(); this.myBiomesToSpawnIn.add(FCraftBiomes.biomeThunderPlains); this.myBiomesToSpawnIn.add(FCraftBiomes.biomeHighwaste); this.myBiomesToSpawnIn.add(FCraftBiomes.biomeGolmoreJungle); this.myBiomesToSpawnIn.add(FCraftBiomes.biomeCactusIsland); this.myBiomesToSpawnIn.add(FCraftBiomes.biomeCalmLands); this.myBiomesToSpawnIn.add(FCraftBiomes.biomeEvilForest); this.myBiomesToSpawnIn.add(FCraftBiomes.biomeMarsh); }
public BiomeProviderDreadlands() { biomeCache = new BiomeCache(this); biomesToSpawnIn = new ArrayList<Biome>(); biomesToSpawnIn.add(ACBiomes.dreadlands); biomesToSpawnIn.add(ACBiomes.purified_dreadlands); biomesToSpawnIn.add(ACBiomes.dreadlands_forest); biomesToSpawnIn.add(ACBiomes.dreadlands_mountains); }
protected WorldChunkManager() { this.field_76942_f = new BiomeCache(this); this.field_76943_g = new ArrayList(); this.field_76943_g.add(BiomeGenBase.field_76767_f); this.field_76943_g.add(BiomeGenBase.field_76772_c); this.field_76943_g.add(BiomeGenBase.field_76768_g); this.field_76943_g.add(BiomeGenBase.field_76784_u); this.field_76943_g.add(BiomeGenBase.field_76785_t); this.field_76943_g.add(BiomeGenBase.field_76782_w); this.field_76943_g.add(BiomeGenBase.field_76792_x); }
public BiomeCacheBlock(BiomeCache p_i1972_1_, int p_i1972_2_, int p_i1972_3_) { this.field_76887_g = p_i1972_1_; this.field_76892_a = new float[256]; this.field_76890_b = new float[256]; this.field_76891_c = new BiomeGenBase[256]; this.field_76888_d = p_i1972_2_; this.field_76889_e = p_i1972_3_; BiomeCache.func_76836_a(p_i1972_1_).func_76934_b(this.field_76892_a, p_i1972_2_ << 4, p_i1972_3_ << 4, 16, 16); BiomeCache.func_76836_a(p_i1972_1_).func_76936_a(this.field_76890_b, p_i1972_2_ << 4, p_i1972_3_ << 4, 16, 16); BiomeCache.func_76836_a(p_i1972_1_).func_76931_a(this.field_76891_c, p_i1972_2_ << 4, p_i1972_3_ << 4, 16, 16, false); }
protected WorldChunkManagerEI() { this.myBiomeCache = new BiomeCache(this); this.myBiomesToSpawnIn = new ArrayList<BiomeGenBase>(); this.myBiomesToSpawnIn.add(ModBiomes.ancientBioluminescentForest); this.myBiomesToSpawnIn.add(ModBiomes.ancientBioluminescentJungle); this.myBiomesToSpawnIn.add(ModBiomes.ancientBioluminescentPlains); this.myBiomesToSpawnIn.add(ModBiomes.ancientBioluminescentSwamp); }
public WorldChunkManagerSoulForest(){ this.myBiomeCache = new BiomeCache(this); this.myBiomesToSpawnIn = new ArrayList<BiomeGenBase>(); this.myBiomesToSpawnIn.add(soul_forest.SoulForest); this.myBiomesToSpawnIn.add(soul_forest.FrozenPlains); this.myBiomesToSpawnIn.add(soul_forest.PeatBog); this.myBiomesToSpawnIn.add(soul_forest.SoulShrubbery); this.myBiomesToSpawnIn.add(soul_forest.ShinaiForest); }
protected RasterlandChunkManager() { this.myBiomeCache = new BiomeCache(this); this.myBiomesToSpawnIn = new ArrayList<BiomeGenBase>(); this.myBiomesToSpawnIn.add(Biomes.red); this.myBiomesToSpawnIn.add(Biomes.orange); this.myBiomesToSpawnIn.add(Biomes.yellow); this.myBiomesToSpawnIn.add(Biomes.green); this.myBiomesToSpawnIn.add(Biomes.blue); this.myBiomesToSpawnIn.add(Biomes.purple); }
public WorldChunkManagerSpace() { this.biomeCache = new BiomeCache(this); this.biomesToSpawnIn = new ArrayList<BiomeGenBase>(); this.biomesToSpawnIn.add(this.getBiome()); }
protected ChunkManagerEmpty() { this.biomeCache = new BiomeCache(this); this.biomesToSpawnIn = new ArrayList(); }
protected ChunkManagerOld() { this.biomeCache = new BiomeCache(this); this.biomesToSpawnIn = new ArrayList(); }
public BiomeProviderEarth(EarthGenerator generator) { this.biomeCache = new BiomeCache(this); this.SPAWN_BIOMES = Lists.newArrayList(); this.SPAWN_BIOMES.addAll(allowedBiomes); this.GENERATOR = generator; }
protected WorldChunkManagerOcean() { this.biomeCache = new BiomeCache(this); this.biomesToSpawnIn = new ArrayList(); this.biomesToSpawnIn.addAll(allowedBiomes); }
@Override public boolean regenerateChunk(net.minecraft.world.World world, int x, int z, BaseBiome biome, Long seed) { if (biome != null) { try { if (seed == null) { seed = world.getSeed(); } nmsWorld.getWorldInfo().getSeed(); boolean result; ChunkProviderOverworld generator = new ChunkProviderOverworld(nmsWorld, seed, false, ""); net.minecraft.world.biome.Biome base = net.minecraft.world.biome.Biome.getBiome(biome.getId()); net.minecraft.world.biome.Biome[] existingBiomes = new net.minecraft.world.biome.Biome[256]; Arrays.fill(existingBiomes, base); fieldBiomes.set(generator, existingBiomes); boolean cold = base.getTemperature() <= 1; IChunkGenerator existingGenerator = (IChunkGenerator) fieldChunkGenerator.get(nmsWorld.getChunkProvider()); long existingSeed = world.getSeed(); { if (genLayer == null) genLayer = new MutableGenLayer(seed); genLayer.set(biome.getId()); Object existingGenLayer1 = fieldGenLayer1.get(nmsWorld.provider.getBiomeProvider()); Object existingGenLayer2 = fieldGenLayer2.get(nmsWorld.provider.getBiomeProvider()); fieldGenLayer1.set(nmsWorld.provider.getBiomeProvider(), genLayer); fieldGenLayer2.set(nmsWorld.provider.getBiomeProvider(), genLayer); fieldSeed.set(nmsWorld.getWorldInfo(), seed); ReflectionUtils.setFailsafeFieldValue(fieldBiomeCache, this.nmsWorld.provider.getBiomeProvider(), new BiomeCache(this.nmsWorld.provider.getBiomeProvider())); ReflectionUtils.setFailsafeFieldValue(fieldChunkGenerator, this.nmsWorld.getChunkProvider(), generator); result = regenerateChunk(world, x, z); ReflectionUtils.setFailsafeFieldValue(fieldChunkGenerator, this.nmsWorld.getChunkProvider(), existingGenerator); fieldSeed.set(nmsWorld.getWorldInfo(), existingSeed); fieldGenLayer1.set(nmsWorld.provider.getBiomeProvider(), existingGenLayer1); fieldGenLayer2.set(nmsWorld.provider.getBiomeProvider(), existingGenLayer2); } return result; } catch (Throwable e) { e.printStackTrace(); } } return regenerateChunk(world, x, z); }
@Override public boolean regenerateChunk(net.minecraft.world.World world, int x, int z, BaseBiome biome, Long seed) { if (biome != null) { try { if (seed == null) { seed = world.getSeed(); } nmsWorld.getWorldInfo().getSeed(); boolean result; ChunkGeneratorOverworld generator = new ChunkGeneratorOverworld(nmsWorld, seed, false, ""); net.minecraft.world.biome.Biome base = net.minecraft.world.biome.Biome.getBiome(biome.getId()); net.minecraft.world.biome.Biome[] existingBiomes = new net.minecraft.world.biome.Biome[256]; Arrays.fill(existingBiomes, base); fieldBiomes.set(generator, existingBiomes); IChunkGenerator existingGenerator = (IChunkGenerator) fieldChunkGenerator.get(nmsWorld.getChunkProvider()); long existingSeed = world.getSeed(); { if (genLayer == null) genLayer = new MutableGenLayer(seed); genLayer.set(biome.getId()); Object existingGenLayer1 = fieldGenLayer1.get(nmsWorld.provider.getBiomeProvider()); Object existingGenLayer2 = fieldGenLayer2.get(nmsWorld.provider.getBiomeProvider()); fieldGenLayer1.set(nmsWorld.provider.getBiomeProvider(), genLayer); fieldGenLayer2.set(nmsWorld.provider.getBiomeProvider(), genLayer); fieldSeed.set(nmsWorld.getWorldInfo(), seed); ReflectionUtils.setFailsafeFieldValue(fieldBiomeCache, this.nmsWorld.provider.getBiomeProvider(), new BiomeCache(this.nmsWorld.provider.getBiomeProvider())); ReflectionUtils.setFailsafeFieldValue(fieldChunkGenerator, this.nmsWorld.getChunkProvider(), generator); result = regenerateChunk(world, x, z); ReflectionUtils.setFailsafeFieldValue(fieldChunkGenerator, this.nmsWorld.getChunkProvider(), existingGenerator); fieldSeed.set(nmsWorld.getWorldInfo(), existingSeed); fieldGenLayer1.set(nmsWorld.provider.getBiomeProvider(), existingGenLayer1); fieldGenLayer2.set(nmsWorld.provider.getBiomeProvider(), existingGenLayer2); } return result; } catch (Throwable e) { e.printStackTrace(); } } return regenerateChunk(world, x, z); }
@Override public boolean regenerateChunk(net.minecraft.world.World world, int x, int z, BaseBiome biome, Long seed) { if (biome != null) { try { if (seed == null) { seed = world.getSeed(); } nmsWorld.getWorldInfo().getSeed(); boolean result; ChunkProviderOverworld generator = new ChunkProviderOverworld(nmsWorld, seed, false, ""); net.minecraft.world.biome.Biome base = net.minecraft.world.biome.Biome.getBiome(biome.getId()); fieldBiomes.set(generator, new net.minecraft.world.biome.Biome[]{base}); boolean cold = base.getTemperature() <= 1; IChunkGenerator existingGenerator = nmsWorld.getChunkProvider().chunkGenerator; long existingSeed = world.getSeed(); { if (genLayer == null) genLayer = new MutableGenLayer(seed); genLayer.set(biome.getId()); Object existingGenLayer1 = fieldGenLayer1.get(nmsWorld.provider.getBiomeProvider()); Object existingGenLayer2 = fieldGenLayer2.get(nmsWorld.provider.getBiomeProvider()); fieldGenLayer1.set(nmsWorld.provider.getBiomeProvider(), genLayer); fieldGenLayer2.set(nmsWorld.provider.getBiomeProvider(), genLayer); fieldSeed.set(nmsWorld.getWorldInfo(), seed); ReflectionUtils.setFailsafeFieldValue(fieldBiomeCache, this.nmsWorld.provider.getBiomeProvider(), new BiomeCache(this.nmsWorld.provider.getBiomeProvider())); ReflectionUtils.setFailsafeFieldValue(fieldChunkGenerator, this.nmsWorld.getChunkProvider(), generator); result = regenerateChunk(world, x, z); ReflectionUtils.setFailsafeFieldValue(fieldChunkGenerator, this.nmsWorld.getChunkProvider(), existingGenerator); fieldSeed.set(nmsWorld.getWorldInfo(), existingSeed); fieldGenLayer1.set(nmsWorld.provider.getBiomeProvider(), existingGenLayer1); fieldGenLayer2.set(nmsWorld.provider.getBiomeProvider(), existingGenLayer2); } return result; } catch (Throwable e) { e.printStackTrace(); } } return regenerateChunk(world, x, z); }
protected ChunkManagerOld() { this.biomeCache = new BiomeCache(this); this.biomesToSpawnIn = new ArrayList(); this.biomesToSpawnIn.addAll(allowedBiomes); }
protected WorldChunkManagerAtlantis() { this.myBiomeCache = new BiomeCache(this); this.myBiomesToSpawnIn = new ArrayList<BiomeGenBase>(); this.myBiomesToSpawnIn.add(AtlantisMod.atlantisOcean); }
protected WorldChunkMangerNillax() { this.myBiomeCache = new BiomeCache(this); this.myBiomesToSpawnIn = new ArrayList(); this.myBiomesToSpawnIn.add(ModBiomes.bioZone); }
protected WorldChunkMangerNillax() { this.myBiomeCache = new BiomeCache(this); this.myBiomesToSpawnIn = new ArrayList<BiomeGenBase>(); this.myBiomesToSpawnIn.add(ModBiomes.bioZone); }
protected WorldChunkManagerMysticalDimension() { this.mBiomeCache = new BiomeCache(this); this.biomesToSpawn = new ArrayList(); this.biomesToSpawn.add(GenLayerBiomesMysticalTrinkets.mystical); }
protected WorldChunkManagerUsther() { this.biomeCache = new BiomeCache(this); this.biomesToSpawnIn = new ArrayList(); this.biomesToSpawnIn.addAll(allowedBiomes); }
public SCVenusWorldChunkManager() { this.biomeCache = new BiomeCache(this); this.biomesToSpawnIn = new ArrayList<BiomeGenBase>(); this.biomesToSpawnIn.add(SCVenusBiomeGenBase.venusFlat); }
protected GCWorldChunkManager() { this.biomeCache = new BiomeCache(this); this.biomesToSpawnIn = new ArrayList<BiomeGenBase>(); this.biomesToSpawnIn.addAll(this.getBiomeList()); }
private AgeChunkManager(Age age) { this.age = age; biomeCache = new BiomeCache(this); biomesToSpawnIn = new ArrayList<BiomeGenBase>(); biomesToSpawnIn.addAll(getSpawnBiomes()); }
public WorldChunkManagerTerra() { terraBiomeCache = new BiomeCache(this); terraBiomeToSpawnIn = new ArrayList<BiomeGenBase>(); terraBiomeToSpawnIn.add(AEBiomeList.terraOcean); }