diff --git a/src/main/java/carpet/patches/EntityPlayerMPFake.java b/src/main/java/carpet/patches/EntityPlayerMPFake.java index 3f7afd4662..b0cf86f3cd 100644 --- a/src/main/java/carpet/patches/EntityPlayerMPFake.java +++ b/src/main/java/carpet/patches/EntityPlayerMPFake.java @@ -18,6 +18,7 @@ import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.network.ServerPlayerInteractionManager; import net.minecraft.server.world.ServerWorld; +import net.minecraft.util.UserCache; import net.minecraft.util.registry.RegistryKey; import net.minecraft.world.GameMode; import net.minecraft.world.World; @@ -36,11 +37,15 @@ public static EntityPlayerMPFake createFake(String username, MinecraftServer ser //prolly half of that crap is not necessary, but it works ServerWorld worldIn = server.getWorld(dimensionId); ServerPlayerInteractionManager interactionManagerIn = new ServerPlayerInteractionManager(worldIn); - GameProfile gameprofile = server.getUserCache().findByName(username); - if (gameprofile == null) - { - return null; + UserCache.setUseRemote(false); + GameProfile gameprofile; + try { + gameprofile = server.getUserCache().findByName(username); + } + finally { + UserCache.setUseRemote(server.isDedicated() && server.isOnlineMode()); } + if (gameprofile == null) return null; if (gameprofile.getProperties().containsKey("textures")) { gameprofile = SkullBlockEntity.loadProperties(gameprofile);