Add biome name to biome finder tooltip
This commit is contained in:
parent
c32a624f92
commit
faa60f0e37
|
@ -38,15 +38,7 @@ public class ItemBiomeEssence extends Item
|
|||
{
|
||||
if (itemStack.hasTagCompound() && itemStack.getTagCompound().hasKey("biomeID"))
|
||||
{
|
||||
int biomeId = itemStack.getTagCompound().getInteger("biomeID");
|
||||
try
|
||||
{
|
||||
return BiomeGenBase.getBiomeGenArray()[biomeId];
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return BiomeGenBase.getBiome(itemStack.getTagCompound().getInteger("biomeID"));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
|
||||
package biomesoplenty.common.item;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
|
@ -152,5 +154,17 @@ public class ItemBiomeFinder extends Item
|
|||
nbt.removeTag("posZ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack itemStack, EntityPlayer player, List infoList, boolean advancedItemTooltips)
|
||||
{
|
||||
if (!itemStack.hasTagCompound()) {return;}
|
||||
NBTTagCompound nbt = itemStack.getTagCompound();
|
||||
if (nbt.hasKey("biomeIDToFind"))
|
||||
{
|
||||
BiomeGenBase biomeToFind = BiomeGenBase.getBiome(nbt.getInteger("biomeIDToFind")); // returns ocean if biomeIDToFind is out of bounds
|
||||
infoList.add(biomeToFind.biomeName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue