diff --git a/gradle.properties b/gradle.properties index 90df85d..d840622 100644 --- a/gradle.properties +++ b/gradle.properties @@ -53,7 +53,7 @@ mod_name=Zontreck Library Mod # The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default. mod_license=GPLv3 # The mod version. See https://semver.org/ -mod_version=1.9.122023.1612 +mod_version=1.9.122123.1608 # The group ID for the mod. It is only important when publishing as an artifact to a Maven repository. # This should match the base package used for the mod sources. # See https://maven.apache.org/guides/mini/guide-naming-conventions.html diff --git a/src/main/java/dev/zontreck/libzontreck/events/ForgeEventHandlers.java b/src/main/java/dev/zontreck/libzontreck/events/ForgeEventHandlers.java index b8eb1c5..4bf560e 100644 --- a/src/main/java/dev/zontreck/libzontreck/events/ForgeEventHandlers.java +++ b/src/main/java/dev/zontreck/libzontreck/events/ForgeEventHandlers.java @@ -5,11 +5,13 @@ import dev.zontreck.ariaslib.util.DelayedExecutorService; import dev.zontreck.libzontreck.LibZontreck; import dev.zontreck.libzontreck.currency.Account; import dev.zontreck.libzontreck.currency.Bank; +import dev.zontreck.libzontreck.exceptions.InvalidSideException; import dev.zontreck.libzontreck.memory.PlayerContainer; import dev.zontreck.libzontreck.networking.ModMessages; import dev.zontreck.libzontreck.networking.packets.S2CWalletInitialSyncPacket; import dev.zontreck.libzontreck.profiles.Profile; import dev.zontreck.libzontreck.profiles.UserProfileNotYetExistsException; +import dev.zontreck.libzontreck.util.ServerUtilities; import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerPlayer; import net.minecraftforge.common.MinecraftForge; @@ -65,12 +67,22 @@ public class ForgeEventHandlers { { if(ev.getEntity().level().isClientSide)return; // Get player profile, send disconnect alert, then commit profile and remove it from memory - Profile px=null; + try { - px = Profile.get_profile_of(ev.getEntity().getStringUUID()); - } catch (UserProfileNotYetExistsException e) { - e.printStackTrace(); + if(ServerUtilities.playerIsOffline(ev.getEntity().getUUID())) + { + + Profile px=null; + try { + px = Profile.get_profile_of(ev.getEntity().getStringUUID()); + } catch (UserProfileNotYetExistsException e) { + e.printStackTrace(); + } + Profile.unload(px); + } + } catch (InvalidSideException e) { + throw new RuntimeException(e); } - Profile.unload(px); + } }