From 063efce85f24b48efb040ac94cde1ec80df97e02 Mon Sep 17 00:00:00 2001 From: mezz Date: Fri, 19 Sep 2014 01:29:28 -0700 Subject: [PATCH] Fixed crash when loading another player's ssp world with a multifarm --- .../java/forestry/core/proxy/ClientProxyCommon.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/forestry/core/proxy/ClientProxyCommon.java b/src/main/java/forestry/core/proxy/ClientProxyCommon.java index f91e2179e..bab31f684 100755 --- a/src/main/java/forestry/core/proxy/ClientProxyCommon.java +++ b/src/main/java/forestry/core/proxy/ClientProxyCommon.java @@ -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