Prevent crash with broken server state (#37)

This commit is contained in:
miozune authored and GitHub committed 2022-12-12 22:24:13 +01:00
1 parent 2b27b551a3
commit 48bb35140c
1 file changed
+3 -2
@@ -96,11 +96,12 @@ public class SoulNetworkHandler {
}
public static int syphonFromNetwork(String ownerName, int damageToBeDone) {
if (MinecraftServer.getServer() == null) {
MinecraftServer mcServer = MinecraftServer.getServer();
if (mcServer == null || mcServer.worldServers.length == 0) {
return 0;
}
World world = MinecraftServer.getServer().worldServers[0];
World world = mcServer.worldServers[0];
LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName);
if (data == null) {