private void create(World worldIn, ChunkProviderEnd chunkProvider, Random rnd, int chunkX, int chunkZ) { Random random = new Random((long)(chunkX + chunkZ * 10387313)); Rotation rotation = Rotation.values()[random.nextInt(Rotation.values().length)]; int i = MapGenEndCity.func_191070_b(chunkX, chunkZ, chunkProvider); if (i < 60) { this.isSizeable = false; } else { BlockPos blockpos = new BlockPos(chunkX * 16 + 8, i, chunkZ * 16 + 8); StructureEndCityPieces.func_191087_a(worldIn.getSaveHandler().getStructureTemplateManager(), blockpos, rotation, this.components, rnd); this.updateBoundingBox(); this.isSizeable = true; } }
public static int getGroundLevel(World worldin, int xpos, int zpos) { int chunkX = xpos >> 4; int chunkZ = zpos >> 4; IChunkProvider provider = worldin.getChunkProvider(); ChunkPrimer primer = new ChunkPrimer(); if (chunkX == cachedChunkX && chunkZ == cachedChunkZ && cachedChunk != null) { primer = cachedChunk; } else { if (provider instanceof ChunkProviderOverworld) { ((ChunkProviderOverworld)provider).setBlocksInChunk(chunkX, chunkZ, primer); } else if (provider instanceof ChunkProviderEnd) { ((ChunkProviderEnd) provider).setBlocksInChunk(chunkX, chunkZ, primer); } else if (provider instanceof ChunkProviderFlat) { return worldin.getSeaLevel(); } else { return -1; // unhandled dimension. } cachedChunk = primer; cachedChunkX = chunkX; cachedChunkZ = chunkZ; } return primer.findGroundBlockIdx(xpos & 15, zpos & 15); }
/** * Vanilla MC (End Asteroids) */ private ModContainer Setup_Vanilla() { // --- Mod Vanilla (Heh, "mod") ModContainer modMCVanilla = new ModContainer("Vanilla"); // If you happen to have an asteroid dim, just skip the blocklist, and setDimensionType() to DimensionType.Asteroid // also don't forget to add at least one asteroid type, or nothing will generate! ModDimensionDef dimEndAsteroids = new ModDimensionDef("EndAsteroids", ChunkProviderEnd.class, Enums.DimensionType.Asteroid); dimEndAsteroids.addAsteroidMaterial(new AsteroidBlockComb(GTOreTypes.Netherrack)); dimEndAsteroids.addAsteroidMaterial(new AsteroidBlockComb(GTOreTypes.RedGranite)); dimEndAsteroids.addAsteroidMaterial(new AsteroidBlockComb(GTOreTypes.BlackGranite)); dimEndAsteroids.addAsteroidMaterial(new AsteroidBlockComb(GTOreTypes.EndStone)); // These Blocks will randomly be generated dimEndAsteroids.addSpecialAsteroidBlock(new SpecialBlockComb(Blocks.glowstone)); dimEndAsteroids.addSpecialAsteroidBlock(new SpecialBlockComb(Blocks.lava, Enums.AllowedBlockPosition.AsteroidCore)); modMCVanilla.addDimensionDef(dimEndAsteroids); return modMCVanilla; }
@Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { // chunkX <<= 4; // chunkZ <<= 4; BlockPos pos = new BlockPos(chunkX, 1, chunkZ); if (chunkGenerator instanceof ChunkProviderGenerate || chunkGenerator.getClass().toString().contains("ChunkProviderRTG")) { this.generateOverworld(world, random, chunkX, chunkZ); if (Config.genBiomeStones == true) { this.genBiomeStone(world, chunkX, chunkZ, random); } } else if (chunkGenerator instanceof ChunkProviderHell) { this.generateNether(world, random, chunkX, chunkZ); } else if (chunkGenerator instanceof ChunkProviderEnd) { this.generateEnd(world, random, chunkX, chunkZ); } }
@Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { if(!(chunkGenerator instanceof ChunkProviderHell) && !(chunkGenerator instanceof ChunkProviderEnd)) { for(int i = 0; i < ConfigurationHandler.leadOrePerChunk; i++) { int randPosX = (chunkX*16) + random.nextInt(16); int randPosY = random.nextInt(60); int randPosZ = (chunkZ*16) + random.nextInt(16); new WorldGenMinable(ModBlocks.leadOre, 10, Blocks.stone).generate(world, random, randPosX, randPosY, randPosZ); } } }
/** * Vanilla MC (End Asteroids) */ private ModContainer Setup_Vanilla() { // --- Mod Vanilla (Heh, "mod") ModContainer modMCVanilla = new ModContainer("Vanilla"); // If you happen to have an asteroid dim, just skip the blocklist, and setDimensionType() to DimensionType.Asteroid // also don't forget to add at least one asteroid type, or nothing will generate! ModDimensionDef dimEndAsteroids = new ModDimensionDef("EndAsteroids", ChunkProviderEnd.class, DimensionType.Asteroid); dimEndAsteroids.addAsteroidMaterial(new AsteroidBlockComb(GTOreTypes.Netherrack)); dimEndAsteroids.addAsteroidMaterial(new AsteroidBlockComb(GTOreTypes.RedGranite)); dimEndAsteroids.addAsteroidMaterial(new AsteroidBlockComb(GTOreTypes.BlackGranite)); dimEndAsteroids.addAsteroidMaterial(new AsteroidBlockComb(GTOreTypes.EndStone)); // These Blocks will randomly be generated dimEndAsteroids.addSpecialAsteroidBlock(new SpecialBlockComb(Blocks.glowstone)); dimEndAsteroids.addSpecialAsteroidBlock(new SpecialBlockComb(Blocks.lava, AllowedBlockPosition.AsteroidCore)); modMCVanilla.addDimensionDef(dimEndAsteroids); return modMCVanilla; }
@Override public boolean isOreGeneratedInWorld(World world, IChunkProvider chunkGenerator) { if (!this.shouldGenerate) { return false; } if (this.ignoreSurface && chunkGenerator instanceof ChunkProviderGenerate) { return false; } if (this.ignoreNether && chunkGenerator instanceof ChunkProviderHell) { return false; } if (this.ignoreEnd && chunkGenerator instanceof ChunkProviderEnd) { return false; } return true; }
private static int func_191070_b(int p_191070_0_, int p_191070_1_, ChunkProviderEnd p_191070_2_) { Random random = new Random((long)(p_191070_0_ + p_191070_1_ * 10387313)); Rotation rotation = Rotation.values()[random.nextInt(Rotation.values().length)]; ChunkPrimer chunkprimer = new ChunkPrimer(); p_191070_2_.setBlocksInChunk(p_191070_0_, p_191070_1_, chunkprimer); int i = 5; int j = 5; if (rotation == Rotation.CLOCKWISE_90) { i = -5; } else if (rotation == Rotation.CLOCKWISE_180) { i = -5; j = -5; } else if (rotation == Rotation.COUNTERCLOCKWISE_90) { j = -5; } int k = chunkprimer.findGroundBlockIdx(7, 7); int l = chunkprimer.findGroundBlockIdx(7, 7 + j); int i1 = chunkprimer.findGroundBlockIdx(7 + i, 7); int j1 = chunkprimer.findGroundBlockIdx(7 + i, 7 + j); int k1 = Math.min(Math.min(k, l), Math.min(i1, j1)); return k1; }
private void create(World worldIn, ChunkProviderEnd chunkProvider, Random rnd, int chunkX, int chunkZ) { Rotation rotation = Rotation.values()[rnd.nextInt(Rotation.values().length)]; ChunkPrimer chunkprimer = new ChunkPrimer(); chunkProvider.setBlocksInChunk(chunkX, chunkZ, chunkprimer); int i = 5; int j = 5; if (rotation == Rotation.CLOCKWISE_90) { i = -5; } else if (rotation == Rotation.CLOCKWISE_180) { i = -5; j = -5; } else if (rotation == Rotation.COUNTERCLOCKWISE_90) { j = -5; } int k = chunkprimer.findGroundBlockIdx(7, 7); int l = chunkprimer.findGroundBlockIdx(7, 7 + j); int i1 = chunkprimer.findGroundBlockIdx(7 + i, 7); int j1 = chunkprimer.findGroundBlockIdx(7 + i, 7 + j); int k1 = Math.min(Math.min(k, l), Math.min(i1, j1)); if (k1 < 60) { this.isSizeable = false; } else { BlockPos blockpos = new BlockPos(chunkX * 16 + 8, k1, chunkZ * 16 + 8); StructureEndCityPieces.beginHouseTower(blockpos, rotation, this.components, rnd); this.updateBoundingBox(); this.isSizeable = true; } }
@Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { if (!(chunkGenerator instanceof ChunkProviderHell) && !(chunkGenerator instanceof ChunkProviderEnd)) { generateSurface(world, random, chunkX * 16, chunkZ * 16); } else if (chunkGenerator instanceof ChunkProviderHell) { generateNether(world, random, chunkX * 16, chunkZ * 16); } else { generateEnd(world, random, chunkX * 16, chunkZ * 16); } }
/** * Returns a new chunk provider which generates chunks for this world */ public IChunkProvider createChunkGenerator() { return new ChunkProviderEnd(this.worldObj, this.worldObj.getSeed()); }
public IChunkGenerator createChunkGenerator() { return new ChunkProviderEnd(this.worldObj, this.worldObj.getWorldInfo().isMapFeaturesEnabled(), this.worldObj.getSeed(), this.getSpawnCoordinate()); }
public MapGenEndCity(ChunkProviderEnd p_i46665_1_) { this.endProvider = p_i46665_1_; }
public Start(World worldIn, ChunkProviderEnd chunkProvider, Random random, int chunkX, int chunkZ) { super(chunkX, chunkZ); this.create(worldIn, chunkProvider, random, chunkX, chunkZ); }
public IChunkGenerator createChunkGenerator() { return new ChunkProviderEnd(this.worldObj, this.worldObj.getWorldInfo().isMapFeaturesEnabled(), this.worldObj.getSeed()); }
public static MuonHeightMap defaultHeights(World worldIn, StructureBoundingBox bb) { MuonHeightMap hm = new MuonHeightMap(worldIn, bb); // try to load default map heights from terrain generator IChunkProvider provider = worldIn.getChunkProvider(); IChunkGenerator gen = null; try { gen = ((ChunkProviderServer) provider).chunkGenerator; } catch (Exception e) { e.printStackTrace(); } hm.seaLevel = worldIn.getSeaLevel() - 1; // set sea level. int defaultlevel = -1; if (gen instanceof ChunkProviderFlat) { defaultlevel = worldIn.getSeaLevel() - 1; } for (int chunkX = (hm.mapbb.minX>>4); chunkX <= (hm.mapbb.maxX>>4); ++chunkX) { for (int chunkZ = (hm.mapbb.minZ>>4); chunkZ <= (hm.mapbb.maxZ>>4); ++chunkZ) { ChunkPrimer primer = new ChunkPrimer(); if (gen instanceof ChunkProviderOverworld) { ((ChunkProviderOverworld) gen).setBlocksInChunk(chunkX, chunkZ, primer); } else if (gen instanceof ChunkProviderEnd) { ((ChunkProviderEnd) gen).setBlocksInChunk(chunkX, chunkZ, primer); } else { primer = null; } for (int i = 0; i < 16; ++i) { for (int j = 0; j < 16; ++j) { int groundlevel = defaultlevel; if (primer != null) { //BUGGY if we do it with groundlevel = primer.findGroundBlockIdx(i, j); for (int k = 255; k >= 0; --k) { IBlockState state = primer.getBlockState(i,k,j); if (state != Blocks.AIR.getDefaultState()) { groundlevel = k; break; } } } hm.setHeight((chunkX<<4)+i, (chunkZ<<4)+j, groundlevel); } } } } return hm; }
public IChunkProvider createChunkGenerator() { return new ChunkProviderEnd(this.worldObj, this.worldObj.getSeed()); }
public IChunkProvider func_76555_c() { return new ChunkProviderEnd(this.field_76579_a, this.field_76579_a.func_72905_C()); }
private static void populateWorldProperties(Map<String,Object> properties, World world, WorldInfo worldInfo) { properties.put("world", worldInfo == null ? "" : worldInfo.getWorldName()); properties.put("world.seed", worldInfo == null ? 0L : worldInfo.getSeed()); properties.put("world.version", worldInfo == null ? 0 : worldInfo.getSaveVersion()); properties.put("world.isHardcore", worldInfo == null ? false : worldInfo.isHardcoreModeEnabled()); properties.put("world.hasFeatures", worldInfo == null ? false : worldInfo.isMapFeaturesEnabled()); properties.put("world.hasCheats", worldInfo == null ? false : worldInfo.areCommandsAllowed()); properties.put("world.gameMode", worldInfo == null ? "" : worldInfo.getGameType().getName()); properties.put("world.gameMode.id", worldInfo == null ? 0 : worldInfo.getGameType().getID()); properties.put("world.type", worldInfo == null ? "" : worldInfo.getTerrainType().getName()); properties.put("world.type.version", worldInfo == null ? 0 : worldInfo.getTerrainType().getGeneratorVersion()); String genName = "RandomLevelSource"; String genClass = "ChunkProviderOverworld"; if (world != null) { IChunkGenerator chunkGenerator = world.provider.createChunkGenerator(); genName = chunkGenerator.toString(); genClass = chunkGenerator.getClass().getSimpleName(); if (chunkGenerator instanceof ChunkProviderOverworld) { genClass = "ChunkProviderOverworld"; } else if (chunkGenerator instanceof ChunkProviderFlat) { genClass = "ChunkProviderFlat"; } else if (chunkGenerator instanceof ChunkProviderHell) { genClass = "ChunkProviderHell"; } else if (chunkGenerator instanceof ChunkProviderEnd) { genName = "EndRandomLevelSource"; genClass = "ChunkProviderEnd"; } } properties.put("dimension.generator", genName); properties.put("dimension.generator.class", genClass); properties.put("dimension", world == null ? "" : world.provider.getDimensionType().getName()); properties.put("dimension.id", world == null ? 0 : world.provider.getDimension()); properties.put("dimension.isSurface", world == null ? false : world.provider.isSurfaceWorld()); properties.put("dimension.hasNoSky", world == null ? false : world.provider.hasNoSky()); properties.put("dimension.groundLevel", world == null ? 0 : world.provider.getAverageGroundLevel()); properties.put("dimension.actualHeight", world == null ? 0 : world.getActualHeight()); properties.put("dimension.height", world == null ? 0 : world.getHeight()); properties.put("age", false); }
public IChunkProvider getChunkProvider() { return new ChunkProviderEnd(this.worldObj, this.worldObj.getSeed()); }