diff --git a/src/main/java/com/github/alexthe666/iceandfire/entity/props/CapabilityHandler.java b/src/main/java/com/github/alexthe666/iceandfire/entity/props/CapabilityHandler.java index e71da0188..3bc192af7 100644 --- a/src/main/java/com/github/alexthe666/iceandfire/entity/props/CapabilityHandler.java +++ b/src/main/java/com/github/alexthe666/iceandfire/entity/props/CapabilityHandler.java @@ -8,6 +8,7 @@ import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.player.Player; import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.CapabilityManager; import net.minecraftforge.common.capabilities.CapabilityToken; @@ -91,6 +92,7 @@ public static void syncEntityData(final Entity entity) { } } + @OnlyIn(Dist.CLIENT) public static @Nullable Player getLocalPlayer() { if (FMLEnvironment.dist == Dist.CLIENT) { return Minecraft.getInstance().player; diff --git a/src/main/java/com/github/alexthe666/iceandfire/entity/props/EntityDataProvider.java b/src/main/java/com/github/alexthe666/iceandfire/entity/props/EntityDataProvider.java index acc6fe6b4..6201943f7 100644 --- a/src/main/java/com/github/alexthe666/iceandfire/entity/props/EntityDataProvider.java +++ b/src/main/java/com/github/alexthe666/iceandfire/entity/props/EntityDataProvider.java @@ -60,7 +60,6 @@ public static LazyOptional getCapability(final Entity entity) { public static void removeCachedEntry(final Entity entity) { if (entity instanceof LivingEntity) { int key = entity.getId(); - if (entity.getLevel().isClientSide()) { if (entity == CapabilityHandler.getLocalPlayer()) { // Can trigger on death or when player leaves the game (this is when we want to actually clear) diff --git a/src/main/java/com/github/alexthe666/iceandfire/pathfinding/raycoms/WorldEventContext.java b/src/main/java/com/github/alexthe666/iceandfire/pathfinding/raycoms/WorldEventContext.java index e08ffdcc5..7e9cb0715 100644 --- a/src/main/java/com/github/alexthe666/iceandfire/pathfinding/raycoms/WorldEventContext.java +++ b/src/main/java/com/github/alexthe666/iceandfire/pathfinding/raycoms/WorldEventContext.java @@ -8,6 +8,8 @@ import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.world.item.ItemStack; import net.minecraft.world.phys.Vec3; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.client.event.RenderLevelStageEvent; public class WorldEventContext { @@ -31,6 +33,7 @@ private WorldEventContext() */ int clientRenderDist; + @OnlyIn(Dist.CLIENT) public void renderWorldLastEvent(final RenderLevelStageEvent event) { bufferSource = WorldRenderMacros.getBufferSource();