From 5d4635e40c6fd285e0e38beb0581c2358bca05a9 Mon Sep 17 00:00:00 2001 From: Thutmose Date: Sun, 14 Feb 2021 20:26:10 -0500 Subject: [PATCH] Update PlayerPokemobCache.java fixes some client side issues on PCs --- .../pokecube/core/handlers/playerdata/PlayerPokemobCache.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/pokecube/core/handlers/playerdata/PlayerPokemobCache.java b/src/main/java/pokecube/core/handlers/playerdata/PlayerPokemobCache.java index 08a044a8c7..5d35383ba0 100644 --- a/src/main/java/pokecube/core/handlers/playerdata/PlayerPokemobCache.java +++ b/src/main/java/pokecube/core/handlers/playerdata/PlayerPokemobCache.java @@ -11,8 +11,10 @@ import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.ListNBT; import net.minecraft.server.MinecraftServer; +import net.minecraft.world.server.ServerWorld; import net.minecraftforge.fml.LogicalSide; import net.minecraftforge.fml.LogicalSidedProvider; +import pokecube.core.PokecubeCore; import pokecube.core.interfaces.IPokemob; import pokecube.core.items.pokecubes.PokecubeManager; import thut.core.common.handlers.PlayerDataHandler; @@ -33,6 +35,7 @@ public static void UpdateCache(final IPokemob mob) public static void UpdateCache(final ItemStack stack, final boolean pc, final boolean deleted) { + if (!(PokecubeCore.proxy.getWorld() instanceof ServerWorld)) return; final MinecraftServer server = LogicalSidedProvider.INSTANCE.get(LogicalSide.SERVER); server.execute(() -> PlayerPokemobCache.UpdateCacheImpl(stack, pc, deleted)); }