Added localisation support for a few things. Closes #254

This commit is contained in:
Adubbz 2014-05-18 19:27:52 +10:00
parent bf9b5bf4f7
commit 57b0baafaa
4 changed files with 22 additions and 9 deletions

View File

@ -166,13 +166,12 @@ public class ItemBOPBucket extends ItemFluidContainer
public String getItemStackDisplayName(ItemStack itemStack)
{
FluidStack fluid = this.getFluid(itemStack);
String bucketLocalized = StatCollector.translateToLocal(Items.bucket.getUnlocalizedName() + ".name");
if (fluid != null && fluid.amount != 0)
{
return fluid.getFluid().getLocalizedName() + " " + bucketLocalized;
return StatCollector.translateToLocal(fluid.getFluid().getUnlocalizedName().replace("fluid.", "item.") + "Bucket" + ".name");
}
return bucketLocalized;
return Items.bucket.getUnlocalizedName() + ".name";
}
}

View File

@ -13,12 +13,14 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.util.StatCollector;
import net.minecraft.world.ChunkPosition;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.WorldChunkManager;
import biomesoplenty.BiomesOPlenty;
import biomesoplenty.common.network.packet.PacketBiomePosition;
import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -185,14 +187,14 @@ public class ItemBiomeFinder extends Item
if (biome != null)
{
infoList.add("" + EnumChatFormatting.BOLD + "Target: " + EnumChatFormatting.RESET + biome.biomeName);
infoList.add("" + EnumChatFormatting.BOLD + StatCollector.translateToLocal("biomeRadar.target") + " " + EnumChatFormatting.RESET + biome.biomeName);
if (itemStack.getTagCompound().hasKey("foundBiome"))
{
boolean foundBiome = itemStack.getTagCompound().getBoolean("foundBiome");
if (foundBiome) infoList.add("" + EnumChatFormatting.DARK_GREEN + EnumChatFormatting.ITALIC + "Found biome!");
else infoList.add("" + EnumChatFormatting.DARK_GRAY + EnumChatFormatting.ITALIC + "Right click to scan for biome");
if (foundBiome) infoList.add("" + EnumChatFormatting.DARK_GREEN + EnumChatFormatting.ITALIC + StatCollector.translateToLocal("biomeRadar.foundBiome"));
else infoList.add("" + EnumChatFormatting.DARK_GRAY + EnumChatFormatting.ITALIC + StatCollector.translateToLocal("biomeRadar.scanBiome"));
}
}
}

View File

@ -7,6 +7,8 @@ import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import biomesoplenty.BiomesOPlenty;
@ -48,9 +50,10 @@ public class ItemEnderporter extends Item
{
if (!player.worldObj.isRemote)
{
//TODO: addChatMessage()?
//TODO: BUG Whole text isn't purple
player.addChatComponentMessage(new ChatComponentText("\u00a75A mystical energy is preventing you from using this in the current world."));
ChatComponentText chatComponent = new ChatComponentText("\u00a75" + StatCollector.translateToLocal("enderporter.prevent"));
chatComponent.getChatStyle().setColor(EnumChatFormatting.DARK_PURPLE);
player.addChatMessage(chatComponent);
}
}

View File

@ -388,6 +388,9 @@ item.biomeBook.name=Book O' Biomes
item.biomeFinder.name=Biome Radar
item.biomeEssence.name=Biome Essence
item.poisonBucket.name=Poison Bucket
item.honeyBucket.name=Honey Bucket
tile.poison.name=Poison
tile.springWater.name=Spring Water
tile.honey.name=Honey
@ -396,6 +399,12 @@ fluid.poison=Poison
fluid.springWater=Spring Water
fluid.honey=Honey
biomeRadar.target=Target:
biomeRadar.foundBiome=Found Biome!
biomeRadar.scanBiome=Right click to scan for biome
enderporter.prevent=A mystical energy is preventing you from using this in the current world.
phrase.bop.useBOPATGWorldtype=The Biomes O' Plenty world type or ATG world type must be used in order for the new biomes to generate. This message will only display once.
phrase.bop.useBOPWorldtype=The Biomes O' Plenty world type must be used in order for the new biomes to generate. This message will only display once.
phrase.bop.updateAvaliable=You are not using the latest recommended version of Biomes O' Plenty. The latest recommended version is: v%s for Minecraft %s