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


Java BiomeProvider类代码示例

本文整理汇总了Java中net.minecraft.world.biome.BiomeProvider的典型用法代码示例。如果您正苦于以下问题:Java BiomeProvider类的具体用法?Java BiomeProvider怎么用?Java BiomeProvider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


BiomeProvider类属于net.minecraft.world.biome包,在下文中一共展示了BiomeProvider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: init

import net.minecraft.world.biome.BiomeProvider; //导入依赖的package包/类
@CustomRegistry
public static void init() {
	Biome.BiomeProperties properties = new Biome.BiomeProperties("Rubber Plantation");
	properties.setTemperature(0.95F);
	properties.setRainfall(0.95F);
	properties.setBaseHeight(0.45F);
	properties.setHeightVariation(0.4F);

	rubberPlantationBiome = new RubberPlantationBiome(properties);
	rubberPlantationBiome.setRegistryName(new ResourceLocation(TRConstants.MOD_ID, "rubberPlantation"));

	GameRegistry.register(rubberPlantationBiome);

	BiomeManager.addBiome(BiomeManager.BiomeType.WARM, new BiomeManager.BiomeEntry(rubberPlantationBiome, 20));
	BiomeManager.addSpawnBiome(rubberPlantationBiome);
	BiomeProvider.allowedBiomes.add(rubberPlantationBiome);
}
 
开发者ID:TechReborn,项目名称:TechReborn3,代码行数:18,代码来源:TechRebornWorld.java

示例2: createBiomeProvider

import net.minecraft.world.biome.BiomeProvider; //导入依赖的package包/类
/**
 * creates a new world chunk manager for WorldProvider
 */
