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"))
|
if (itemStack.hasTagCompound() && itemStack.getTagCompound().hasKey("biomeID"))
|
||||||
{
|
{
|
||||||
int biomeId = itemStack.getTagCompound().getInteger("biomeID");
|
return BiomeGenBase.getBiome(itemStack.getTagCompound().getInteger("biomeID"));
|
||||||
try
|
|
||||||
{
|
|
||||||
return BiomeGenBase.getBiomeGenArray()[biomeId];
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
|
|
||||||
package biomesoplenty.common.item;
|
package biomesoplenty.common.item;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
|
@ -151,6 +153,18 @@ public class ItemBiomeFinder extends Item
|
||||||
nbt.removeTag("posX");
|
nbt.removeTag("posX");
|
||||||
nbt.removeTag("posZ");
|
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