当前位置: 首页>>代码示例>>Java>>正文


Java ChunkProviderGenerate类代码示例

本文整理汇总了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);
	}
}
 
开发者ID:Barteks2x,项目名称:McWorldGenLoop,代码行数:21,代码来源:EventListener.java

示例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);
	}
}
 
开发者ID:MinestrapTeam,项目名称:Minestrappolation-4,代码行数:25,代码来源:MGenHandler.java

示例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;
    }
}
 
开发者ID:NeptunePowered,项目名称:NeptuneMod,代码行数:26,代码来源:MixinWorldProvider.java

示例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;
}
 
开发者ID:tterrag1098,项目名称:SimpleTransmutations,代码行数:22,代码来源:OreGenReplace.java

示例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);
    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:13,代码来源:ModLoaderWorldGenerator.java

示例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))));
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:8,代码来源:WorldProvider.java

示例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) {
      ;
   }

}
 
开发者ID:lerion13,项目名称:witchery,代码行数:43,代码来源:EntitySpirit.java

示例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()));
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:8,代码来源:WorldProvider.java

示例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()));
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:5,代码来源:WorldType.java

示例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()));
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:4,代码来源:WorldProvider.java


注:本文中的net.minecraft.world.gen.ChunkProviderGenerate类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。