protected void createBiomeProvider()
{
    this.field_191067_f = true;
    WorldType worldtype = this.worldObj.getWorldInfo().getTerrainType();

    if (worldtype == WorldType.FLAT)
    {
        FlatGeneratorInfo flatgeneratorinfo = FlatGeneratorInfo.createFlatGeneratorFromString(this.worldObj.getWorldInfo().getGeneratorOptions());
        this.biomeProvider = new BiomeProviderSingle(Biome.getBiome(flatgeneratorinfo.getBiome(), Biomes.DEFAULT));
    }
    else if (worldtype == WorldType.DEBUG_WORLD)
    {
        this.biomeProvider = new BiomeProviderSingle(Biomes.PLAINS);
    }
    else
    {
        this.biomeProvider = new BiomeProvider(this.worldObj.getWorldInfo());
    }
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:23,代码来源:WorldProvider.java

示例3: getBiome

import net.minecraft.world.biome.BiomeProvider; //导入依赖的package包/类
public Biome getBiome(BlockPos pos, BiomeProvider provider)
{
    int i = pos.getX() & 15;
    int j = pos.getZ() & 15;
    int k = this.blockBiomeArray[j << 4 | i] & 255;

    if (k == 255)
    {
        Biome biome = provider.getBiome(pos, Biomes.PLAINS);
        k = Biome.getIdForBiome(biome);
        this.blockBiomeArray[j << 4 | i] = (byte)(k & 255);
    }

    Biome biome1 = Biome.getBiome(k);
    return biome1 == null ? Biomes.PLAINS : biome1;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:17,代码来源:Chunk.java

示例4: Start

import net.minecraft.world.biome.BiomeProvider; //导入依赖的package包/类
public Start(BiomeProvider chunkManagerIn, int p_i2104_2_, Random rand, int p_i2104_4_, int p_i2104_5_, List<StructureVillagePieces.PieceWeight> p_i2104_6_, int p_i2104_7_)
{
    super((StructureVillagePieces.Start)null, 0, rand, p_i2104_4_, p_i2104_5_);
    this.worldChunkMngr = chunkManagerIn;
    this.structureVillageWeightedPieceList = p_i2104_6_;
    this.terrainType = p_i2104_7_;
    Biome biome = chunkManagerIn.getBiome(new BlockPos(p_i2104_4_, 0, p_i2104_5_), Biomes.DEFAULT);

    if (biome instanceof BiomeDesert)
    {
        this.structureType = 1;
    }
    else if (biome instanceof BiomeSavanna)
    {
        this.structureType = 2;
    }
    else if (biome instanceof BiomeTaiga)
    {
        this.structureType = 3;
    }

    this.func_189924_a(this.structureType);
    this.isZombieInfested = rand.nextInt(50) == 0;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:25,代码来源:StructureVillagePieces.java

示例5: Start

import net.minecraft.world.biome.BiomeProvider; //导入依赖的package包/类
public Start(BiomeProvider chunkManagerIn, int p_i2104_2_, Random rand, int p_i2104_4_, int p_i2104_5_, List<StructureVillagePieces.PieceWeight> p_i2104_6_, int p_i2104_7_)
{
    super((StructureVillagePieces.Start)null, 0, rand, p_i2104_4_, p_i2104_5_);
    this.worldChunkMngr = chunkManagerIn;
    this.structureVillageWeightedPieceList = p_i2104_6_;
    this.terrainType = p_i2104_7_;
    Biome biome = chunkManagerIn.getBiome(new BlockPos(p_i2104_4_, 0, p_i2104_5_), Biomes.DEFAULT);
    this.biome = biome;
    this.startPiece = this;

    if (biome instanceof BiomeDesert)
    {
        this.structureType = 1;
    }
    else if (biome instanceof BiomeSavanna)
    {
        this.structureType = 2;
    }
    else if (biome instanceof BiomeTaiga)
    {
        this.structureType = 3;
    }

    this.func_189924_a(this.structureType);
    this.isZombieInfested = rand.nextInt(50) == 0;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:27,代码来源:StructureVillagePieces.java

示例6: overrideBiomeProvider

import net.minecraft.world.biome.BiomeProvider; //导入依赖的package包/类
private void overrideBiomeProvider(int dimension, World world)
{
    // Don't accidentally re-wrap our own BiomeProvider...
    if (world.getBiomeProvider() instanceof BiomeProviderPaintedBiomes)
    {
        return;
    }

    PaintedBiomes.logger.info("Wrapping the BiomeProvider (of type {}) of dimension {} with {}",
            world.getBiomeProvider().getClass().getName(), dimension, BiomeProviderPaintedBiomes.class.getName());

    try
    {
        // Re-initialize the ImageHandler when a world loads, to update config values etc.
        ImageHandler imageHandler = ImageHandler.getImageHandler(dimension).init(world.getSeed());

        BiomeProvider newBiomeProvider = new BiomeProviderPaintedBiomes(world, world.getBiomeProvider(), imageHandler);
        ReflectionHelper.setPrivateValue(WorldProvider.class, world.provider, newBiomeProvider, "field_76578_c", "biomeProvider");
    }
    catch (UnableToAccessFieldException e)
    {
        PaintedBiomes.logger.error("Failed to wrap the BiomeProvider of dimension " + dimension);
    }
}
 
开发者ID:maruohon,项目名称:paintedbiomes,代码行数:25,代码来源:PaintedBiomesEventHandler.java

示例7: getBiomeProvider

import net.minecraft.world.biome.BiomeProvider; //导入依赖的package包/类
@Override
public BiomeProvider getBiomeProvider() {
	if(m_realProvider != null) {
		return m_realProvider.getBiomeProvider();
	} else {
		return super.getBiomeProvider();
	}
}
 
开发者ID:orbwoi,项目名称:UniversalRemote,代码行数:9,代码来源:WorldProviderProxyClient.java

示例8: getBiomeProvider

import net.minecraft.world.biome.BiomeProvider; //导入依赖的package包/类
@Override
public BiomeProvider getBiomeProvider() {
	if (m_proxyWorld != null && Util.isPrefixInCallStack(m_modPrefix)) {
		return m_proxyWorld.getBiomeProvider();
	} else if (m_realWorld != null) {
		return m_realWorld.getBiomeProvider();
	} else {
		return super.getBiomeProvider();
	}
}
 
开发者ID:orbwoi,项目名称:UniversalRemote,代码行数:11,代码来源:WorldServerProxy.java

示例9: getBiomeProvider

import net.minecraft.world.biome.BiomeProvider; //导入依赖的package包/类
@Override
public BiomeProvider getBiomeProvider() {
	if (m_proxyProvider != null && Util.isPrefixInCallStack(m_modPrefix)) {
		return m_proxyProvider.getBiomeProvider();
	} else if (m_realProvider != null) {
		return m_realProvider.getBiomeProvider();
	} else {
		return super.getBiomeProvider();
	}
}
 
开发者ID:orbwoi,项目名称:UniversalRemote,代码行数:11,代码来源:WorldProviderProxyServer.java

示例10: getATGBiomeProvider

import net.minecraft.world.biome.BiomeProvider; //导入依赖的package包/类
public static BiomeProviderATG getATGBiomeProvider(World world) {
    BiomeProvider provider = world.getBiomeProvider();
    if (provider instanceof BiomeProviderATG) {
        return (BiomeProviderATG)provider;
    }

    //todo: if deemed necessary, some form of recursive field search in case the biome provider is wrapped

    return null;
}
 
开发者ID:stuebz88,项目名称:modName,代码行数:11,代码来源:GeneralUtil.java

示例11: convertFile

import net.minecraft.world.biome.BiomeProvider; //导入依赖的package包/类
private void convertFile(File baseFolder, Iterable<File> regionFiles, BiomeProvider p_75813_3_, int p_75813_4_, int p_75813_5_, IProgressUpdate progress)
{
    for (File file1 : regionFiles)
    {
        this.convertChunks(baseFolder, file1, p_75813_3_, p_75813_4_, p_75813_5_, progress);
        ++p_75813_4_;
        int i = (int)Math.round(100.0D * (double)p_75813_4_ / (double)p_75813_5_);
        progress.setLoadingProgress(i);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:11,代码来源:AnvilSaveConverter.java

示例12: addSpawnBiome

import net.minecraft.world.biome.BiomeProvider; //导入依赖的package包/类
public static void addSpawnBiome(Biome biome)
{
    if (!BiomeProvider.allowedBiomes.contains(biome))
    {
        BiomeProvider.allowedBiomes.add(biome);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:8,代码来源:BiomeManager.java

示例13: removeSpawnBiome

import net.minecraft.world.biome.BiomeProvider; //导入依赖的package包/类
public static void removeSpawnBiome(Biome biome)
{
    if (BiomeProvider.allowedBiomes.contains(biome))
    {
        BiomeProvider.allowedBiomes.remove(biome);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:8,代码来源:BiomeManager.java

示例14: getBiomes

import net.minecraft.world.biome.BiomeProvider; //导入依赖的package包/类
@Gamma
@Hook("net.minecraft.world.biome.BiomeProvider#getBiomes")
public static final Hook.Result getBiomes(BiomeProvider provider, @Nullable Biome[] oldBiomeList,
		int x, int z, int width, int depth, boolean cacheFlag) {
	if (debug_biome_flag)
		return Hook.Result.VOID;
	Biome result[] = new Biome[width * depth];
	Arrays.fill(result, getBiome());
	return new Hook.Result(result);
}
 
开发者ID:NekoCaffeine,项目名称:Alchemy,代码行数:11,代码来源:AlchemyHooks.java

示例15: getBiome

import net.minecraft.world.biome.BiomeProvider; //导入依赖的package包/类
@Gamma
@Hook("net.minecraft.world.biome.BiomeProvider#getBiomes")
public static final Hook.Result getBiome(BiomeProvider provider, BlockPos pos, Biome defaultBiome) {
	if (debug_biome_flag)
		return Hook.Result.VOID;
	return new Hook.Result(getBiome());
}
 
开发者ID:NekoCaffeine,项目名称:Alchemy,代码行数:8,代码来源:AlchemyHooks.java


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