Search in sources :

Example 1 with ISafariNetHandler

use of powercrystals.minefactoryreloaded.api.ISafariNetHandler in project MineFactoryReloaded by powercrystals.

the class ItemSafariNet method addInformation.

@Override
@SideOnly(Side.CLIENT)
@SuppressWarnings({ "unchecked", "rawtypes" })
public void addInformation(ItemStack stack, EntityPlayer player, List infoList, boolean advancedTooltips) {
    if (stack.getTagCompound() == null) {
        return;
    }
    if (stack.itemID == MineFactoryReloadedCore.safariNetJailerItem.itemID) {
        infoList.add("Released creatures don't despawn normally");
    }
    if (stack.getTagCompound().getBoolean("hide")) {
        infoList.add("It is a mystery");
    } else {
        // See Entity.getEntityName()
        infoList.add(StatCollector.translateToLocal("entity." + stack.getTagCompound().getString("id") + ".name"));
        Class c = (Class) EntityList.stringToClassMapping.get(stack.getTagCompound().getString("id"));
        if (c == null) {
            return;
        }
        for (ISafariNetHandler handler : MFRRegistry.getSafariNetHandlers()) {
            if (handler.validFor().isAssignableFrom(c)) {
                handler.addInformation(stack, player, infoList, advancedTooltips);
            }
        }
    }
}
Also used : ISafariNetHandler(powercrystals.minefactoryreloaded.api.ISafariNetHandler) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Aggregations

SideOnly (cpw.mods.fml.relauncher.SideOnly)1 ISafariNetHandler (powercrystals.minefactoryreloaded.api.ISafariNetHandler)1