Fixed an issue with obtaining biome names on servers when using tpbiome

This commit is contained in:
Adubbz 2018-02-12 11:28:48 +11:00 committed by GitHub
parent 0e6e960e50
commit c3a4237b83
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -125,20 +125,20 @@ public class BOPCommand extends CommandBase
EntityPlayerMP player = getCommandSenderAsPlayer(sender);
World world = player.world;
BlockPos closestBiomePos = biomeToFind == null ? null : BiomeUtils.spiralOutwardsLookingForBiome(world, biomeToFind, player.posX, player.posZ);
String biomeName = biomeToFind != null && FMLCommonHandler.instance().getSide() == Side.CLIENT ? biomeToFind.getBiomeName() : "Undefined";
if (closestBiomePos != null)
{
double x = (double)closestBiomePos.getX();
double y = (double)world.getTopSolidOrLiquidBlock(closestBiomePos).getY();
double z = (double)closestBiomePos.getZ();
String biomeName = FMLCommonHandler.instance().getSide() == Side.CLIENT ? biomeToFind.getBiomeName() : "";
player.connection.setPlayerLocation(x, y, z, player.rotationYaw, player.rotationPitch);
sender.sendMessage(new TextComponentTranslation("commands.biomesoplenty.tpbiome.success", player.getName(), biomeName, x, y, z));
}
else
{
sender.sendMessage(new TextComponentTranslation("commands.biomesoplenty.tpbiome.error", biomeToFind == null ? "Undefined" : biomeToFind.getBiomeName()));
sender.sendMessage(new TextComponentTranslation("commands.biomesoplenty.tpbiome.error", biomeName));
}
}