From 8b67b8c19645361dd634579daf3ae742f8049583 Mon Sep 17 00:00:00 2001 From: Girafi Date: Fri, 26 Aug 2016 17:45:58 +0200 Subject: [PATCH] Fixed biome finder on servers (#851) --- .../biomesoplenty/common/item/ItemBiomeFinder.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/java/biomesoplenty/common/item/ItemBiomeFinder.java b/src/main/java/biomesoplenty/common/item/ItemBiomeFinder.java index 54f0b251d..2214960ed 100644 --- a/src/main/java/biomesoplenty/common/item/ItemBiomeFinder.java +++ b/src/main/java/biomesoplenty/common/item/ItemBiomeFinder.java @@ -8,10 +8,7 @@ package biomesoplenty.common.item; -import java.util.List; - import biomesoplenty.common.util.biome.BiomeUtils; -import net.minecraft.client.resources.I18n; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.IItemPropertyGetter; @@ -25,11 +22,14 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.BlockPos; import net.minecraft.util.text.TextComponentTranslation; import net.minecraft.util.text.TextFormatting; +import net.minecraft.util.text.translation.I18n; import net.minecraft.world.World; import net.minecraft.world.biome.Biome; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import java.util.List; + public class ItemBiomeFinder extends Item { @@ -125,7 +125,7 @@ public class ItemBiomeFinder extends Item else { // server notifies player that search is starting - sendChatMessage(player, I18n.format("biome_finder.searching",biomeToFind.getBiomeName()), TextFormatting.DARK_PURPLE); + sendChatMessage(player, I18n.translateToLocalFormatted("biome_finder.searching",biomeToFind.getBiomeName()), TextFormatting.DARK_PURPLE); // search for biomeToFind, maximum distance 5000 blocks BlockPos pos = BiomeUtils.spiralOutwardsLookingForBiome(world, biomeToFind, player.posX, player.posZ); @@ -133,14 +133,14 @@ public class ItemBiomeFinder extends Item if (pos == null) { // server notifies player that search was unsuccessful - sendChatMessage(player, I18n.format("biome_finder.not_found",biomeToFind.getBiomeName()), TextFormatting.RED); + sendChatMessage(player, I18n.translateToLocalFormatted("biome_finder.not_found",biomeToFind.getBiomeName()), TextFormatting.RED); // write not found tag writeNBTNotFound(nbt); } else { // server notifies player that search was successful - sendChatMessage(player, I18n.format("biome_finder.found",biomeToFind.getBiomeName()), TextFormatting.GREEN); + sendChatMessage(player, I18n.translateToLocalFormatted("biome_finder.found",biomeToFind.getBiomeName()), TextFormatting.GREEN); // write found tag writeNBTFound(nbt, pos); } @@ -183,6 +183,7 @@ public class ItemBiomeFinder extends Item } @Override + @SideOnly(Side.CLIENT) public void addInformation(ItemStack itemStack, EntityPlayer player, List infoList, boolean advancedItemTooltips) { if (!itemStack.hasTagCompound()) {return;}