Java 类net.minecraft.world.gen.ChunkProviderEnd 实例源码
项目:Backmemed
文件:MapGenEndCity.java
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;
}
}
项目:muon
文件:MuonUtils.java
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);
}
项目:NewHorizonsCoreMod
文件:SpaceDimRegisterer.java
/**
* 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;
}
项目:Minestrappolation-4
文件:MGenHandler.java
@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);
}
}
项目:Aftermath
文件:OreGenHandler.java
@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);
}
}
}
项目:GalacticGregGT5
文件:ModRegisterer.java
/**
* 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;
}
项目:SimpleTransmutations
文件:OreGenReplace.java
@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;
}
项目:Backmemed
文件:MapGenEndCity.java
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;
}
项目:CustomWorldGen
文件:MapGenEndCity.java
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;
}
}
项目:Magicians-Artifice
文件:GenerationHandler.java
@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);
}
}
项目:DecompiledMinecraft
文件:WorldProviderEnd.java
/**
* Returns a new chunk provider which generates chunks for this world
*/
public IChunkProvider createChunkGenerator()
{
return new ChunkProviderEnd(this.worldObj, this.worldObj.getSeed());
}
项目:DecompiledMinecraft
文件:WorldProviderEnd.java
/**
* Returns a new chunk provider which generates chunks for this world
*/
public IChunkProvider createChunkGenerator()
{
return new ChunkProviderEnd(this.worldObj, this.worldObj.getSeed());
}
项目:BaseClient
文件:WorldProviderEnd.java
/**
* Returns a new chunk provider which generates chunks for this world
*/
public IChunkProvider createChunkGenerator()
{
return new ChunkProviderEnd(this.worldObj, this.worldObj.getSeed());
}
项目:BaseClient
文件:WorldProviderEnd.java
/**
* Returns a new chunk provider which generates chunks for this world
*/
public IChunkProvider createChunkGenerator()
{
return new ChunkProviderEnd(this.worldObj, this.worldObj.getSeed());
}
项目:Backmemed
文件:WorldProviderEnd.java
public IChunkGenerator createChunkGenerator()
{
return new ChunkProviderEnd(this.worldObj, this.worldObj.getWorldInfo().isMapFeaturesEnabled(), this.worldObj.getSeed(), this.getSpawnCoordinate());
}
项目:Backmemed
文件:MapGenEndCity.java
public MapGenEndCity(ChunkProviderEnd p_i46665_1_)
{
this.endProvider = p_i46665_1_;
}
项目:Backmemed
文件:MapGenEndCity.java
public Start(World worldIn, ChunkProviderEnd chunkProvider, Random random, int chunkX, int chunkZ)
{
super(chunkX, chunkZ);
this.create(worldIn, chunkProvider, random, chunkX, chunkZ);
}
项目:CustomWorldGen
文件:WorldProviderEnd.java
public IChunkGenerator createChunkGenerator()
{
return new ChunkProviderEnd(this.worldObj, this.worldObj.getWorldInfo().isMapFeaturesEnabled(), this.worldObj.getSeed());
}
项目:CustomWorldGen
文件:MapGenEndCity.java
public MapGenEndCity(ChunkProviderEnd p_i46665_1_)
{
this.endProvider = p_i46665_1_;
}
项目:CustomWorldGen
文件:MapGenEndCity.java
public Start(World worldIn, ChunkProviderEnd chunkProvider, Random random, int chunkX, int chunkZ)
{
super(chunkX, chunkZ);
this.create(worldIn, chunkProvider, random, chunkX, chunkZ);
}
项目:muon
文件:MuonHeightMap.java
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;
}
项目:Resilience-Client-Source
文件:WorldProviderEnd.java
/**
* Returns a new chunk provider which generates chunks for this world
*/
public IChunkProvider createChunkGenerator()
{
return new ChunkProviderEnd(this.worldObj, this.worldObj.getSeed());
}
项目:Cauldron
文件:WorldProviderEnd.java
public IChunkProvider createChunkGenerator()
{
return new ChunkProviderEnd(this.worldObj, this.worldObj.getSeed());
}
项目:Cauldron
文件:WorldProviderEnd.java
public IChunkProvider createChunkGenerator()
{
return new ChunkProviderEnd(this.worldObj, this.worldObj.getSeed());
}
项目:RuneCraftery
文件:WorldProviderEnd.java
public IChunkProvider func_76555_c() {
return new ChunkProviderEnd(this.field_76579_a, this.field_76579_a.func_72905_C());
}
项目:RuneCraftery
文件:WorldProviderEnd.java
/**
* Returns a new chunk provider which generates chunks for this world
*/
public IChunkProvider createChunkGenerator()
{
return new ChunkProviderEnd(this.worldObj, this.worldObj.getSeed());
}
项目:BetterNutritionMod
文件:WorldProviderEnd.java
/**
* Returns a new chunk provider which generates chunks for this world
*/
public IChunkProvider createChunkGenerator()
{
return new ChunkProviderEnd(this.worldObj, this.worldObj.getSeed());
}
项目:CustomOreGen
文件:WorldConfig.java
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);
}
项目:CodeLyokoMod
文件:LyokoForestSector.java
public IChunkProvider getChunkProvider()
{
return new ChunkProviderEnd(this.worldObj, this.worldObj.getSeed());
}
项目:CodeLyokoMod
文件:LyokoCarthageSector.java
public IChunkProvider getChunkProvider()
{
return new ChunkProviderEnd(this.worldObj, this.worldObj.getSeed());
}
项目:CodeLyokoMod
文件:WorldProviderIceSector.java
public IChunkProvider getChunkProvider()
{
return new ChunkProviderEnd(this.worldObj, this.worldObj.getSeed());
}
项目:CodeLyokoMod
文件:LyokoMountainSector.java
public IChunkProvider getChunkProvider()
{
return new ChunkProviderEnd(this.worldObj, this.worldObj.getSeed());
}