Beispiel #1
0
 @Override
 public void render() {
   String biomeLabel = "Biome: ";
   BlockPos tempPos =
       new BlockPos(
           Minecraft.getMinecraft().thePlayer.posX, 20, Minecraft.getMinecraft().thePlayer.posZ);
   Chunk tempChunk = Minecraft.getMinecraft().theWorld.getChunkFromBlockCoords(tempPos);
   String biome =
       tempChunk.getBiome(tempPos, Minecraft.getMinecraft().theWorld.getWorldChunkManager())
           .biomeName;
   width =
       Render2DUtils.stringLength(biomeLabel)
           + Render2DUtils.stringLength(String.valueOf(biome))
           + 4;
   height = 12;
   Render2DUtils.drawRectangleWithOutline(x, y, width, height, color, outlineColor, thickness);
   Render2DUtils.drawShadowedFont(biomeLabel, x + 2, y + 2, Color.colorToHex(textLabelColor));
   Render2DUtils.drawShadowedFont(
       String.valueOf(biome),
       x + 2 + Render2DUtils.stringLength(biomeLabel),
       y + 2,
       Color.colorToHex(textValueColor));
 }
 public static String getChunkBiomeForEntity(Entity entity) {
   BlockPos pos = new BlockPos(entity.getPosition());
   Chunk c = entity.worldObj.getChunkFromBlockCoords(pos);
   return c.getBiome(pos, entity.worldObj.getWorldChunkManager()).biomeName;
 }