Fixed the Lava Crystal crash

Maybe not the most elegant method? But it works.
This commit is contained in:
WayofTime 2020-11-21 10:24:35 -05:00
parent 295488f144
commit 9b79acaad6
5 changed files with 33 additions and 26 deletions

View file

@ -9,13 +9,13 @@ import net.minecraft.item.ItemStack;
import net.minecraft.world.storage.DimensionSavedDataManager;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.server.ServerLifecycleHooks;
import wayoftime.bloodmagic.api.item.IBindable;
import wayoftime.bloodmagic.core.data.BMWorldSavedData;
import wayoftime.bloodmagic.core.data.Binding;
import wayoftime.bloodmagic.core.data.SoulNetwork;
import wayoftime.bloodmagic.core.data.SoulTicket;
import wayoftime.bloodmagic.core.registry.OrbRegistry;
import wayoftime.bloodmagic.event.SoulNetworkEvent;
import wayoftime.bloodmagic.api.item.IBindable;
import wayoftime.bloodmagic.orb.BloodOrb;
import wayoftime.bloodmagic.orb.IBloodOrb;
@ -161,6 +161,9 @@ public class NetworkHelper
return false;
SoulNetwork network = getSoulNetwork(binding);
if (network == null)
return false;
return network.getCurrentEssence() >= toSyphon;
}

View file

@ -22,13 +22,11 @@ public class PlayerHelper
public static PlayerEntity getPlayerFromId(UUID uuid)
{
// TODO: Need to find a reliable way to get whether the side is Client or Server
// if (FMLCommonHandler.instance().)
// return null;
//
// World w;
// Dist d;
//
// if(ServerLifecycleHooks.getCurrentServer().get)
if (ServerLifecycleHooks.getCurrentServer() == null)
{
return null;
}
return ServerLifecycleHooks.getCurrentServer().getPlayerList().getPlayerByUUID(uuid);
@ -58,7 +56,6 @@ public class PlayerHelper
*/
public static boolean isFakePlayer(PlayerEntity player)
{
return player instanceof FakePlayer
|| (player != null && knownFakePlayers.contains(player.getClass().getCanonicalName()));
return player instanceof FakePlayer || (player != null && knownFakePlayers.contains(player.getClass().getCanonicalName()));
}
}