From 3c03a2fabf130b6b008912d0e7267e6ac1b6dbf9 Mon Sep 17 00:00:00 2001 From: CammiePone Date: Mon, 18 Oct 2021 19:59:48 -0400 Subject: [PATCH] fixed a funni bug again --- gradle.properties | 2 +- .../core/network/client/DeleteHungerMessage.java | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/gradle.properties b/gradle.properties index f72830b..436740f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,7 +7,7 @@ yarn_mappings=1.17.1+build.43 loader_version=0.11.6 # Mod Properties -mod_version=1.4 +mod_version=1.5 maven_group=dev.cammiescorner archives_base_name=icarus diff --git a/src/main/java/dev/cammiescorner/icarus/core/network/client/DeleteHungerMessage.java b/src/main/java/dev/cammiescorner/icarus/core/network/client/DeleteHungerMessage.java index a0456d3..2ab0ca5 100644 --- a/src/main/java/dev/cammiescorner/icarus/core/network/client/DeleteHungerMessage.java +++ b/src/main/java/dev/cammiescorner/icarus/core/network/client/DeleteHungerMessage.java @@ -38,13 +38,14 @@ public static void handle(MinecraftServer server, ServerPlayerEntity player, Ser component.ifPresent(trinketComponent -> trinketComponent.getAllEquipped().forEach(pair -> { ItemStack stack = pair.getRight(); - WingItem wings = (WingItem) stack.getItem(); - if(!wings.isUsable(stack)) - wings.stopFlying(player); + if(stack.getItem() instanceof WingItem wings) { + if(!wings.isUsable(stack)) + wings.stopFlying(player); - if(stack.isIn(MELTS)) - stack.damage(1, player, p -> p.sendEquipmentBreakStatus(EquipmentSlot.CHEST)); + if(stack.isIn(MELTS)) + stack.damage(1, player, p -> p.sendEquipmentBreakStatus(EquipmentSlot.CHEST)); + } })); } });