diff --git a/src/main/java/ellpeck/actuallyadditions/achievement/InitAchievements.java b/src/main/java/ellpeck/actuallyadditions/achievement/InitAchievements.java index 098ea14e7..4b4d712b0 100644 --- a/src/main/java/ellpeck/actuallyadditions/achievement/InitAchievements.java +++ b/src/main/java/ellpeck/actuallyadditions/achievement/InitAchievements.java @@ -1,8 +1,8 @@ package ellpeck.actuallyadditions.achievement; import ellpeck.actuallyadditions.util.ModUtil; +import ellpeck.actuallyadditions.util.StringUtil; import net.minecraft.stats.Achievement; -import net.minecraft.util.StatCollector; import net.minecraftforge.common.AchievementPage; import java.util.ArrayList; @@ -24,7 +24,7 @@ public class InitAchievements{ achievementList.add(TheAchievements.values()[i].ach); } - theAchievementPage = new AchievementPage(StatCollector.translateToLocal("achievement.page." + ModUtil.MOD_ID_LOWER), achievementList.toArray(new Achievement[achievementList.size()])); + theAchievementPage = new AchievementPage(StringUtil.localize("achievement.page."+ModUtil.MOD_ID_LOWER), achievementList.toArray(new Achievement[achievementList.size()])); AchievementPage.registerAchievementPage(theAchievementPage); } diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockColoredLamp.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockColoredLamp.java index dbf9d193d..47860efcc 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockColoredLamp.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockColoredLamp.java @@ -6,6 +6,7 @@ import ellpeck.actuallyadditions.blocks.metalists.TheColoredLampColors; import ellpeck.actuallyadditions.util.BlockUtil; import ellpeck.actuallyadditions.util.INameableItem; import ellpeck.actuallyadditions.util.ModUtil; +import ellpeck.actuallyadditions.util.StringUtil; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -16,7 +17,6 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.oredict.OreDictionary; @@ -159,7 +159,7 @@ public class BlockColoredLamp extends Block implements INameableItem{ @Override public String getItemStackDisplayName(ItemStack stack){ if(stack.getItemDamage() >= allLampTypes.length) return null; - return StatCollector.translateToLocal(this.getUnlocalizedName(stack) + ".name") + (((BlockColoredLamp)this.theBlock).isOn ? " (" + StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".onSuffix.desc") + ")" : ""); + return StringUtil.localize(this.getUnlocalizedName(stack)+".name") + (((BlockColoredLamp)this.theBlock).isOn ? " (" + StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".onSuffix.desc") + ")" : ""); } } } \ No newline at end of file diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockInputter.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockInputter.java index f13ca1e02..a989d93d8 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockInputter.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockInputter.java @@ -15,7 +15,6 @@ import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; import net.minecraft.world.World; import java.util.List; @@ -103,7 +102,7 @@ public class BlockInputter extends BlockContainerBase implements INameableItem{ this.toPick = rand.nextInt(NAME_FLAVOUR_AMOUNTS)+1; } - return StatCollector.translateToLocal(this.getUnlocalizedName() + ".name") + " (" + StatCollector.translateToLocal("tile." + ModUtil.MOD_ID_LOWER + ".blockInputter.add." + this.toPick + ".name") + ")"; + return StringUtil.localize(this.getUnlocalizedName()+".name") + " (" + StringUtil.localize("tile."+ModUtil.MOD_ID_LOWER+".blockInputter.add."+this.toPick+".name") + ")"; } @Override @@ -115,13 +114,13 @@ public class BlockInputter extends BlockContainerBase implements INameableItem{ @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { - list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".blockInputter.desc.1")); + list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".blockInputter.desc.1")); if(KeyUtil.isShiftPressed()){ - list.add(StatCollector.translateToLocalFormatted("tooltip."+ModUtil.MOD_ID_LOWER+".blockInputter.desc.2", StringUtil.OBFUSCATED, StringUtil.LIGHT_GRAY)); + list.add(StringUtil.localizeFormatted("tooltip."+ModUtil.MOD_ID_LOWER+".blockInputter.desc.2", StringUtil.OBFUSCATED, StringUtil.LIGHT_GRAY)); for(int i = 3; i <= 7; i++){ - list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".blockInputter.desc." + i)); + list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".blockInputter.desc."+i)); } - if((((BlockInputter)theBlock).isAdvanced)) list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((INameableItem)theBlock).getName() + ".desc")); + if((((BlockInputter)theBlock).isAdvanced)) list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+"."+((INameableItem)theBlock).getName()+".desc")); } else list.add(ItemUtil.shiftForInfo()); } diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockLavaFactoryController.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockLavaFactoryController.java index f5c23e19b..34f2c4e4a 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockLavaFactoryController.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockLavaFactoryController.java @@ -3,10 +3,7 @@ package ellpeck.actuallyadditions.blocks; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.tile.TileEntityLavaFactoryController; -import ellpeck.actuallyadditions.util.BlockUtil; -import ellpeck.actuallyadditions.util.INameableItem; -import ellpeck.actuallyadditions.util.KeyUtil; -import ellpeck.actuallyadditions.util.ModUtil; +import ellpeck.actuallyadditions.util.*; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -17,7 +14,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ChatComponentText; import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; import net.minecraft.world.World; import java.util.List; @@ -58,10 +54,10 @@ public class BlockLavaFactoryController extends BlockContainerBase implements IN if(factory != null){ int state = factory.isMultiblock(); if(state == TileEntityLavaFactoryController.NOT_MULTI){ - player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".factory.notPart.desc"))); + player.addChatComponentMessage(new ChatComponentText(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".factory.notPart.desc"))); } if(state == TileEntityLavaFactoryController.HAS_AIR || state == TileEntityLavaFactoryController.HAS_LAVA){ - player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".factory.works.desc"))); + player.addChatComponentMessage(new ChatComponentText(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".factory.works.desc"))); } player.addChatComponentMessage(new ChatComponentText(factory.storage.getEnergyStored() + "/" + factory.storage.getMaxEnergyStored() + " RF")); } @@ -102,7 +98,7 @@ public class BlockLavaFactoryController extends BlockContainerBase implements IN public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { BlockUtil.addInformation(theBlock, list, 3, ""); if(KeyUtil.isShiftPressed()){ - list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".uses.desc") + " " + TileEntityLavaFactoryController.energyNeededToProduceLava + " RF/B"); + list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".uses.desc") + " " + TileEntityLavaFactoryController.energyNeededToProduceLava + " RF/B"); } } diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockPhantomface.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockPhantomface.java index c56c25baf..b015bb95e 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockPhantomface.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockPhantomface.java @@ -19,7 +19,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ChatComponentText; import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; import net.minecraft.util.Vec3; import net.minecraft.world.World; @@ -61,33 +60,33 @@ public class BlockPhantomface extends BlockContainerBase implements INameableIte if(tile != null){ if(tile instanceof TileEntityPhantomface){ TileEntityPhantomface phantom = (TileEntityPhantomface)tile; - player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".blockPhantomRange.desc") + ": " + phantom.range)); + player.addChatComponentMessage(new ChatComponentText(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".blockPhantomRange.desc") + ": " + phantom.range)); if(phantom.hasBoundTile()){ int distance = (int)Vec3.createVectorHelper(x, y, z).distanceTo(Vec3.createVectorHelper(phantom.boundPosition.getX(), phantom.boundPosition.getY(), phantom.boundPosition.getZ())); Item item = phantom.boundPosition.getItemBlock(); String name = item == null ? "Absolutely Nothing" : item.getItemStackDisplayName(new ItemStack(phantom.boundPosition.getBlock(), 1, phantom.boundPosition.getMetadata())); - player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocalFormatted("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.blockInfo.desc", name, phantom.boundPosition.getX(), phantom.boundPosition.getY(), phantom.boundPosition.getZ(), distance))); + player.addChatComponentMessage(new ChatComponentText(StringUtil.localizeFormatted("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.blockInfo.desc", name, phantom.boundPosition.getX(), phantom.boundPosition.getY(), phantom.boundPosition.getZ(), distance))); - if(phantom.isBoundTileInRage()) player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.connectedRange.desc"))); - else player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.connectedNoRange.desc"))); + if(phantom.isBoundTileInRage()) player.addChatComponentMessage(new ChatComponentText(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.connectedRange.desc"))); + else player.addChatComponentMessage(new ChatComponentText(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.connectedNoRange.desc"))); } - else player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.notConnected.desc"))); + else player.addChatComponentMessage(new ChatComponentText(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.notConnected.desc"))); } else if(tile instanceof TileEntityPhantomPlacer){ if(player.isSneaking()){ TileEntityPhantomPlacer phantom = (TileEntityPhantomPlacer)tile; - player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".blockPhantomRange.desc") + ": " + phantom.range)); + player.addChatComponentMessage(new ChatComponentText(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".blockPhantomRange.desc") + ": " + phantom.range)); if(phantom.hasBoundPosition()){ int distance = (int)Vec3.createVectorHelper(x, y, z).distanceTo(Vec3.createVectorHelper(phantom.boundPosition.getX(), phantom.boundPosition.getY(), phantom.boundPosition.getZ())); Item item = phantom.boundPosition.getItemBlock(); String name = item == null ? "Absolutely Nothing" : item.getItemStackDisplayName(new ItemStack(phantom.boundPosition.getBlock(), 1, phantom.boundPosition.getMetadata())); - player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocalFormatted("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.blockInfo.desc", name, phantom.boundPosition.getX(), phantom.boundPosition.getY(), phantom.boundPosition.getZ(), distance))); + player.addChatComponentMessage(new ChatComponentText(StringUtil.localizeFormatted("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.blockInfo.desc", name, phantom.boundPosition.getX(), phantom.boundPosition.getY(), phantom.boundPosition.getZ(), distance))); - if(phantom.isBoundPositionInRange()) player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.connectedRange.desc"))); - else player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.connectedNoRange.desc"))); + if(phantom.isBoundPositionInRange()) player.addChatComponentMessage(new ChatComponentText(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.connectedRange.desc"))); + else player.addChatComponentMessage(new ChatComponentText(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.connectedNoRange.desc"))); } - else player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.notConnected.desc"))); + else player.addChatComponentMessage(new ChatComponentText(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.notConnected.desc"))); } else player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.PHANTOM_PLACER.ordinal(), world, x, y, z); } @@ -167,10 +166,10 @@ public class BlockPhantomface extends BlockContainerBase implements INameableIte BlockUtil.addInformation(theBlock, list, 2, ""); if(KeyUtil.isShiftPressed()){ if(((BlockPhantomface)this.theBlock).type == LIQUIFACE){ - list.add(StringUtil.ORANGE+StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".blockPhantomLiquiface.desc.3")); - list.add(StringUtil.ORANGE+StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".blockPhantomLiquiface.desc.4")); + list.add(StringUtil.ORANGE+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".blockPhantomLiquiface.desc.3")); + list.add(StringUtil.ORANGE+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".blockPhantomLiquiface.desc.4")); } - list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".blockPhantomRange.desc") + ": " + ((BlockPhantomface)theBlock).range); + list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".blockPhantomRange.desc") + ": " + ((BlockPhantomface)theBlock).range); } } diff --git a/src/main/java/ellpeck/actuallyadditions/event/TooltipEvent.java b/src/main/java/ellpeck/actuallyadditions/event/TooltipEvent.java index 646e7f5da..9d514bc7b 100644 --- a/src/main/java/ellpeck/actuallyadditions/event/TooltipEvent.java +++ b/src/main/java/ellpeck/actuallyadditions/event/TooltipEvent.java @@ -7,7 +7,6 @@ import ellpeck.actuallyadditions.util.KeyUtil; import ellpeck.actuallyadditions.util.ModUtil; import ellpeck.actuallyadditions.util.StringUtil; import net.minecraft.item.Item; -import net.minecraft.util.StatCollector; import net.minecraftforge.event.entity.player.ItemTooltipEvent; import net.minecraftforge.oredict.OreDictionary; @@ -16,45 +15,45 @@ public class TooltipEvent{ private static final String TEXT_PRE = StringUtil.GRAY+" "; private static final String HEADER_PRE = StringUtil.LIGHT_GRAY+" -"; - @SubscribeEvent(priority = EventPriority.LOWEST) + @SubscribeEvent(priority = EventPriority.LOW) public void onTooltipEvent(ItemTooltipEvent event){ if(event.itemStack.getItem() != null){ if(KeyUtil.isControlPressed()){ if(ConfigBoolValues.CTRL_EXTRA_INFO.isEnabled()){ - event.toolTip.add(StringUtil.GRAY+StringUtil.ITALIC+StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".extraInfo.desc")+":"); + event.toolTip.add(StringUtil.GRAY+StringUtil.ITALIC+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".extraInfo.desc")+":"); //OreDict Names int[] oreIDs = OreDictionary.getOreIDs(event.itemStack); - event.toolTip.add(HEADER_PRE+StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".oredictName.desc")+":"); + event.toolTip.add(HEADER_PRE+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".oredictName.desc")+":"); if(oreIDs.length > 0){ for(int oreID : oreIDs){ event.toolTip.add(TEXT_PRE+OreDictionary.getOreName(oreID)); } } else{ - event.toolTip.add(TEXT_PRE+StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".noOredictNameAvail.desc")); + event.toolTip.add(TEXT_PRE+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".noOredictNameAvail.desc")); } //Code Name - event.toolTip.add(HEADER_PRE+StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".codeName.desc")+":"); + event.toolTip.add(HEADER_PRE+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".codeName.desc")+":"); event.toolTip.add(TEXT_PRE+Item.itemRegistry.getNameForObject(event.itemStack.getItem())); //Base Item's Unlocalized Name String baseName = event.itemStack.getItem().getUnlocalizedName(); - event.toolTip.add(HEADER_PRE+StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".baseUnlocName.desc")+":"); + event.toolTip.add(HEADER_PRE+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".baseUnlocName.desc")+":"); event.toolTip.add(TEXT_PRE+baseName); //Unlocalized Name String metaName = event.itemStack.getItem().getUnlocalizedName(event.itemStack); if(!metaName.equals(baseName)){ - event.toolTip.add(HEADER_PRE+StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".unlocName.desc")+":"); + event.toolTip.add(HEADER_PRE+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".unlocName.desc")+":"); event.toolTip.add(TEXT_PRE+metaName); } } } else{ if(ConfigBoolValues.CTRL_INFO_FOR_EXTRA_INFO.isEnabled()){ - event.toolTip.add(StringUtil.GRAY+StringUtil.ITALIC+StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".ctrlForMoreInfo.desc")); + event.toolTip.add(StringUtil.GRAY+StringUtil.ITALIC+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".ctrlForMoreInfo.desc")); } } } diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiCanolaPress.java b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiCanolaPress.java index 47c0a3cbb..a14d0df94 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiCanolaPress.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiCanolaPress.java @@ -6,10 +6,10 @@ import ellpeck.actuallyadditions.inventory.ContainerCanolaPress; import ellpeck.actuallyadditions.tile.TileEntityBase; import ellpeck.actuallyadditions.tile.TileEntityCanolaPress; import ellpeck.actuallyadditions.util.AssetUtil; +import ellpeck.actuallyadditions.util.StringUtil; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; import org.lwjgl.opengl.GL11; import java.util.Collections; @@ -67,7 +67,7 @@ public class GuiCanolaPress extends GuiContainer{ this.func_146283_a(Collections.singletonList(text1), x, y); } - String text2 = this.press.tank.getFluidAmount() + "/" + this.press.tank.getCapacity() + " mB " +StatCollector.translateToLocal("fluid.canolaoil"); + String text2 = this.press.tank.getFluidAmount() + "/" + this.press.tank.getCapacity() + " mB " +StringUtil.localize("fluid.canolaoil"); if(x >= guiLeft+117 && y >= guiTop+6 && x <= guiLeft+132 && y <= guiTop+88){ this.func_146283_a(Collections.singletonList(text2), x, y); } diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiCoffeeMachine.java b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiCoffeeMachine.java index c392a486e..19eb4fce7 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiCoffeeMachine.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiCoffeeMachine.java @@ -9,12 +9,12 @@ import ellpeck.actuallyadditions.tile.TileEntityBase; import ellpeck.actuallyadditions.tile.TileEntityCoffeeMachine; import ellpeck.actuallyadditions.util.AssetUtil; import ellpeck.actuallyadditions.util.ModUtil; +import ellpeck.actuallyadditions.util.StringUtil; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.fluids.FluidRegistry; import org.lwjgl.opengl.GL11; @@ -49,7 +49,7 @@ public class GuiCoffeeMachine extends GuiContainer{ public void initGui(){ super.initGui(); - GuiButton buttonOkay = new GuiButton(0, guiLeft+60, guiTop+11, 58, 20, StatCollector.translateToLocal("info."+ModUtil.MOD_ID_LOWER+".gui.ok")); + GuiButton buttonOkay = new GuiButton(0, guiLeft+60, guiTop+11, 58, 20, StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.ok")); this.buttonList.add(buttonOkay); } @@ -109,7 +109,7 @@ public class GuiCoffeeMachine extends GuiContainer{ this.func_146283_a(Collections.singletonList(text3), x, y); } - String text2 = this.machine.coffeeCacheAmount + "/" + this.machine.coffeeCacheMaxAmount+" "+StatCollector.translateToLocal("info."+ModUtil.MOD_ID_LOWER+".gui.coffee"); + String text2 = this.machine.coffeeCacheAmount + "/" + this.machine.coffeeCacheMaxAmount+" "+StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.coffee"); if(x >= guiLeft+40 && y >= guiTop+25 && x <= guiLeft+49 && y <= guiTop+56){ this.func_146283_a(Collections.singletonList(text2), x, y); } diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiFeeder.java b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiFeeder.java index 2b88ef0de..5718ca52f 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiFeeder.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiFeeder.java @@ -7,10 +7,10 @@ import ellpeck.actuallyadditions.tile.TileEntityBase; import ellpeck.actuallyadditions.tile.TileEntityFeeder; import ellpeck.actuallyadditions.util.AssetUtil; import ellpeck.actuallyadditions.util.ModUtil; +import ellpeck.actuallyadditions.util.StringUtil; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; import org.lwjgl.opengl.GL11; import java.util.Arrays; @@ -57,7 +57,7 @@ public class GuiFeeder extends GuiContainer{ public void drawScreen(int x, int y, float f){ super.drawScreen(x, y, f); if(x >= guiLeft+69 && y >= guiTop+30 && x <= guiLeft+69+10 && y <= guiTop+30+10){ - String[] array = new String[]{(this.tileFeeder.currentAnimalAmount+" "+StatCollector.translateToLocal("info."+ModUtil.MOD_ID_LOWER+".gui.animals")), ((this.tileFeeder.currentAnimalAmount >= 2 && this.tileFeeder.currentAnimalAmount < this.tileFeeder.animalThreshold) ? StatCollector.translateToLocal("info."+ModUtil.MOD_ID_LOWER+".gui.enoughToBreed") : (this.tileFeeder.currentAnimalAmount >= this.tileFeeder.animalThreshold ? StatCollector.translateToLocal("info."+ModUtil.MOD_ID_LOWER+".gui.tooMany") : StatCollector.translateToLocal("info."+ModUtil.MOD_ID_LOWER+".gui.notEnough")))}; + String[] array = new String[]{(this.tileFeeder.currentAnimalAmount+" "+StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.animals")), ((this.tileFeeder.currentAnimalAmount >= 2 && this.tileFeeder.currentAnimalAmount < this.tileFeeder.animalThreshold) ? StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.enoughToBreed") : (this.tileFeeder.currentAnimalAmount >= this.tileFeeder.animalThreshold ? StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.tooMany") : StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.notEnough")))}; this.func_146283_a(Arrays.asList(array), x, y); } } diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiFermentingBarrel.java b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiFermentingBarrel.java index 90a0649e0..cbb30d29a 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiFermentingBarrel.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiFermentingBarrel.java @@ -6,10 +6,10 @@ import ellpeck.actuallyadditions.inventory.ContainerFermentingBarrel; import ellpeck.actuallyadditions.tile.TileEntityBase; import ellpeck.actuallyadditions.tile.TileEntityFermentingBarrel; import ellpeck.actuallyadditions.util.AssetUtil; +import ellpeck.actuallyadditions.util.StringUtil; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; import org.lwjgl.opengl.GL11; import java.util.Collections; @@ -63,12 +63,12 @@ public class GuiFermentingBarrel extends GuiContainer{ public void drawScreen(int x, int y, float f){ super.drawScreen(x, y, f); - String text1 = this.press.canolaTank.getFluidAmount() + "/" + this.press.canolaTank.getCapacity() + " mB " +StatCollector.translateToLocal("fluid.canolaoil"); + String text1 = this.press.canolaTank.getFluidAmount() + "/" + this.press.canolaTank.getCapacity() + " mB " +StringUtil.localize("fluid.canolaoil"); if(x >= guiLeft+61 && y >= guiTop+6 && x <= guiLeft+76 && y <= guiTop+88){ this.func_146283_a(Collections.singletonList(text1), x, y); } - String text2 = this.press.oilTank.getFluidAmount() + "/" + this.press.oilTank.getCapacity() + " mB " +StatCollector.translateToLocal("fluid.oil"); + String text2 = this.press.oilTank.getFluidAmount() + "/" + this.press.oilTank.getCapacity() + " mB " +StringUtil.localize("fluid.oil"); if(x >= guiLeft+99 && y >= guiTop+6 && x <= guiLeft+114 && y <= guiTop+88){ this.func_146283_a(Collections.singletonList(text2), x, y); } diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiInputter.java b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiInputter.java index 182fab933..1904678fa 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiInputter.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiInputter.java @@ -18,7 +18,6 @@ import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; import net.minecraft.world.World; import org.lwjgl.input.Keyboard; import org.lwjgl.opengl.GL11; @@ -54,13 +53,13 @@ public class GuiInputter extends GuiContainer{ public static final int OFFSET_ADVANCED = 12+36; public static final String[] sideString = new String[]{ - StatCollector.translateToLocal("info."+ModUtil.MOD_ID_LOWER+".gui.disabled"), - StatCollector.translateToLocal("info."+ModUtil.MOD_ID_LOWER+".gui.up"), - StatCollector.translateToLocal("info."+ModUtil.MOD_ID_LOWER+".gui.down"), - StatCollector.translateToLocal("info."+ModUtil.MOD_ID_LOWER+".gui.north"), - StatCollector.translateToLocal("info."+ModUtil.MOD_ID_LOWER+".gui.east"), - StatCollector.translateToLocal("info."+ModUtil.MOD_ID_LOWER+".gui.south"), - StatCollector.translateToLocal("info."+ModUtil.MOD_ID_LOWER+".gui.west")}; + StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.disabled"), + StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.up"), + StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.down"), + StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.north"), + StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.east"), + StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.south"), + StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.west")}; public GuiInputter(InventoryPlayer inventory, TileEntityBase tile, int x, int y, int z, World world, boolean isAdvanced){ super(new ContainerInputter(inventory, tile, isAdvanced)); @@ -188,8 +187,8 @@ public class GuiInputter extends GuiContainer{ this.mc.getTextureManager().bindTexture(this.isAdvanced ? resLocAdvanced : resLoc); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93+(isAdvanced ? OFFSET_ADVANCED : 0)); - this.fontRendererObj.drawString(StatCollector.translateToLocal("info."+ModUtil.MOD_ID_LOWER+".gui.pull"), guiLeft+22+3, guiTop+32+(isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_GRAY_TEXT); - this.fontRendererObj.drawString(StatCollector.translateToLocal("info."+ModUtil.MOD_ID_LOWER+".gui.put"), guiLeft+107+3, guiTop+32+(isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_GRAY_TEXT); + this.fontRendererObj.drawString(StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.pull"), guiLeft+22+3, guiTop+32+(isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_GRAY_TEXT); + this.fontRendererObj.drawString(StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.put"), guiLeft+107+3, guiTop+32+(isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_GRAY_TEXT); this.fontRendererObj.drawString(sideString[tileInputter.sideToPull+1], guiLeft+24+1, guiTop+45+3+(isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_GRAY_TEXT); this.fontRendererObj.drawString(sideString[tileInputter.sideToPut+1], guiLeft+109+1, guiTop+45+3+(isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_GRAY_TEXT); @@ -214,11 +213,11 @@ public class GuiInputter extends GuiContainer{ this.whitelistPut.displayString = this.tileInputter.isPutWhitelist ? "O" : "X"; if(this.isAdvanced){ - String text1 = this.tileInputter.isPullWhitelist ? StatCollector.translateToLocal("info."+ModUtil.MOD_ID_LOWER+".gui.whitelist") : StatCollector.translateToLocal("info."+ModUtil.MOD_ID_LOWER+".gui.blacklist"); + String text1 = this.tileInputter.isPullWhitelist ? StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.whitelist") : StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.blacklist"); if(x >= guiLeft+3 && y >= guiTop+16 && x <= guiLeft+18 && y <= guiTop+31){ this.func_146283_a(Collections.singletonList(text1), x, y); } - String text2 = this.tileInputter.isPutWhitelist ? StatCollector.translateToLocal("info."+ModUtil.MOD_ID_LOWER+".gui.whitelist") : StatCollector.translateToLocal("info."+ModUtil.MOD_ID_LOWER+".gui.blacklist"); + String text2 = this.tileInputter.isPutWhitelist ? StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.whitelist") : StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.blacklist"); if(x >= guiLeft+157 && y >= guiTop+16 && x <= guiLeft+172 && y <= guiTop+31){ this.func_146283_a(Collections.singletonList(text2), x, y); } @@ -227,19 +226,19 @@ public class GuiInputter extends GuiContainer{ int newTopOffset = this.guiTop+(this.isAdvanced ? OFFSET_ADVANCED : 0); //Info Mode on! if(x >= guiLeft+11 && y >= newTopOffset+65 && x <= guiLeft+11+31 && y <= newTopOffset+65+12){ - String[] strings = StatCollector.translateToLocalFormatted("info."+ModUtil.MOD_ID_LOWER+".inputter.info.1").replace("[p]", StatCollector.translateToLocal("info."+ModUtil.MOD_ID_LOWER+".gui.pull")).split(Pattern.quote("|")); + String[] strings = StringUtil.localizeFormatted("info."+ModUtil.MOD_ID_LOWER+".inputter.info.1").replace("[p]", StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.pull")).split(Pattern.quote("|")); this.func_146283_a(Arrays.asList(strings), x, y); } if(x >= guiLeft+96 && y >= newTopOffset+65 && x <= guiLeft+96+31 && y <= newTopOffset+65+12){ - String[] strings = StatCollector.translateToLocalFormatted("info."+ModUtil.MOD_ID_LOWER+".inputter.info.1").replace("[p]", StatCollector.translateToLocal("info."+ModUtil.MOD_ID_LOWER+".gui.put")).split(Pattern.quote("|")); + String[] strings = StringUtil.localizeFormatted("info."+ModUtil.MOD_ID_LOWER+".inputter.info.1").replace("[p]", StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.put")).split(Pattern.quote("|")); this.func_146283_a(Arrays.asList(strings), x, y); } if(x >= guiLeft+48 && y >= newTopOffset+65 && x <= guiLeft+48+31 && y <= newTopOffset+65+12){ - String[] strings = StatCollector.translateToLocalFormatted("info."+ModUtil.MOD_ID_LOWER+".inputter.info.2").replace("[p]", StatCollector.translateToLocal("info."+ModUtil.MOD_ID_LOWER+".gui.pull")).split(Pattern.quote("|")); + String[] strings = StringUtil.localizeFormatted("info."+ModUtil.MOD_ID_LOWER+".inputter.info.2").replace("[p]", StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.pull")).split(Pattern.quote("|")); this.func_146283_a(Arrays.asList(strings), x, y); } if(x >= guiLeft+133 && y >= newTopOffset+65 && x <= guiLeft+133+31 && y <= newTopOffset+65+12){ - String[] strings = StatCollector.translateToLocalFormatted("info."+ModUtil.MOD_ID_LOWER+".inputter.info.2").replace("[p]", StatCollector.translateToLocal("info."+ModUtil.MOD_ID_LOWER+".gui.put")).split(Pattern.quote("|")); + String[] strings = StringUtil.localizeFormatted("info."+ModUtil.MOD_ID_LOWER+".inputter.info.2").replace("[p]", StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.put")).split(Pattern.quote("|")); this.func_146283_a(Arrays.asList(strings), x, y); } } diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiOilGenerator.java b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiOilGenerator.java index b74e80162..caccd8b5d 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiOilGenerator.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiOilGenerator.java @@ -6,10 +6,10 @@ import ellpeck.actuallyadditions.inventory.ContainerOilGenerator; import ellpeck.actuallyadditions.tile.TileEntityBase; import ellpeck.actuallyadditions.tile.TileEntityOilGenerator; import ellpeck.actuallyadditions.util.AssetUtil; +import ellpeck.actuallyadditions.util.StringUtil; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; import org.lwjgl.opengl.GL11; import java.util.Collections; @@ -66,7 +66,7 @@ public class GuiOilGenerator extends GuiContainer{ if(x >= guiLeft+43 && y >= guiTop+6 && x <= guiLeft+58 && y <= guiTop+88){ this.func_146283_a(Collections.singletonList(text1), x, y); } - String text2 = this.generator.tank.getFluidAmount() + "/" + this.generator.tank.getCapacity() + " mB " +StatCollector.translateToLocal("fluid.oil"); + String text2 = this.generator.tank.getFluidAmount() + "/" + this.generator.tank.getCapacity() + " mB " +StringUtil.localize("fluid.oil"); if(x >= guiLeft+117 && y >= guiTop+6 && x <= guiLeft+132 && y <= guiTop+88){ this.func_146283_a(Collections.singletonList(text2), x, y); } diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiOreMagnet.java b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiOreMagnet.java index af0225a30..95307f123 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiOreMagnet.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiOreMagnet.java @@ -6,10 +6,10 @@ import ellpeck.actuallyadditions.inventory.ContainerOreMagnet; import ellpeck.actuallyadditions.tile.TileEntityBase; import ellpeck.actuallyadditions.tile.TileEntityOreMagnet; import ellpeck.actuallyadditions.util.AssetUtil; +import ellpeck.actuallyadditions.util.StringUtil; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; import org.lwjgl.opengl.GL11; import java.util.Arrays; @@ -62,7 +62,7 @@ public class GuiOreMagnet extends GuiContainer{ if(x >= guiLeft+43 && y >= guiTop+6 && x <= guiLeft+58 && y <= guiTop+88){ this.func_146283_a(Collections.singletonList(text1), x, y); } - String text2 = this.magnet.tank.getFluidAmount() + "/" + this.magnet.tank.getCapacity() + " mB " +StatCollector.translateToLocal("fluid.oil"); + String text2 = this.magnet.tank.getFluidAmount() + "/" + this.magnet.tank.getCapacity() + " mB " +StringUtil.localize("fluid.oil"); if(x >= guiLeft+117 && y >= guiTop+6 && x <= guiLeft+132 && y <= guiTop+88){ this.func_146283_a(Collections.singletonList(text2), x, y); } diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemArmorAA.java b/src/main/java/ellpeck/actuallyadditions/items/ItemArmorAA.java index 3e586335e..ab9a228b4 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemArmorAA.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemArmorAA.java @@ -2,10 +2,7 @@ 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 ellpeck.actuallyadditions.util.*; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; @@ -13,7 +10,6 @@ import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; import net.minecraftforge.oredict.OreDictionary; import java.util.List; @@ -50,8 +46,8 @@ public class ItemArmorAA extends ItemArmor implements INameableItem{ @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+"."+this.getName()+".desc")); - list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); + list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+"."+this.getName()+".desc")); + list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); } else list.add(ItemUtil.shiftForInfo()); } diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemBattery.java b/src/main/java/ellpeck/actuallyadditions/items/ItemBattery.java index 4501293f0..d1cc2e13a 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemBattery.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemBattery.java @@ -2,16 +2,12 @@ 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 ellpeck.actuallyadditions.util.*; 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; @@ -51,7 +47,7 @@ public class ItemBattery extends ItemEnergy implements INameableItem{ @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(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".itemBattery.desc")); list.add(this.getEnergyStored(stack) + "/" + this.getMaxEnergyStored(stack) + " RF"); } else list.add(ItemUtil.shiftForInfo()); diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemCoffee.java b/src/main/java/ellpeck/actuallyadditions/items/ItemCoffee.java index 79d6a425b..d3e542012 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemCoffee.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemCoffee.java @@ -4,10 +4,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.config.values.ConfigIntValues; import ellpeck.actuallyadditions.items.metalists.TheMiscItems; -import ellpeck.actuallyadditions.util.INameableItem; -import ellpeck.actuallyadditions.util.ItemUtil; -import ellpeck.actuallyadditions.util.KeyUtil; -import ellpeck.actuallyadditions.util.ModUtil; +import ellpeck.actuallyadditions.util.*; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; @@ -19,7 +16,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; import net.minecraft.world.World; import java.util.ArrayList; @@ -50,7 +46,7 @@ public class ItemCoffee extends ItemFood implements INameableItem{ } @Override public String getExtraText(){ - return StatCollector.translateToLocal("container.nei." + ModUtil.MOD_ID_LOWER + ".coffee.extra.milk"); + return StringUtil.localize("container.nei."+ModUtil.MOD_ID_LOWER+".coffee.extra.milk"); } }); registerIngredient(new Ingredient(new ItemStack(Items.sugar), new PotionEffect[]{new PotionEffect(Potion.moveSpeed.getId(), 30, 0)}, 4)); @@ -199,19 +195,19 @@ public class ItemCoffee extends ItemFood implements INameableItem{ @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+"."+this.getName()+".desc.1")); - list.add(StatCollector.translateToLocalFormatted("tooltip."+ModUtil.MOD_ID_LOWER+"."+this.getName()+".desc.2", this.getMaxDamage()+1)); - list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".hunger.desc")+": "+this.func_150905_g(stack)); - list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".saturation.desc")+": "+this.func_150906_h(stack)); + list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+"."+this.getName()+".desc.1")); + list.add(StringUtil.localizeFormatted("tooltip."+ModUtil.MOD_ID_LOWER+"."+this.getName()+".desc.2", this.getMaxDamage()+1)); + list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".hunger.desc")+": "+this.func_150905_g(stack)); + list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".saturation.desc")+": "+this.func_150906_h(stack)); list.add(""); PotionEffect[] effects = getEffectsFromStack(stack); if(effects != null && effects.length > 0){ for(PotionEffect effect : effects){ - list.add(StatCollector.translateToLocal(effect.getEffectName())+" "+(effect.getAmplifier()+1)+ " (" + Potion.getDurationString(new PotionEffect(0, effect.getDuration()*20, 0)) + ")"); + list.add(StringUtil.localize(effect.getEffectName())+" "+(effect.getAmplifier()+1)+ " (" + Potion.getDurationString(new PotionEffect(0, effect.getDuration()*20, 0)) + ")"); } } - else list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".noEffects.desc")); + else list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".noEffects.desc")); } else list.add(ItemUtil.shiftForInfo()); } diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemDrillUpgrade.java b/src/main/java/ellpeck/actuallyadditions/items/ItemDrillUpgrade.java index e1d65b05e..b3b8a4f25 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemDrillUpgrade.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemDrillUpgrade.java @@ -2,17 +2,13 @@ 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 ellpeck.actuallyadditions.util.*; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; import net.minecraft.world.World; import java.util.List; @@ -87,11 +83,11 @@ public class ItemDrillUpgrade extends Item implements INameableItem{ public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){ ItemUtil.addInformation(this, list, this.type == UpgradeType.PLACER ? 3 : 1, ""); if(KeyUtil.isShiftPressed()){ - list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".itemDrillUpgrade.desc")); + list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".itemDrillUpgrade.desc")); if(this.type == UpgradeType.PLACER){ int slot = getSlotToPlaceFrom(stack); if(slot >= 0){ - list.add(StatCollector.translateToLocal("info."+ModUtil.MOD_ID_LOWER+".gui.slot")+": "+(slot+1)); + list.add(StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.slot")+": "+(slot+1)); } } } diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemFoods.java b/src/main/java/ellpeck/actuallyadditions/items/ItemFoods.java index 88ae0df37..100576f24 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemFoods.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemFoods.java @@ -3,17 +3,13 @@ package ellpeck.actuallyadditions.items; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.items.metalists.TheFoods; -import ellpeck.actuallyadditions.util.INameableItem; -import ellpeck.actuallyadditions.util.ItemUtil; -import ellpeck.actuallyadditions.util.KeyUtil; -import ellpeck.actuallyadditions.util.ModUtil; +import ellpeck.actuallyadditions.util.*; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.*; import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; import net.minecraft.world.World; import java.util.List; @@ -95,9 +91,9 @@ public class ItemFoods extends ItemFood implements INameableItem{ public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){ if(stack.getItemDamage() < allFoods.length){ if(KeyUtil.isShiftPressed()){ - list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+"."+this.getName()+allFoods[stack.getItemDamage()].getName()+".desc")); - list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".hunger.desc")+": "+allFoods[stack.getItemDamage()].healAmount); - list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".saturation.desc")+": "+allFoods[stack.getItemDamage()].saturation); + list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+"."+this.getName()+allFoods[stack.getItemDamage()].getName()+".desc")); + list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".hunger.desc")+": "+allFoods[stack.getItemDamage()].healAmount); + list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".saturation.desc")+": "+allFoods[stack.getItemDamage()].saturation); } else list.add(ItemUtil.shiftForInfo()); } diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemJams.java b/src/main/java/ellpeck/actuallyadditions/items/ItemJams.java index 3f3e416b5..0b786791f 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemJams.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemJams.java @@ -3,10 +3,7 @@ package ellpeck.actuallyadditions.items; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.items.metalists.TheJams; -import ellpeck.actuallyadditions.util.INameableItem; -import ellpeck.actuallyadditions.util.ItemUtil; -import ellpeck.actuallyadditions.util.KeyUtil; -import ellpeck.actuallyadditions.util.ModUtil; +import ellpeck.actuallyadditions.util.*; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.item.EntityItem; @@ -18,7 +15,6 @@ import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; import net.minecraft.potion.PotionEffect; import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; import net.minecraft.world.World; import java.util.List; @@ -100,12 +96,12 @@ public class ItemJams extends ItemFood implements INameableItem{ public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){ if(stack.getItemDamage() < allJams.length){ if(KeyUtil.isShiftPressed()){ - list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+"."+this.getName()+".desc.1")); - list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+"."+this.getName()+allJams[stack.getItemDamage()].getName()+".desc")); - list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+"."+this.getName()+".desc.2")); - list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+"."+this.getName()+".desc.3")); - list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".hunger.desc")+": "+allJams[stack.getItemDamage()].healAmount); - list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".saturation.desc")+": "+allJams[stack.getItemDamage()].saturation); + list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+"."+this.getName()+".desc.1")); + list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+"."+this.getName()+allJams[stack.getItemDamage()].getName()+".desc")); + list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+"."+this.getName()+".desc.2")); + list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+"."+this.getName()+".desc.3")); + list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".hunger.desc")+": "+allJams[stack.getItemDamage()].healAmount); + list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".saturation.desc")+": "+allJams[stack.getItemDamage()].saturation); } else list.add(ItemUtil.shiftForInfo()); } diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemKnife.java b/src/main/java/ellpeck/actuallyadditions/items/ItemKnife.java index 637071e9f..01af88604 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemKnife.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemKnife.java @@ -3,17 +3,13 @@ package ellpeck.actuallyadditions.items; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.config.values.ConfigIntValues; -import ellpeck.actuallyadditions.util.INameableItem; -import ellpeck.actuallyadditions.util.ItemUtil; -import ellpeck.actuallyadditions.util.KeyUtil; -import ellpeck.actuallyadditions.util.ModUtil; +import ellpeck.actuallyadditions.util.*; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; import java.util.List; @@ -48,8 +44,8 @@ public class ItemKnife extends Item implements INameableItem{ @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 + "." + this.getName() + ".desc")); - list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); + list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+"."+this.getName()+".desc")); + list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); } else list.add(ItemUtil.shiftForInfo()); diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemLeafBlower.java b/src/main/java/ellpeck/actuallyadditions/items/ItemLeafBlower.java index 9007ca470..8f14b7761 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemLeafBlower.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemLeafBlower.java @@ -16,7 +16,6 @@ import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; import net.minecraft.world.World; import java.util.ArrayList; @@ -112,9 +111,9 @@ public class ItemLeafBlower extends Item implements INameableItem{ @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 + "." + this.getName() + ".desc." + 1)); - list.add(StringUtil.ITALIC + StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".itemLeafBlower.desc.2")); - list.add(StringUtil.ITALIC + StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".itemLeafBlower.desc.3")); + list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+"."+this.getName()+".desc."+1)); + list.add(StringUtil.ITALIC + StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".itemLeafBlower.desc.2")); + list.add(StringUtil.ITALIC + StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".itemLeafBlower.desc.3")); } else list.add(ItemUtil.shiftForInfo()); } diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemPhantomConnector.java b/src/main/java/ellpeck/actuallyadditions/items/ItemPhantomConnector.java index 952a09241..948b174d2 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemPhantomConnector.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemPhantomConnector.java @@ -4,10 +4,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.tile.TileEntityPhantomPlacer; import ellpeck.actuallyadditions.tile.TileEntityPhantomface; -import ellpeck.actuallyadditions.util.INameableItem; -import ellpeck.actuallyadditions.util.ItemUtil; -import ellpeck.actuallyadditions.util.ModUtil; -import ellpeck.actuallyadditions.util.WorldPos; +import ellpeck.actuallyadditions.util.*; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; @@ -18,7 +15,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ChatComponentText; import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.DimensionManager; @@ -41,7 +37,7 @@ public class ItemPhantomConnector extends Item implements INameableItem{ if(this.checkHasConnection(stack, player, tile)){ ((TileEntityPhantomface)tile).boundPosition = this.getStoredPosition(stack); this.clearStorage(stack); - player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.connected.desc"))); + player.addChatComponentMessage(new ChatComponentText(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.connected.desc"))); return true; } return false; @@ -52,7 +48,7 @@ public class ItemPhantomConnector extends Item implements INameableItem{ ((TileEntityPhantomPlacer)tile).boundPosition = this.getStoredPosition(stack); tile.markDirty(); this.clearStorage(stack); - player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.connected.desc"))); + player.addChatComponentMessage(new ChatComponentText(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.connected.desc"))); return true; } return false; @@ -60,7 +56,7 @@ public class ItemPhantomConnector extends Item implements INameableItem{ } //Storing Connections this.storeConnection(stack, x, y, z, world); - player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".phantom.stored.desc"))); + player.addChatComponentMessage(new ChatComponentText(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.stored.desc"))); } return true; } @@ -76,7 +72,7 @@ public class ItemPhantomConnector extends Item implements INameableItem{ if(tile instanceof TileEntityPhantomface){ ((TileEntityPhantomface)tile).boundPosition = null; } - player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".phantom.unbound.desc"))); + player.addChatComponentMessage(new ChatComponentText(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.unbound.desc"))); return false; } } @@ -130,14 +126,14 @@ public class ItemPhantomConnector extends Item implements INameableItem{ if(coords != null){ World world = coords.getWorld(); if(world != null){ - list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.boundTo.desc")+":"); + list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.boundTo.desc")+":"); Item item = coords.getItemBlock(); String name = item == null ? "Absolutely Nothing" : item.getItemStackDisplayName(new ItemStack(coords.getBlock(), 1, coords.getMetadata())); list.add(name); list.add("X: "+coords.getX()); list.add("Y: "+coords.getY()); list.add("Z: "+coords.getZ()); - list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.inWorld.desc")+" "+world.provider.dimensionId); + list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.inWorld.desc")+" "+world.provider.dimensionId); } } } diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemPotionRing.java b/src/main/java/ellpeck/actuallyadditions/items/ItemPotionRing.java index 5dcdf07fb..2b8d8b2d1 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemPotionRing.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemPotionRing.java @@ -6,6 +6,7 @@ import ellpeck.actuallyadditions.items.metalists.ThePotionRings; import ellpeck.actuallyadditions.util.INameableItem; import ellpeck.actuallyadditions.util.ItemUtil; import ellpeck.actuallyadditions.util.ModUtil; +import ellpeck.actuallyadditions.util.StringUtil; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; @@ -15,7 +16,6 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.potion.PotionEffect; import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; import net.minecraft.world.World; import java.util.List; @@ -112,9 +112,9 @@ public class ItemPotionRing extends Item implements INameableItem{ @Override public String getItemStackDisplayName(ItemStack stack){ - String standardName = StatCollector.translateToLocal(this.getUnlocalizedName() + ".name"); + String standardName = StringUtil.localize(this.getUnlocalizedName()+".name"); if(stack.getItemDamage() < allRings.length){ - String effect = StatCollector.translateToLocal(allRings[stack.getItemDamage()].getName()); + String effect = StringUtil.localize(allRings[stack.getItemDamage()].getName()); return standardName+" "+effect; } return standardName; diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemResonantRice.java b/src/main/java/ellpeck/actuallyadditions/items/ItemResonantRice.java index 876e8d9f1..0e63ccd57 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemResonantRice.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemResonantRice.java @@ -9,7 +9,6 @@ import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.oredict.OreDictionary; @@ -36,7 +35,7 @@ public class ItemResonantRice extends Item implements INameableItem{ @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { ItemUtil.addInformation(this, list, 1, ""); - if(KeyUtil.isShiftPressed() && OreDictionary.getOres("nuggetEnderium", false).isEmpty()) list.add(StringUtil.RED + StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".itemResonantRice.uncraftable.desc")); + if(KeyUtil.isShiftPressed() && OreDictionary.getOres("nuggetEnderium", false).isEmpty()) list.add(StringUtil.RED + StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".itemResonantRice.uncraftable.desc")); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemAllToolAA.java b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemAllToolAA.java index a1792efe0..ba4b1deb3 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemAllToolAA.java +++ b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemAllToolAA.java @@ -4,10 +4,7 @@ import com.google.common.collect.Sets; import cpw.mods.fml.common.eventhandler.Event; 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 ellpeck.actuallyadditions.util.*; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -17,7 +14,6 @@ import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemTool; import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.UseHoeEvent; @@ -59,9 +55,9 @@ public class ItemAllToolAA extends ItemTool implements INameableItem{ @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+".paxel.desc.1")); - list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".paxel.desc.2")); - list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); + list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".paxel.desc.1")); + list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".paxel.desc.2")); + list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); } else list.add(ItemUtil.shiftForInfo()); } diff --git a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemAxeAA.java b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemAxeAA.java index 7e61a7f12..9e4c87114 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemAxeAA.java +++ b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemAxeAA.java @@ -2,17 +2,13 @@ package ellpeck.actuallyadditions.items.tools; 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 ellpeck.actuallyadditions.util.*; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemAxe; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; import net.minecraftforge.oredict.OreDictionary; import java.util.List; @@ -35,8 +31,8 @@ public class ItemAxeAA extends ItemAxe implements INameableItem{ @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 + "." + this.getName() + ".desc")); - list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); + list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+"."+this.getName()+".desc")); + list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); } else list.add(ItemUtil.shiftForInfo()); } diff --git a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemHoeAA.java b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemHoeAA.java index eb6dab928..eed4d61c0 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemHoeAA.java +++ b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemHoeAA.java @@ -2,17 +2,13 @@ package ellpeck.actuallyadditions.items.tools; 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 ellpeck.actuallyadditions.util.*; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemHoe; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; import net.minecraftforge.oredict.OreDictionary; import java.util.List; @@ -37,8 +33,8 @@ public class ItemHoeAA extends ItemHoe implements INameableItem{ @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 + "." + this.getName() + ".desc")); - list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); + list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+"."+this.getName()+".desc")); + list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); } else list.add(ItemUtil.shiftForInfo()); } diff --git a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemPickaxeAA.java b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemPickaxeAA.java index 6a0591875..57f83c410 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemPickaxeAA.java +++ b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemPickaxeAA.java @@ -2,17 +2,13 @@ package ellpeck.actuallyadditions.items.tools; 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 ellpeck.actuallyadditions.util.*; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemPickaxe; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; import net.minecraftforge.oredict.OreDictionary; import java.util.List; @@ -20,7 +16,6 @@ import java.util.List; public class ItemPickaxeAA extends ItemPickaxe implements INameableItem{ private String name; - private String oredictName; private EnumRarity rarity; private String repairItem; @@ -29,7 +24,6 @@ public class ItemPickaxeAA extends ItemPickaxe implements INameableItem{ this.name = unlocalizedName; this.rarity = rarity; this.repairItem = repairItem; - this.oredictName = name; } @Override @@ -37,8 +31,8 @@ public class ItemPickaxeAA extends ItemPickaxe implements INameableItem{ @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 + "." + this.getName() + ".desc")); - list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); + list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+"."+this.getName()+".desc")); + list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); } else list.add(ItemUtil.shiftForInfo()); } diff --git a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemShovelAA.java b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemShovelAA.java index fd514887a..f69fdf5c8 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemShovelAA.java +++ b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemShovelAA.java @@ -2,17 +2,13 @@ package ellpeck.actuallyadditions.items.tools; 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 ellpeck.actuallyadditions.util.*; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemSpade; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; import net.minecraftforge.oredict.OreDictionary; import java.util.List; @@ -37,8 +33,8 @@ public class ItemShovelAA extends ItemSpade implements INameableItem{ @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 + "." + this.getName() + ".desc")); - list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); + list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+"."+this.getName()+".desc")); + list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); } else list.add(ItemUtil.shiftForInfo()); } diff --git a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemSwordAA.java b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemSwordAA.java index 60527d275..7b1cf1595 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemSwordAA.java +++ b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemSwordAA.java @@ -2,17 +2,13 @@ package ellpeck.actuallyadditions.items.tools; 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 ellpeck.actuallyadditions.util.*; 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.item.ItemSword; import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; import net.minecraftforge.oredict.OreDictionary; import java.util.List; @@ -37,8 +33,8 @@ public class ItemSwordAA extends ItemSword implements INameableItem{ @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 + "." + this.getName() + ".desc")); - list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); + list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+"."+this.getName()+".desc")); + list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); } else list.add(ItemUtil.shiftForInfo()); } diff --git a/src/main/java/ellpeck/actuallyadditions/nei/CoffeeMachineRecipeHandler.java b/src/main/java/ellpeck/actuallyadditions/nei/CoffeeMachineRecipeHandler.java index ad864cc00..4ca899444 100644 --- a/src/main/java/ellpeck/actuallyadditions/nei/CoffeeMachineRecipeHandler.java +++ b/src/main/java/ellpeck/actuallyadditions/nei/CoffeeMachineRecipeHandler.java @@ -13,7 +13,6 @@ import ellpeck.actuallyadditions.util.ModUtil; import ellpeck.actuallyadditions.util.StringUtil; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; import org.lwjgl.opengl.GL11; import java.awt.*; @@ -87,7 +86,7 @@ public class CoffeeMachineRecipeHandler extends TemplateRecipeHandler{ @Override public String getRecipeName(){ - return StatCollector.translateToLocal("container.nei." + NAME + ".name"); + return StringUtil.localize("container.nei."+NAME+".name"); } @Override @@ -141,13 +140,13 @@ public class CoffeeMachineRecipeHandler extends TemplateRecipeHandler{ CachedCoffee cache = (CachedCoffee)this.arecipes.get(recipe); if(cache.extraText != null){ - GuiDraw.drawString(StatCollector.translateToLocal("container.nei." + ModUtil.MOD_ID_LOWER + ".coffee.special") + ":", 2, 4, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false); + GuiDraw.drawString(StringUtil.localize("container.nei."+ModUtil.MOD_ID_LOWER+".coffee.special") + ":", 2, 4, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false); GuiDraw.drawString(cache.extraText, 2, 16, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false); } - GuiDraw.drawString(StatCollector.translateToLocal("container.nei." + ModUtil.MOD_ID_LOWER + ".coffee.shift"), 1, 75, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false); + GuiDraw.drawString(StringUtil.localize("container.nei."+ModUtil.MOD_ID_LOWER+".coffee.shift"), 1, 75, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false); if(cache.maxAmp > 0){ - GuiDraw.drawString(StatCollector.translateToLocal("container.nei." + ModUtil.MOD_ID_LOWER + ".coffee.maxAmount") + ": " + cache.maxAmp, 2, 28, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false); + GuiDraw.drawString(StringUtil.localize("container.nei."+ModUtil.MOD_ID_LOWER+".coffee.maxAmount") + ": " + cache.maxAmp, 2, 28, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false); } } diff --git a/src/main/java/ellpeck/actuallyadditions/nei/CompostRecipeHandler.java b/src/main/java/ellpeck/actuallyadditions/nei/CompostRecipeHandler.java index 0a6634161..b91ecfe00 100644 --- a/src/main/java/ellpeck/actuallyadditions/nei/CompostRecipeHandler.java +++ b/src/main/java/ellpeck/actuallyadditions/nei/CompostRecipeHandler.java @@ -9,9 +9,9 @@ import ellpeck.actuallyadditions.config.values.ConfigIntValues; import ellpeck.actuallyadditions.items.InitItems; import ellpeck.actuallyadditions.items.metalists.TheMiscItems; import ellpeck.actuallyadditions.util.ModUtil; +import ellpeck.actuallyadditions.util.StringUtil; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; import org.lwjgl.opengl.GL11; import java.awt.*; @@ -60,7 +60,7 @@ public class CompostRecipeHandler extends TemplateRecipeHandler{ @Override public String getRecipeName(){ - return StatCollector.translateToLocal("container.nei." + NAME + ".name"); + return StringUtil.localize("container.nei."+NAME+".name"); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/nei/CrusherRecipeHandler.java b/src/main/java/ellpeck/actuallyadditions/nei/CrusherRecipeHandler.java index 00e0bc669..4aa1a2f97 100644 --- a/src/main/java/ellpeck/actuallyadditions/nei/CrusherRecipeHandler.java +++ b/src/main/java/ellpeck/actuallyadditions/nei/CrusherRecipeHandler.java @@ -11,7 +11,6 @@ import ellpeck.actuallyadditions.util.ModUtil; import ellpeck.actuallyadditions.util.StringUtil; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; import org.lwjgl.opengl.GL11; import java.awt.*; @@ -89,7 +88,7 @@ public class CrusherRecipeHandler extends TemplateRecipeHandler{ @Override public String getRecipeName(){ - return StatCollector.translateToLocal("container.nei."+this.getName()+".name"); + return StringUtil.localize("container.nei."+this.getName()+".name"); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/nei/HairyBallRecipeHandler.java b/src/main/java/ellpeck/actuallyadditions/nei/HairyBallRecipeHandler.java index 90ee8fba2..5ac4c731b 100644 --- a/src/main/java/ellpeck/actuallyadditions/nei/HairyBallRecipeHandler.java +++ b/src/main/java/ellpeck/actuallyadditions/nei/HairyBallRecipeHandler.java @@ -10,7 +10,6 @@ import ellpeck.actuallyadditions.util.ModUtil; import ellpeck.actuallyadditions.util.StringUtil; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; import org.lwjgl.opengl.GL11; import java.awt.*; @@ -61,7 +60,7 @@ public class HairyBallRecipeHandler extends TemplateRecipeHandler{ @Override public String getRecipeName(){ - return StatCollector.translateToLocal("container.nei." + NAME + ".name"); + return StringUtil.localize("container.nei."+NAME+".name"); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/nei/TreasureChestRecipeHandler.java b/src/main/java/ellpeck/actuallyadditions/nei/TreasureChestRecipeHandler.java index 5734b4239..00a388efb 100644 --- a/src/main/java/ellpeck/actuallyadditions/nei/TreasureChestRecipeHandler.java +++ b/src/main/java/ellpeck/actuallyadditions/nei/TreasureChestRecipeHandler.java @@ -10,7 +10,6 @@ import ellpeck.actuallyadditions.util.ModUtil; import ellpeck.actuallyadditions.util.StringUtil; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; import org.lwjgl.opengl.GL11; import java.awt.*; @@ -65,7 +64,7 @@ public class TreasureChestRecipeHandler extends TemplateRecipeHandler{ @Override public String getRecipeName(){ - return StatCollector.translateToLocal("container.nei." + NAME + ".name"); + return StringUtil.localize("container.nei."+NAME+".name"); } @Override @@ -120,7 +119,7 @@ public class TreasureChestRecipeHandler extends TemplateRecipeHandler{ public void drawExtras(int rec){ CachedTreasure recipe = (CachedTreasure)this.arecipes.get(rec); if(recipe.result != null){ - GuiDraw.drawString(recipe.minAmount+"-"+recipe.maxAmount+" "+StatCollector.translateToLocal("container.nei."+ModUtil.MOD_ID_LOWER+".treasureChest.info")+" "+recipe.chance+"%", 65+10, 45, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false); + GuiDraw.drawString(recipe.minAmount+"-"+recipe.maxAmount+" "+StringUtil.localize("container.nei."+ModUtil.MOD_ID_LOWER+".treasureChest.info")+" "+recipe.chance+"%", 65+10, 45, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false); } } diff --git a/src/main/java/ellpeck/actuallyadditions/update/UpdateChecker.java b/src/main/java/ellpeck/actuallyadditions/update/UpdateChecker.java index bbdeffa6e..bb68633c9 100644 --- a/src/main/java/ellpeck/actuallyadditions/update/UpdateChecker.java +++ b/src/main/java/ellpeck/actuallyadditions/update/UpdateChecker.java @@ -3,12 +3,12 @@ package ellpeck.actuallyadditions.update; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.TickEvent; import ellpeck.actuallyadditions.util.ModUtil; +import ellpeck.actuallyadditions.util.StringUtil; import ellpeck.actuallyadditions.util.Util; import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.ChatComponentText; import net.minecraft.util.IChatComponent; -import net.minecraft.util.StatCollector; public class UpdateChecker{ @@ -34,7 +34,7 @@ public class UpdateChecker{ if(Minecraft.getSystemTime() % 200 == 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"))); + player.addChatComponentMessage(IChatComponent.Serializer.func_150699_a(StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".update.failed.desc"))); } else{ if(updateVersion > clientVersion){ @@ -43,10 +43,10 @@ public class UpdateChecker{ String notice3 = "info."+ModUtil.MOD_ID_LOWER+".update.changelog.desc"; String notice4 = "info."+ModUtil.MOD_ID_LOWER+".update.download.desc"; player.addChatComponentMessage(new ChatComponentText("")); - player.addChatComponentMessage(IChatComponent.Serializer.func_150699_a(StatCollector.translateToLocal(notice1))); - player.addChatComponentMessage(IChatComponent.Serializer.func_150699_a(StatCollector.translateToLocalFormatted(notice2, ModUtil.VERSION, updateVersionS))); - player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocalFormatted(notice3, changelog))); - player.addChatComponentMessage(IChatComponent.Serializer.func_150699_a(StatCollector.translateToLocalFormatted(notice4, DOWNLOAD_LINK))); + player.addChatComponentMessage(IChatComponent.Serializer.func_150699_a(StringUtil.localize(notice1))); + player.addChatComponentMessage(IChatComponent.Serializer.func_150699_a(StringUtil.localizeFormatted(notice2, ModUtil.VERSION, updateVersionS))); + player.addChatComponentMessage(new ChatComponentText(StringUtil.localizeFormatted(notice3, changelog))); + player.addChatComponentMessage(IChatComponent.Serializer.func_150699_a(StringUtil.localizeFormatted(notice4, DOWNLOAD_LINK))); player.addChatComponentMessage(new ChatComponentText("")); } } diff --git a/src/main/java/ellpeck/actuallyadditions/util/AssetUtil.java b/src/main/java/ellpeck/actuallyadditions/util/AssetUtil.java index 4db32fb3f..821a386b8 100644 --- a/src/main/java/ellpeck/actuallyadditions/util/AssetUtil.java +++ b/src/main/java/ellpeck/actuallyadditions/util/AssetUtil.java @@ -2,7 +2,6 @@ package ellpeck.actuallyadditions.util; import net.minecraft.client.gui.FontRenderer; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; public class AssetUtil{ @@ -13,7 +12,7 @@ public class AssetUtil{ } public static void displayNameString(FontRenderer font, int xSize, int yPositionOfMachineText, String machineName){ - String localMachineName = StatCollector.translateToLocal(machineName + ".name"); + String localMachineName = StringUtil.localize(machineName+".name"); font.drawString(localMachineName, xSize/2 - font.getStringWidth(localMachineName)/2, yPositionOfMachineText, StringUtil.DECIMAL_COLOR_WHITE); } } diff --git a/src/main/java/ellpeck/actuallyadditions/util/BlockUtil.java b/src/main/java/ellpeck/actuallyadditions/util/BlockUtil.java index 7cad899e0..c6ead8861 100644 --- a/src/main/java/ellpeck/actuallyadditions/util/BlockUtil.java +++ b/src/main/java/ellpeck/actuallyadditions/util/BlockUtil.java @@ -4,7 +4,6 @@ import cpw.mods.fml.common.registry.GameRegistry; import ellpeck.actuallyadditions.creative.CreativeTab; import net.minecraft.block.Block; import net.minecraft.item.ItemBlock; -import net.minecraft.util.StatCollector; import java.util.ArrayList; import java.util.List; @@ -19,7 +18,7 @@ public class BlockUtil{ public static void addInformation(Block block, List list, int lines, String extraName){ if(KeyUtil.isShiftPressed()){ for(int i = 0; i < lines; i++){ - list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((INameableItem)block).getName() + extraName + ".desc" + (lines > 1 ? "." +(i+1) : ""))); + list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+"."+((INameableItem)block).getName()+extraName+".desc"+(lines > 1 ? "."+(i+1) : ""))); } } else list.add(ItemUtil.shiftForInfo()); @@ -28,14 +27,14 @@ public class BlockUtil{ @SuppressWarnings("unchecked") public static void addPowerUsageInfo(List list, int usage){ if(KeyUtil.isShiftPressed()){ - list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".uses.desc") + " " + usage + " RF/t"); + list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".uses.desc") + " " + usage + " RF/t"); } } @SuppressWarnings("unchecked") public static void addPowerProductionInfo(List list, int produce){ if(KeyUtil.isShiftPressed()){ - list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".produces.desc") + " " + produce + " RF/t"); + list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".produces.desc") + " " + produce + " RF/t"); } } diff --git a/src/main/java/ellpeck/actuallyadditions/util/ItemUtil.java b/src/main/java/ellpeck/actuallyadditions/util/ItemUtil.java index 3708e580a..998f8c77b 100644 --- a/src/main/java/ellpeck/actuallyadditions/util/ItemUtil.java +++ b/src/main/java/ellpeck/actuallyadditions/util/ItemUtil.java @@ -3,7 +3,6 @@ package ellpeck.actuallyadditions.util; import cpw.mods.fml.common.registry.GameRegistry; import ellpeck.actuallyadditions.creative.CreativeTab; import net.minecraft.item.Item; -import net.minecraft.util.StatCollector; import java.util.List; @@ -13,7 +12,7 @@ public class ItemUtil{ public static void addInformation(Item item, List list, int lines, String extraName){ if(KeyUtil.isShiftPressed()){ for(int i = 0; i < lines; i++){ - list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((INameableItem)item).getName() + extraName + ".desc" + (lines > 1 ? "." +(i+1) : ""))); + list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+"."+((INameableItem)item).getName()+extraName+".desc"+(lines > 1 ? "."+(i+1) : ""))); } } else list.add(shiftForInfo()); @@ -47,6 +46,6 @@ public class ItemUtil{ } public static String shiftForInfo(){ - return StringUtil.GREEN + StringUtil.ITALIC + StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".shiftForInfo.desc"); + return StringUtil.GREEN + StringUtil.ITALIC + StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".shiftForInfo.desc"); } } diff --git a/src/main/java/ellpeck/actuallyadditions/util/StringUtil.java b/src/main/java/ellpeck/actuallyadditions/util/StringUtil.java index f5326be85..e5e859a10 100644 --- a/src/main/java/ellpeck/actuallyadditions/util/StringUtil.java +++ b/src/main/java/ellpeck/actuallyadditions/util/StringUtil.java @@ -1,5 +1,7 @@ package ellpeck.actuallyadditions.util; +import net.minecraft.util.StatCollector; + public class StringUtil{ public static final String BLACK = (char)167 + "0"; @@ -27,4 +29,17 @@ public class StringUtil{ public static final int DECIMAL_COLOR_WHITE = 16777215; public static final int DECIMAL_COLOR_GRAY_TEXT = 4210752; + /** + * Localizes a given String via StatCollector + */ + public static String localize(String text){ + return StatCollector.translateToLocal(text); + } + + /** + * Localizes a given formatted String with the given Replacements + */ + public static String localizeFormatted(String text, Object ... replace){ + return StatCollector.translateToLocalFormatted(text, replace); + } }