mirror of
https://github.com/GTNewHorizons/BloodMagic.git
synced 2026-11-24 22:04:39 +00:00
Make a generic method in order to remove tons of duplicate code that adds an item's owner and its active state to the tooltip.
This commit is contained in:
1 parent
ead07b752b
commit
aad613b221
42 files changed
+74
-408
No files matched your search
@@ -19,12 +19,13 @@ import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||
import WayofTime.alchemicalWizardry.common.omega.OmegaParadigm;
|
||||
import WayofTime.alchemicalWizardry.common.omega.OmegaRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class EnergySword extends ItemSword {
|
||||
public class EnergySword extends ItemSword implements IBindable {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon activeIcon;
|
||||
@@ -180,20 +181,7 @@ public class EnergySword extends ItemSword {
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.caution.desc1"));
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.caution.desc2"));
|
||||
|
||||
if (!(par1ItemStack.getTagCompound() == null)) {
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive")) {
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
|
||||
} else {
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.deactivated"));
|
||||
}
|
||||
|
||||
if (!par1ItemStack.getTagCompound().getString("ownerName").equals("")) {
|
||||
par3List.add(
|
||||
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
|
||||
+ par1ItemStack.getTagCompound().getString("ownerName"));
|
||||
}
|
||||
}
|
||||
addBindingInformation(par1ItemStack, par3List);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user