本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}