Made the Update Message display a bit later, more localization

This commit is contained in:
Ellpeck 2015-07-17 18:32:30 +02:00
parent 045672d506
commit 18a04b23f7
3 changed files with 24 additions and 2 deletions

View file

@ -3,11 +3,17 @@ package ellpeck.actuallyadditions.items;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ellpeck.actuallyadditions.util.INameableItem;
import ellpeck.actuallyadditions.util.ItemUtil;
import ellpeck.actuallyadditions.util.KeyUtil;
import ellpeck.actuallyadditions.util.ModUtil;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector;
import java.util.List;
public class ItemBattery extends ItemEnergy implements INameableItem{
@ -39,4 +45,15 @@ public class ItemBattery extends ItemEnergy implements INameableItem{
public String getName(){
return name;
}
@Override
@SuppressWarnings("unchecked")
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){
if(KeyUtil.isShiftPressed()){
list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".itemBattery.desc"));
list.add(this.getEnergyStored(stack) + "/" + this.getMaxEnergyStored(stack) + " RF");
}
else list.add(ItemUtil.shiftForInfo());
}
}

View file

@ -30,7 +30,8 @@ public class UpdateChecker{
@SubscribeEvent(receiveCanceled = true)
public void onTick(TickEvent.ClientTickEvent event){
if(!notified && doneChecking && event.phase == TickEvent.Phase.END && Minecraft.getMinecraft().thePlayer != null){
//Don't notify directly to prevent the Message getting lost in Spam on World Joining
if(Minecraft.getSystemTime() % 300 == 0 && !notified && doneChecking && Minecraft.getMinecraft().thePlayer != null){
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
if(checkFailed){
player.addChatComponentMessage(IChatComponent.Serializer.func_150699_a(StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".update.failed.desc")));

View file

@ -56,7 +56,11 @@ tooltip.actuallyadditions.blockMiscCharcoal.desc=Crafted from Charcoal
item.actuallyadditions.itemMiscRiceSlime.name=Rice Slimeball
tooltip.actuallyadditions.itemMiscRiceSlime.desc=It's sticky... and smells kinda good...
item.actuallyadditions.itemBattery.name=Battery
item.actuallyadditions.itemBattery.name=Single Battery
item.actuallyadditions.itemBatteryDouble.name=Double Battery
item.actuallyadditions.itemBatteryTriple.name=Triple Battery
item.actuallyadditions.itemBatteryQuadruple.name=Quadruple Battery
item.actuallyadditions.itemBatteryQuintuple.name=Quintuple Battery
tooltip.actuallyadditions.itemBattery.desc=Stores RF! Charge in an Energizer! Discharge in an Enervator!
tile.actuallyadditions.blockCoalGenerator.name=Coal Generator