mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-14 01:04:12 +00:00
Fixed crash when loading another player's ssp world with a multifarm
This commit is contained in:
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
|
||||
|
||||
Reference in new issue
Block a user