@Override
public void generate(Random rand, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider)
{
int blockX = chunkX * 16;
int blockZ = chunkZ * 16;
switch (world.provider.getDimension())
{
case -1:
generateNether(world, rand, blockX + 8, blockZ + 8);
break;
case 0:
generateOverworld(world, rand, blockX + 8, blockZ + 8);
break;
case 1:
generateEnd(world, rand, blockX + 8, blockZ + 8);
break;
}
}
java类net.minecraft.world.chunk.IChunkProvider的实例源码
LSCWorldGenerator.java 文件源码
项目:Loot-Slash-Conquer
阅读 21
收藏 0
点赞 0
评论 0
MapGenBase.java 文件源码
项目:BaseClient
阅读 23
收藏 0
点赞 0
评论 0
public void generate(IChunkProvider chunkProviderIn, World worldIn, int x, int z, ChunkPrimer chunkPrimerIn)
{
int i = this.range;
this.worldObj = worldIn;
this.rand.setSeed(worldIn.getSeed());
long j = this.rand.nextLong();
long k = this.rand.nextLong();
for (int l = x - i; l <= x + i; ++l)
{
for (int i1 = z - i; i1 <= z + i; ++i1)
{
long j1 = (long)l * j;
long k1 = (long)i1 * k;
this.rand.setSeed(j1 ^ k1 ^ worldIn.getSeed());
this.recursiveGenerate(worldIn, l, i1, x, z, chunkPrimerIn);
}
}
}
AnimaWorldGenerator.java 文件源码
项目:Anima-Mundi
阅读 19
收藏 0
点赞 0
评论 0
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider)
{
switch(world.provider.getDimension())
{
case -1:
break;
case 0:
genSurface(world, random, chunkX, chunkZ, chunkGenerator, chunkProvider);
break;
case 1:
break;
}
}
SimplyTea.java 文件源码
项目:SimplyTea
阅读 25
收藏 0
点赞 0
评论 0
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator,
IChunkProvider chunkProvider) {
if (random.nextInt(20) == 0){
int x = chunkX * 16 + 2 + random.nextInt(12);
int z = chunkZ * 16 + 2 + random.nextInt(12);
BlockPos p = new BlockPos(x,0,z);
p = world.getHeight(p);
Biome b = world.getBiome(p);
if (BiomeDictionary.hasType(b, BiomeDictionary.Type.FOREST) || b == Biomes.FOREST || b == Biomes.FOREST_HILLS){
if (world.getBlockState(p.down()).getBlock() instanceof BlockGrass && world.isAirBlock(p)){
BlockTeaSapling.generateTree(world, p, Blocks.AIR.getDefaultState(), random);
}
}
}
}
BaseWorldGeneration.java 文件源码
项目:Steam-and-Steel
阅读 20
收藏 0
点赞 0
评论 0
@Override
public void generate(Random random, int chunkX, int chunkZ, World world,
IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
switch (world.provider.dimensionId) {
case 0:
this.lowOre(this.generation_copper, world, random, chunkX, chunkZ, 30, 0, 256);
this.lowOre(this.generation_tin, world, random, chunkX, chunkZ, 30, 0, 256);
this.mediumOre(this.generation_lead, world, random, chunkX, chunkZ, 30, 0, 256);
this.mediumOre(this.generation_aluminium, world, random, chunkX, chunkZ, 30, 0, 256);
this.mediumOre(this.generation_nickel, world, random, chunkX, chunkZ, 30, 0, 256);
this.hardOre(this.generation_ruby, world, random, chunkX, chunkZ, 30, 0, 256);
this.hardOre(this.generation_uranium, world, random, chunkX, chunkZ, 30, 0, 256);
break;
case -1:
this.netherOre(this.generation_sulfur, world, random, chunkX, chunkZ, 40, 0, 256);
break;
case 1:
break;
}
}
WorldGenCandelilla.java 文件源码
项目:GardenStuff
阅读 22
收藏 0
点赞 0
评论 0
@Override
public void generate (Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {
int x = chunkX * 16 + 8;
int z = chunkZ * 16 + 8;
Biome biome = world.getBiome(new BlockPos(x, 0, z));
if (BiomeDictionary.hasType(biome, BiomeDictionary.Type.COLD ))
if (BiomeDictionary.hasType(biome, BiomeDictionary.Type.COLD)
|| BiomeDictionary.hasType(biome, BiomeDictionary.Type.NETHER)
|| BiomeDictionary.hasType(biome, BiomeDictionary.Type.WET)
|| BiomeDictionary.hasType(biome, BiomeDictionary.Type.WASTELAND)
|| BiomeDictionary.hasType(biome, BiomeDictionary.Type.SNOWY))
return;
if (!BiomeDictionary.hasType(biome, BiomeDictionary.Type.SANDY))
return;
if (random.nextInt(15) > 0)
return;
generate(world, random, new BlockPos(x, world.getSeaLevel(), z));
}
ChunkProviderServer.java 文件源码
项目:DecompiledMinecraft
阅读 21
收藏 0
点赞 0
评论 0
/**
* Populates chunk with ores etc etc
*/
public void populate(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_)
{
Chunk chunk = this.provideChunk(p_73153_2_, p_73153_3_);
if (!chunk.isTerrainPopulated())
{
chunk.func_150809_p();
if (this.serverChunkGenerator != null)
{
this.serverChunkGenerator.populate(p_73153_1_, p_73153_2_, p_73153_3_);
chunk.setChunkModified();
}
}
}
MapGenBase.java 文件源码
项目:DecompiledMinecraft
阅读 26
收藏 0
点赞 0
评论 0
public void generate(IChunkProvider chunkProviderIn, World worldIn, int x, int z, ChunkPrimer chunkPrimerIn)
{
int i = this.range;
this.worldObj = worldIn;
this.rand.setSeed(worldIn.getSeed());
long j = this.rand.nextLong();
long k = this.rand.nextLong();
for (int l = x - i; l <= x + i; ++l)
{
for (int i1 = z - i; i1 <= z + i; ++i1)
{
long j1 = (long)l * j;
long k1 = (long)i1 * k;
this.rand.setSeed(j1 ^ k1 ^ worldIn.getSeed());
this.recursiveGenerate(worldIn, l, i1, x, z, chunkPrimerIn);
}
}
}
AshenCubeStructure.java 文件源码
项目:Solar
阅读 19
收藏 0
点赞 0
评论 0
@Override
void gen(World world, int x, int z, IChunkGenerator generator, IChunkProvider provider) {
random.setSeed(world.getSeed());
long good = random.nextLong();
long succ = random.nextLong();
good *= x >> 1;
succ *= z >> 1;
random.setSeed(good ^ succ ^ world.getSeed());
//Generate
if(GEN_CONFIG.ASHEN_CUBE_STRUCTURE.rarity > 0D && GEN_CONFIG.ASHEN_CUBE_STRUCTURE.rarity / 100D > random.nextDouble()) {
BlockPos center = new BlockPos(x, 15 + random.nextInt(25), z);
if(!world.canSeeSky(center) || !GEN_CONFIG.ASHEN_CUBE_STRUCTURE.underground) {
genCubes(world, center);
}
}
}
RenderGlobal.java 文件源码
项目:Backmemed
阅读 27
收藏 0
点赞 0
评论 0
public int getCountLoadedChunks()
{
if (this.theWorld == null)
{
return 0;
}
else
{
IChunkProvider ichunkprovider = this.theWorld.getChunkProvider();
if (ichunkprovider == null)
{
return 0;
}
else
{
if (ichunkprovider != this.worldChunkProvider)
{
this.worldChunkProvider = ichunkprovider;
this.worldChunkProviderMap = (Long2ObjectMap)Reflector.getFieldValue(ichunkprovider, Reflector.ChunkProviderClient_chunkMapping);
}
return this.worldChunkProviderMap == null ? 0 : this.worldChunkProviderMap.size();
}
}
}
ChunkProviderServer.java 文件源码
项目:DecompiledMinecraft
阅读 25
收藏 0
点赞 0
评论 0
/**
* Populates chunk with ores etc etc
*/
public void populate(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_)
{
Chunk chunk = this.provideChunk(p_73153_2_, p_73153_3_);
if (!chunk.isTerrainPopulated())
{
chunk.func_150809_p();
if (this.serverChunkGenerator != null)
{
this.serverChunkGenerator.populate(p_73153_1_, p_73153_2_, p_73153_3_);
chunk.setChunkModified();
}
}
}
ChunkProviderSpaceCraters.java 文件源码
项目:TRAPPIST-1
阅读 22
收藏 0
点赞 0
评论 0
@Override
public void populate(IChunkProvider par1IChunkProvider, int par2, int par3)
{
BlockFalling.fallInstantly = true;
int var4 = par2 * 16;
int var5 = par3 * 16;
this.worldObj.getBiomeGenForCoords(var4 + 16, var5 + 16);
this.rand.setSeed(this.worldObj.getSeed());
final long var7 = this.rand.nextLong() / 2L * 2L + 1L;
final long var9 = this.rand.nextLong() / 2L * 2L + 1L;
this.rand.setSeed(par2 * var7 + par3 * var9 ^ this.worldObj.getSeed());
this.decoratePlanet(this.worldObj, this.rand, var4, var5);
this.onPopulate(par1IChunkProvider, par2, par3);
BlockFalling.fallInstantly = false;
}
ChunkProviderSpaceLakes.java 文件源码
项目:TRAPPIST-1
阅读 18
收藏 0
点赞 0
评论 0
@Override
public void populate(IChunkProvider chunk, int x, int z)
{
BlockFalling.fallInstantly = true;
int var4 = x * 16;
int var5 = z * 16;
BiomeGenBase biomeGen = this.worldObj.getBiomeGenForCoords(var4 + 16, var5 + 16);
this.worldObj.getBiomeGenForCoords(var4 + 16, var5 + 16);
this.rand.setSeed(this.worldObj.getSeed());
long var7 = this.rand.nextLong() / 2L * 2L + 1L;
long var9 = this.rand.nextLong() / 2L * 2L + 1L;
this.rand.setSeed(x * var7 + z * var9 ^ this.worldObj.getSeed());
biomeGen.decorate(this.worldObj, this.rand, var4, var5);
this.decoratePlanet(this.worldObj, this.rand, var4, var5);
SpawnerAnimals.performWorldGenSpawning(this.worldObj, biomeGen, var4 + 8, var5 + 8, 16, 16, this.rand);
this.onPopulate(chunk, x, z);
BlockFalling.fallInstantly = false;
}
ChunkProviderServer.java 文件源码
项目:BaseClient
阅读 21
收藏 0
点赞 0
评论 0
/**
* Populates chunk with ores etc etc
*/
public void populate(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_)
{
Chunk chunk = this.provideChunk(p_73153_2_, p_73153_3_);
if (!chunk.isTerrainPopulated())
{
chunk.func_150809_p();
if (this.serverChunkGenerator != null)
{
this.serverChunkGenerator.populate(p_73153_1_, p_73153_2_, p_73153_3_);
chunk.setChunkModified();
}
}
}
ChunkProviderServer.java 文件源码
项目:BaseClient
阅读 21
收藏 0
点赞 0
评论 0
/**
* Populates chunk with ores etc etc
*/
public void populate(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_)
{
Chunk chunk = this.provideChunk(p_73153_2_, p_73153_3_);
if (!chunk.isTerrainPopulated())
{
chunk.func_150809_p();
if (this.serverChunkGenerator != null)
{
this.serverChunkGenerator.populate(p_73153_1_, p_73153_2_, p_73153_3_);
chunk.setChunkModified();
}
}
}
GameRegistry.java 文件源码
项目:CustomWorldGen
阅读 27
收藏 0
点赞 0
评论 0
/**
* Callback hook for world gen - if your mod wishes to add extra mod related generation to the world
* call this
*
* @param chunkX Chunk X coordinate
* @param chunkZ Chunk Z coordinate
* @param world World we're generating into
* @param chunkGenerator The chunk generator
* @param chunkProvider The chunk provider
*/
public static void generateWorld(int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider)
{
if (sortedGeneratorList == null)
{
computeSortedGeneratorList();
}
long worldSeed = world.getSeed();
Random fmlRandom = new Random(worldSeed);
long xSeed = fmlRandom.nextLong() >> 2 + 1L;
long zSeed = fmlRandom.nextLong() >> 2 + 1L;
long chunkSeed = (xSeed * chunkX + zSeed * chunkZ) ^ worldSeed;
for (IWorldGenerator generator : sortedGeneratorList)
{
fmlRandom.setSeed(chunkSeed);
generator.generate(fmlRandom, chunkX, chunkZ, world, chunkGenerator, chunkProvider);
}
}
ChunkProviderGenerate.java 文件源码
项目:BaseClient
阅读 25
收藏 0
点赞 0
评论 0
public boolean func_177460_a(IChunkProvider p_177460_1_, Chunk p_177460_2_, int p_177460_3_, int p_177460_4_)
{
boolean flag = false;
if (this.settings.useMonuments && this.mapFeaturesEnabled && p_177460_2_.getInhabitedTime() < 3600L)
{
flag |= this.oceanMonumentGenerator.generateStructure(this.worldObj, this.rand, new ChunkCoordIntPair(p_177460_3_, p_177460_4_));
}
return flag;
}
FirmaTree.java 文件源码
项目:Firma
阅读 46
收藏 0
点赞 0
评论 0
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {
//System.out.println("Generating "+bs+" at "+chunkX+", "+chunkZ);
int x = random.nextInt(16);
int z = random.nextInt(16);
BlockPos pos = new BlockPos((chunkX*16)+x,0,(chunkZ*16)+z);
pos = world.getTopSolidOrLiquidBlock(pos);
//pos = pos.up();
generate(world, random, pos);
}
FirmaTreeGen.java 文件源码
项目:Firma
阅读 21
收藏 0
点赞 0
评论 0
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {
byte b = world.getChunkFromChunkCoords(chunkX, chunkZ).getBiomeArray()[0];
FirmaTree[] tl = FirmaBiome.getTreeForBiome(b, chunkZ*16);
if(tl.length==0){ return; }
FirmaTree ft = tl[random.nextInt(tl.length)];
FirmaBiome bi = (FirmaBiome) Biome.getBiome(b);
for(int i = 0; i < bi.treeCount; i++){
ft.generate(random, chunkX, chunkZ, world, chunkGenerator, chunkProvider);
}
}
StoneGenerator.java 文件源码
项目:Geolosys
阅读 20
收藏 0
点赞 0
评论 0
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider)
{
if(stoneSpawnList.size() > 0 && world.provider.getDimension() != -1 && world.provider.getDimension() != 1)
{
stoneSpawnList.get(random.nextInt(stoneSpawnList.size())).generate(world, random, (chunkX * 16), (chunkZ * 16));
}
}
InfusedOreGeneration.java 文件源码
项目:ThaumOres
阅读 18
收藏 0
点赞 0
评论 0
private void generateEnd(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator,
IChunkProvider chunkProvider) {
if (TOConfig.generationOres && TOConfig.generationEndstoneEnable)
gemerateOre((BlockInfusedBlockOre) TOBlocks.endstoneInfusedOre, world, random, chunkX, chunkZ,
TOConfig.generationEndstoneVeinSize, TOConfig.generationEndstoneMaxOnChunk,
TOConfig.generationEndstoneMinY, TOConfig.generationEndstoneMaxY);
}
ClientStateMachine.java 文件源码
项目:Proyecto-DASI
阅读 29
收藏 0
点赞 0
评论 0
private boolean isChunkReady()
{
// First, find the starting position we ought to have:
List<AgentSection> agents = currentMissionInit().getMission().getAgentSection();
if (agents == null || agents.size() <= currentMissionInit().getClientRole())
return true; // This should never happen.
AgentSection as = agents.get(currentMissionInit().getClientRole());
if (as.getAgentStart() != null && as.getAgentStart().getPlacement() != null)
{
PosAndDirection pos = as.getAgentStart().getPlacement();
int x = MathHelper.floor_double(pos.getX().doubleValue()) >> 4;
int z = MathHelper.floor_double(pos.getZ().doubleValue()) >> 4;
// Now get the chunk we should be starting in:
IChunkProvider chunkprov = Minecraft.getMinecraft().theWorld.getChunkProvider();
EntityPlayerSP player = Minecraft.getMinecraft().thePlayer;
if (player.addedToChunk)
{
// Our player is already added to a chunk - is it the right one?
Chunk actualChunk = chunkprov.provideChunk(player.chunkCoordX, player.chunkCoordZ);
Chunk requestedChunk = chunkprov.provideChunk(x, z);
if (actualChunk == requestedChunk && actualChunk != null && !actualChunk.isEmpty())
{
// We're in the right chunk, and it's not an empty chunk.
// We're ready to proceed, but first set our client positions to where we ought to be.
// The server should be doing this too, but there's no harm (probably) in doing it ourselves.
player.posX = pos.getX().doubleValue();
player.posY = pos.getY().doubleValue();
player.posZ = pos.getZ().doubleValue();
return true;
}
}
return false; // Our starting position has been specified, but it's not yet ready.
}
return true; // No starting position specified, so doesn't matter where we start.
}
ChunkProviderGenerate.java 文件源码
项目:DecompiledMinecraft
阅读 24
收藏 0
点赞 0
评论 0
public boolean func_177460_a(IChunkProvider p_177460_1_, Chunk p_177460_2_, int p_177460_3_, int p_177460_4_)
{
boolean flag = false;
if (this.settings.useMonuments && this.mapFeaturesEnabled && p_177460_2_.getInhabitedTime() < 3600L)
{
flag |= this.oceanMonumentGenerator.generateStructure(this.worldObj, this.rand, new ChunkCoordIntPair(p_177460_3_, p_177460_4_));
}
return flag;
}
HookedClientWorld.java 文件源码
项目:UniversalRemote
阅读 25
收藏 0
点赞 0
评论 0
public HookedClientWorld(WorldClient originalWorld) throws IllegalAccessException {
super(InjectionHandler.readFieldOfType(originalWorld, NetHandlerPlayClient.class),
new WorldSettings(originalWorld.getWorldInfo()),
originalWorld.provider.getDimension(), originalWorld.getDifficulty(), originalWorld.profiler);
HookedChunkProviderClient chunkProvider = new HookedChunkProviderClient(this);
// replace the chunk provider with our own!
InjectionHandler.writeFieldOfType(this, chunkProvider, ChunkProviderClient.class);
InjectionHandler.writeFieldOfType(this, chunkProvider, IChunkProvider.class);
SetupWorldProviderProxy();
}
WorldServer.java 文件源码
项目:DecompiledMinecraft
阅读 23
收藏 0
点赞 0
评论 0
/**
* Creates the chunk provider for this world. Called in the constructor. Retrieves provider from worldProvider?
*/
protected IChunkProvider createChunkProvider()
{
IChunkLoader ichunkloader = this.saveHandler.getChunkLoader(this.provider);
this.theChunkProviderServer = new ChunkProviderServer(this, ichunkloader, this.provider.createChunkGenerator());
return this.theChunkProviderServer;
}
ChunkProviderServer.java 文件源码
项目:DecompiledMinecraft
阅读 30
收藏 0
点赞 0
评论 0
public boolean func_177460_a(IChunkProvider p_177460_1_, Chunk p_177460_2_, int p_177460_3_, int p_177460_4_)
{
if (this.serverChunkGenerator != null && this.serverChunkGenerator.func_177460_a(p_177460_1_, p_177460_2_, p_177460_3_, p_177460_4_))
{
Chunk chunk = this.provideChunk(p_177460_3_, p_177460_4_);
chunk.setChunkModified();
return true;
}
else
{
return false;
}
}
ChunkProviderGenerate.java 文件源码
项目:DecompiledMinecraft
阅读 25
收藏 0
点赞 0
评论 0
public boolean func_177460_a(IChunkProvider p_177460_1_, Chunk p_177460_2_, int p_177460_3_, int p_177460_4_)
{
boolean flag = false;
if (this.settings.useMonuments && this.mapFeaturesEnabled && p_177460_2_.getInhabitedTime() < 3600L)
{
flag |= this.oceanMonumentGenerator.generateStructure(this.worldObj, this.rand, new ChunkCoordIntPair(p_177460_3_, p_177460_4_));
}
return flag;
}
ChunkProviderServer.java 文件源码
项目:BaseClient
阅读 29
收藏 0
点赞 0
评论 0
public ChunkProviderServer(WorldServer p_i1520_1_, IChunkLoader p_i1520_2_, IChunkProvider p_i1520_3_)
{
this.dummyChunk = new EmptyChunk(p_i1520_1_, 0, 0);
this.worldObj = p_i1520_1_;
this.chunkLoader = p_i1520_2_;
this.serverChunkGenerator = p_i1520_3_;
}
WorldGenOre.java 文件源码
项目:customstuff4
阅读 22
收藏 0
点赞 0
评论 0
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider)
{
if (world.provider.getDimension() != dimension)
{
return;
}
BlockPos chunkPos = new BlockPos(chunkX * 16, 0, chunkZ * 16);
if (maxHeight < minHeight)
{
int i = minHeight;
minHeight = maxHeight;
maxHeight = i;
} else if (maxHeight == minHeight)
{
if (minHeight < 255)
{
++maxHeight;
} else
{
--minHeight;
}
}
for (int j = 0; j < count; ++j)
{
BlockPos blockpos = chunkPos.add(random.nextInt(16), random.nextInt(maxHeight - minHeight) + minHeight, random.nextInt(16));
gen.generate(world, random, blockpos);
}
}
InfusedOreGeneration.java 文件源码
项目:ThaumOres
阅读 18
收藏 0
点赞 0
评论 0
private void generateNether(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator,
IChunkProvider chunkProvider) {
if (TOConfig.generationOres && TOConfig.generationNetherrackEnable)
gemerateOre((BlockInfusedBlockOre) TOBlocks.netherrackInfusedOre, world, random, chunkX, chunkZ,
TOConfig.generationNetherrackVeinSize, TOConfig.generationNetherrackMaxOnChunk,
TOConfig.generationNetherrackMinY, TOConfig.generationNetherrackMaxY);
}