Fixed #152 missing tooltip on air canister
This commit is contained in:
parent
b8f153c72e
commit
659b63410c
2 changed files with 19 additions and 0 deletions
|
@ -4,9 +4,11 @@ import java.util.List;
|
|||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import cr0s.warpdrive.WarpDrive;
|
||||
import cr0s.warpdrive.api.IAirCanister;
|
||||
import cr0s.warpdrive.data.ComponentType;
|
||||
|
@ -97,4 +99,20 @@ public class ItemComponent extends Item implements IAirCanister {
|
|||
public boolean containsAir(ItemStack itemStack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack itemStack, EntityPlayer entityPlayer, List list, boolean advancedItemTooltips) {
|
||||
super.addInformation(itemStack, entityPlayer, list, advancedItemTooltips);
|
||||
|
||||
String tooltip = "";
|
||||
switch (ComponentType.get(itemStack.getItemDamage())) {
|
||||
case AIR_CANISTER:
|
||||
tooltip += StatCollector.translateToLocalFormatted("item.warpdrive.crafting.AirCanisterEmpty.tooltip");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
WarpDrive.addTooltip(list, tooltip);
|
||||
}
|
||||
}
|
|
@ -8,6 +8,7 @@ item.warpdrive.crafting.ComputerInterface.name=Computer Interface
|
|||
item.warpdrive.crafting.PowerInterface.name=Power Interface
|
||||
item.warpdrive.crafting.CapacitiveCrystal.name=Capacitive Crystal
|
||||
item.warpdrive.crafting.AirCanisterEmpty.name=Empty Air Canister
|
||||
item.warpdrive.crafting.AirCanisterEmpty.tooltip=Right click an Air generator to fill me
|
||||
item.warpdrive.crafting.Lens.name=Lens
|
||||
item.warpdrive.crafting.Zoom.name=Zoom
|
||||
item.warpdrive.crafting.GlassTank.name=Glass Tank
|
||||
|
|
Loading…
Reference in a new issue