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


Java Chunk.getBiome方法代码示例

本文整理汇总了Java中net.minecraft.world.chunk.Chunk.getBiome方法的典型用法代码示例。如果您正苦于以下问题:Java Chunk.getBiome方法的具体用法?Java Chunk.getBiome怎么用?Java Chunk.getBiome使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.world.chunk.Chunk的用法示例。


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

示例1: onLivingUpdate

import net.minecraft.world.chunk.Chunk; //导入方法依赖的package包/类
@SubscribeEvent
public void onLivingUpdate(LivingEvent.LivingUpdateEvent event) {
    if (!(event.getEntity() instanceof EntityPlayer)) {
        return;
    }
    EntityPlayer player = (EntityPlayer) event.getEntity();
    if (player.isDead) {
        this.hueManager.adjustColor(new Color(255, 0, 0));
        return;
    }
    BlockPos pos = player.getPosition();
    Chunk chunk = this.world.getChunkFromBlockCoords(pos);
    Biome biome = chunk.getBiome(pos, this.world.getBiomeProvider());
    String color = this.biomeMap.get(biome.getRegistryName().getResourcePath());
    if (color != null) {
        this.hueManager.adjustColor(color);
    }
}
 
开发者ID:remcohaszing,项目名称:minecraft-hue,代码行数:19,代码来源:EventListener.java

示例2: getBiomeGenForCoords

import net.minecraft.world.chunk.Chunk; //导入方法依赖的package包/类
public BiomeGenBase getBiomeGenForCoords(final BlockPos pos)
{
    if (this.isBlockLoaded(pos))
    {
        Chunk chunk = this.getChunkFromBlockCoords(pos);

        try
        {
            return chunk.getBiome(pos, this.provider.getWorldChunkManager());
        }
        catch (Throwable throwable)
        {
            CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Getting biome");
            CrashReportCategory crashreportcategory = crashreport.makeCategory("Coordinates of biome request");
            crashreportcategory.addCrashSectionCallable("Location", new Callable<String>()
            {
                public String call() throws Exception
                {
                    return CrashReportCategory.getCoordinateInfo(pos);
                }
            });
            throw new ReportedException(crashreport);
        }
    }
    else
    {
        return this.provider.getWorldChunkManager().getBiomeGenerator(pos, BiomeGenBase.plains);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:30,代码来源:World.java

示例3: getBiome

import net.minecraft.world.chunk.Chunk; //导入方法依赖的package包/类
public Biome getBiome(final BlockPos pos)
{
    if (this.isBlockLoaded(pos))
    {
        Chunk chunk = this.getChunkFromBlockCoords(pos);

        try
        {
            return chunk.getBiome(pos, this.provider.getBiomeProvider());
        }
        catch (Throwable throwable)
        {
            CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Getting biome");
            CrashReportCategory crashreportcategory = crashreport.makeCategory("Coordinates of biome request");
            crashreportcategory.setDetail("Location", new ICrashReportDetail<String>()
            {
                public String call() throws Exception
                {
                    return CrashReportCategory.getCoordinateInfo(pos);
                }
            });
            throw new ReportedException(crashreport);
        }
    }
    else
    {
        return this.provider.getBiomeProvider().getBiome(pos, Biomes.PLAINS);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:30,代码来源:World.java

示例4: getBiomeForCoordsBody

import net.minecraft.world.chunk.Chunk; //导入方法依赖的package包/类
public Biome getBiomeForCoordsBody(final BlockPos pos)
{
    if (this.isBlockLoaded(pos))
    {
        Chunk chunk = this.getChunkFromBlockCoords(pos);

        try
        {
            return chunk.getBiome(pos, this.provider.getBiomeProvider());
        }
        catch (Throwable throwable)
        {
            CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Getting biome");
            CrashReportCategory crashreportcategory = crashreport.makeCategory("Coordinates of biome request");
            crashreportcategory.setDetail("Location", new ICrashReportDetail<String>()
            {
                public String call() throws Exception
                {
                    return CrashReportCategory.getCoordinateInfo(pos);
                }
            });
            throw new ReportedException(crashreport);
        }
    }
    else
    {
        return this.provider.getBiomeProvider().getBiome(pos, Biomes.PLAINS);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:30,代码来源:World.java


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