Skip to content

Commit

Permalink
fix startup crash on servers
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexModGuy committed Feb 20, 2024
1 parent 5233102 commit 00b9172
Showing 1 changed file with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package com.github.alexthe666.iceandfire.entity.props;

import com.github.alexthe666.iceandfire.IceAndFire;
import net.minecraft.client.Minecraft;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.CapabilityManager;
import net.minecraftforge.common.capabilities.CapabilityToken;
Expand All @@ -18,7 +16,6 @@
import net.minecraftforge.event.entity.player.PlayerEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.loading.FMLEnvironment;
import net.minecraftforge.network.PacketDistributor;
import org.jetbrains.annotations.Nullable;

Expand Down Expand Up @@ -92,10 +89,6 @@ public static void syncEntityData(final Entity entity) {
}

public static @Nullable Player getLocalPlayer() {
if (FMLEnvironment.dist == Dist.CLIENT) {
return Minecraft.getInstance().player;
}

return null;
return IceAndFire.PROXY.getClientSidePlayer();
}
}

0 comments on commit 00b9172

Please sign in to comment.