From 257b82dff6097dc93e47e1f9a7547ae09b2f7aa9 Mon Sep 17 00:00:00 2001 From: Adubbz Date: Sun, 20 Oct 2013 19:07:34 +1100 Subject: [PATCH] Nag messages can now be translated. Closes #101 --- .../biomesoplenty/handlers/TickHandlerClient.java | 13 +++++++++++-- resources/assets/biomesoplenty/lang/en_US.lang | 3 +++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/common/biomesoplenty/handlers/TickHandlerClient.java b/common/biomesoplenty/handlers/TickHandlerClient.java index 16994ab3f..b0e4148ce 100644 --- a/common/biomesoplenty/handlers/TickHandlerClient.java +++ b/common/biomesoplenty/handlers/TickHandlerClient.java @@ -3,10 +3,13 @@ package biomesoplenty.handlers; import java.util.EnumSet; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ChatMessageComponent; +import net.minecraft.util.EnumChatFormatting; import biomesoplenty.helpers.Version; import cpw.mods.fml.common.ITickHandler; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.TickType; +import cpw.mods.fml.common.registry.LanguageRegistry; public class TickHandlerClient implements ITickHandler { @@ -27,12 +30,18 @@ public class TickHandlerClient implements ITickHandler if (Version.needsBOPWorldtypeAndMarkAsSeen(player.worldObj)) { - player.addChatMessage(String.format("\u00A7cThe Biomes O Plenty world type must be used in order for the new biomes to generate. This message will only display once.")); + ChatMessageComponent updateMessage = new ChatMessageComponent(); + updateMessage.setColor(EnumChatFormatting.RED); + updateMessage.addKey("phrase.bop.useBOPWorldtype"); + player.sendChatToPlayer(updateMessage); } if (Version.needsUpdateNoticeAndMarkAsSeen()) { - player.addChatMessage(String.format("\u00A7cA new version of Biomes O Plenty is available: v%s for Minecraft %s", Version.getRecommendedVersion(), Loader.instance().getMinecraftModContainer().getVersion())); + ChatMessageComponent updateMessage = new ChatMessageComponent(); + updateMessage.setColor(EnumChatFormatting.RED); + updateMessage.addFormatted("phrase.bop.updateAvaliable", Version.getRecommendedVersion(), Loader.instance().getMinecraftModContainer().getVersion()); + player.sendChatToPlayer(updateMessage); } nagged = true; diff --git a/resources/assets/biomesoplenty/lang/en_US.lang b/resources/assets/biomesoplenty/lang/en_US.lang index e92834b5b..ad7bf1b2a 100644 --- a/resources/assets/biomesoplenty/lang/en_US.lang +++ b/resources/assets/biomesoplenty/lang/en_US.lang @@ -379,6 +379,9 @@ fluid.bop.springWater=Spring Water phrase.bop.promisedPortalOverworld=A gateway to the Promised Land has appeared in the sky above. phrase.bop.promisedPortalOther=A gateway to the Overworld has appeared in the sky above. +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=A new version of Biomes O Plenty is available: v%s for Minecraft %s + entity.BiomesOPlenty.Glob.name=Glob entity.BiomesOPlenty.JungleSpider.name=Jungle Spider entity.BiomesOPlenty.Phantom.name=Phantom