Fixed crash when loading another player's ssp world with a multifarm

This commit is contained in:
mezz committed 2014-09-19 01:29:28 -07:00
1 parent d9ab86f9f2
commit 063efce85f
1 file changed
+10 -1
@@ -25,6 +25,9 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
import net.minecraftforge.common.util.FakePlayerFactory;
import org.lwjgl.input.Keyboard;
@@ -94,7 +97,13 @@ public class ClientProxyCommon extends ProxyCommon {
@Override
public EntityPlayer getPlayer(World world, GameProfile profile) {
return world.getPlayerEntityByName(profile.getName());
EntityPlayer player = world.getPlayerEntityByName(profile.getName());
if (player != null)
return player;
else if (world instanceof WorldServer)
return FakePlayerFactory.get((WorldServer) world, profile);
else
return null;
}
@Override