From d0f9612a0fc815382109d420dd49a16d528eaa2b Mon Sep 17 00:00:00 2001 From: Jasmine Karthikeyan <25208576+jaskarth@users.noreply.github.com> Date: Thu, 21 Nov 2024 20:12:01 -0500 Subject: [PATCH] Fix player cast --- .../com/lovetropics/extras/collectible/CollectibleStore.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/lovetropics/extras/collectible/CollectibleStore.java b/src/main/java/com/lovetropics/extras/collectible/CollectibleStore.java index 7c4b67d6..657b0ff6 100644 --- a/src/main/java/com/lovetropics/extras/collectible/CollectibleStore.java +++ b/src/main/java/com/lovetropics/extras/collectible/CollectibleStore.java @@ -57,7 +57,9 @@ public static void onPlayerClone(PlayerEvent.Clone event) { public static CollectibleStore get(Player player) { CollectibleStore data = player.getData(ExtraAttachments.COLLECTIBLE_STORE); - data.player = (ServerPlayer) player; + if (player instanceof ServerPlayer serverPlayer) { + data.player = serverPlayer; + } return data; }