mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-26 16:58:34 +01:00
Made the Update Message display a bit later, more localization
This commit is contained in:
parent
045672d506
commit
18a04b23f7
3 changed files with 24 additions and 2 deletions
|
@ -3,11 +3,17 @@ package ellpeck.actuallyadditions.items;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import ellpeck.actuallyadditions.util.INameableItem;
|
import ellpeck.actuallyadditions.util.INameableItem;
|
||||||
|
import ellpeck.actuallyadditions.util.ItemUtil;
|
||||||
|
import ellpeck.actuallyadditions.util.KeyUtil;
|
||||||
import ellpeck.actuallyadditions.util.ModUtil;
|
import ellpeck.actuallyadditions.util.ModUtil;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.EnumRarity;
|
import net.minecraft.item.EnumRarity;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.util.StatCollector;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class ItemBattery extends ItemEnergy implements INameableItem{
|
public class ItemBattery extends ItemEnergy implements INameableItem{
|
||||||
|
|
||||||
|
@ -39,4 +45,15 @@ public class ItemBattery extends ItemEnergy implements INameableItem{
|
||||||
public String getName(){
|
public String getName(){
|
||||||
return name;
|
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());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,8 @@ public class UpdateChecker{
|
||||||
|
|
||||||
@SubscribeEvent(receiveCanceled = true)
|
@SubscribeEvent(receiveCanceled = true)
|
||||||
public void onTick(TickEvent.ClientTickEvent event){
|
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;
|
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||||
if(checkFailed){
|
if(checkFailed){
|
||||||
player.addChatComponentMessage(IChatComponent.Serializer.func_150699_a(StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".update.failed.desc")));
|
player.addChatComponentMessage(IChatComponent.Serializer.func_150699_a(StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".update.failed.desc")));
|
||||||
|
|
|
@ -56,7 +56,11 @@ tooltip.actuallyadditions.blockMiscCharcoal.desc=Crafted from Charcoal
|
||||||
item.actuallyadditions.itemMiscRiceSlime.name=Rice Slimeball
|
item.actuallyadditions.itemMiscRiceSlime.name=Rice Slimeball
|
||||||
tooltip.actuallyadditions.itemMiscRiceSlime.desc=It's sticky... and smells kinda good...
|
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!
|
tooltip.actuallyadditions.itemBattery.desc=Stores RF! Charge in an Energizer! Discharge in an Enervator!
|
||||||
|
|
||||||
tile.actuallyadditions.blockCoalGenerator.name=Coal Generator
|
tile.actuallyadditions.blockCoalGenerator.name=Coal Generator
|
||||||
|
|
Loading…
Reference in a new issue