Merge pull request #2117 from lumien231/master

Fixes Client Login Issue when logging into a non existent dimension
This commit is contained in:
LexManos 2015-11-14 04:20:34 -08:00
commit 41e971ecc9

View file

@ -34,6 +34,7 @@ import net.minecraft.network.play.server.S3FPacketCustomPayload;
import net.minecraft.network.play.server.S40PacketDisconnect;
import net.minecraft.server.management.ServerConfigurationManager;
import net.minecraft.util.ChatComponentText;
import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.FMLLog;
import net.minecraftforge.fml.common.network.FMLNetworkEvent;
@ -199,12 +200,13 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler<Packet> imple
NBTTagCompound playerNBT = scm.getPlayerNBT(player);
if (playerNBT!=null)
{
return playerNBT.getInteger("Dimension");
}
else
{
return 0;
int dimension = playerNBT.getInteger("Dimension");
if (DimensionManager.isDimensionRegistered(dimension))
{
return dimension;
}
}
return 0;
}
void clientListenForServerHandshake()