本文整理汇总了Java中net.minecraft.world.gen.ChunkProviderGenerate类的典型用法代码示例。如果您正苦于以下问题:Java ChunkProviderGenerate类的具体用法?Java ChunkProviderGenerate怎么用?Java ChunkProviderGenerate使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ChunkProviderGenerate类属于net.minecraft.world.gen包,在下文中一共展示了ChunkProviderGenerate类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onEvent
import net.minecraft.world.gen.ChunkProviderGenerate; //导入依赖的package包/类
@SubscribeEvent
public void onEvent(ChunkProviderEvent.ReplaceBiomeBlocks event){
int dim = event.world.provider.getDimensionId();
if(this.replacedMapGensDimensions.contains(dim)){
//don't touch, we already replaced it
return;
}
this.replacedMapGensDimensions.add(dim);
IChunkProvider prov = event.chunkProvider;
if(!(prov instanceof ChunkProviderGenerate)){
return;
}
List<Field> genFields = ReflectionUtil.getFieldsByType(MapGenBase.class, ChunkProviderGenerate.class, false);
for(Field field : genFields){
MapGenBase value = ReflectionUtil.getValue(field, prov, MapGenBase.class);
value = WorldGenUtil.tileableMapGen(value);
ReflectionUtil.setValue(field, prov, value);
}
}
示例2: generate
import net.minecraft.world.gen.ChunkProviderGenerate; //导入依赖的package包/类
@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);
}
}
示例3: createChunkGenerator
import net.minecraft.world.gen.ChunkProviderGenerate; //导入依赖的package包/类
/**
* @author jamierocks - 24th October 2016
* @reason To use custom ChunkProviders where necessary
*/
@Overwrite
public IChunkProvider createChunkGenerator() {
final IChunkProvider chunkProvider = this.terrainType == WorldType.FLAT ?
new ChunkProviderFlat(this.worldObj, this.worldObj.getSeed(), this.worldObj.getWorldInfo().isMapFeaturesEnabled(),
this.generatorSettings) :
(this.terrainType == WorldType.DEBUG_WORLD ?
new ChunkProviderDebug(this.worldObj) :
(this.terrainType == WorldType.CUSTOMIZED ?
new ChunkProviderGenerate(this.worldObj, this.worldObj.getSeed(), this.worldObj.getWorldInfo().isMapFeaturesEnabled(),
this.generatorSettings) :
new ChunkProviderGenerate(this.worldObj, this.worldObj.getSeed(), this.worldObj.getWorldInfo().isMapFeaturesEnabled(),
this.generatorSettings)));
if (this.dimensionType.hasChunkProvider()) {
final ChunkProviderCustom chunkProviderCustom = this.dimensionType.getChunkProvider();
chunkProviderCustom.setWorld((net.canarymod.api.world.World) this.worldObj);
return new NeptuneChunkProviderCustom(chunkProviderCustom, chunkProvider);
} else {
return chunkProvider;
}
}
示例4: isOreGeneratedInWorld
import net.minecraft.world.gen.ChunkProviderGenerate; //导入依赖的package包/类
@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;
}
示例5: generate
import net.minecraft.world.gen.ChunkProviderGenerate; //导入依赖的package包/类
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
{
if (chunkGenerator instanceof ChunkProviderGenerate)
{
mod.generateSurface(world, random, chunkX << 4, chunkZ << 4);
}
else if (chunkGenerator instanceof ChunkProviderHell)
{
mod.generateNether(world, random, chunkX << 4, chunkZ << 4);
}
}
示例6: createChunkGenerator
import net.minecraft.world.gen.ChunkProviderGenerate; //导入依赖的package包/类
/**
* Returns a new chunk provider which generates chunks for this world
*/
public IChunkProvider createChunkGenerator()
{
return (IChunkProvider)(this.terrainType == WorldType.FLAT ? new ChunkProviderFlat(this.worldObj, this.worldObj.getSeed(), this.worldObj.getWorldInfo().isMapFeaturesEnabled(), this.generatorSettings) : (this.terrainType == WorldType.DEBUG_WORLD ? new ChunkProviderDebug(this.worldObj) : (this.terrainType == WorldType.CUSTOMIZED ? new ChunkProviderGenerate(this.worldObj, this.worldObj.getSeed(), this.worldObj.getWorldInfo().isMapFeaturesEnabled(), this.generatorSettings) : new ChunkProviderGenerate(this.worldObj, this.worldObj.getSeed(), this.worldObj.getWorldInfo().isMapFeaturesEnabled(), this.generatorSettings))));
}
示例7: setTarget
import net.minecraft.world.gen.ChunkProviderGenerate; //导入依赖的package包/类
public void setTarget(String target, int type) {
this.timeToLive = TimeUtil.secsToTicks(10);
this.spiritType = type;
try {
if(target.equals("Village")) {
IChunkProvider ex;
for(ex = super.worldObj.getChunkProvider(); ex != null && ex instanceof ChunkProviderServer; ex = ((ChunkProviderServer)ex).currentChunkProvider) {
;
}
if(ex != null) {
if(ex instanceof ChunkProviderFlat) {
if(fieldStructureGenerators == null) {
fieldStructureGenerators = ReflectionHelper.findField(ChunkProviderFlat.class, new String[]{"structureGenerators", "field_82696_f", "f"});
}
Iterator iterator = ((List)fieldStructureGenerators.get((ChunkProviderFlat)ex)).iterator();
while(iterator.hasNext()) {
if(this.setWaypointTo(iterator.next(), MapGenVillage.class)) {
return;
}
}
} else if(ex instanceof ChunkProviderGenerate) {
if(fieldVillageGenerator == null) {
fieldVillageGenerator = ReflectionHelper.findField(ChunkProviderGenerate.class, new String[]{"villageGenerator", "field_73224_v", "v"});
}
if(fieldVillageGenerator != null) {
this.setWaypointTo(fieldVillageGenerator.get((ChunkProviderGenerate)ex), MapGenVillage.class);
}
} else if(ex instanceof ChunkProviderHell) {
this.setWaypointTo(((ChunkProviderHell)ex).genNetherBridge);
}
}
}
} catch (IllegalAccessException var5) {
;
}
}
示例8: createChunkGenerator
import net.minecraft.world.gen.ChunkProviderGenerate; //导入依赖的package包/类
/**
* Returns a new chunk provider which generates chunks for this world
*/
public IChunkProvider createChunkGenerator()
{
return (IChunkProvider)(this.terrainType == WorldType.FLAT ? new ChunkProviderFlat(this.worldObj, this.worldObj.getSeed(), this.worldObj.getWorldInfo().isMapFeaturesEnabled(), this.field_82913_c) : new ChunkProviderGenerate(this.worldObj, this.worldObj.getSeed(), this.worldObj.getWorldInfo().isMapFeaturesEnabled()));
}
示例9: getChunkGenerator
import net.minecraft.world.gen.ChunkProviderGenerate; //导入依赖的package包/类
public IChunkProvider getChunkGenerator(World world, String generatorOptions)
{
return (this == FLAT ? new ChunkProviderFlat(world, world.getSeed(), world.getWorldInfo().isMapFeaturesEnabled(), generatorOptions) : new ChunkProviderGenerate(world, world.getSeed(), world.getWorldInfo().isMapFeaturesEnabled()));
}
示例10: func_76555_c
import net.minecraft.world.gen.ChunkProviderGenerate; //导入依赖的package包/类
public IChunkProvider func_76555_c() {
return (IChunkProvider)(this.field_76577_b == WorldType.field_77138_c?new ChunkProviderFlat(this.field_76579_a, this.field_76579_a.func_72905_C(), this.field_76579_a.func_72912_H().func_76089_r(), this.field_82913_c):new ChunkProviderGenerate(this.field_76579_a, this.field_76579_a.func_72905_C(), this.field_76579_a.func_72912_H().func_76089_r()));
}