diff --git a/Fabric/src/main/java/dev/cammiescorner/icarus/fabric/entrypoints/Main.java b/Fabric/src/main/java/dev/cammiescorner/icarus/fabric/entrypoints/Main.java index 09e9411..a07c8f3 100644 --- a/Fabric/src/main/java/dev/cammiescorner/icarus/fabric/entrypoints/Main.java +++ b/Fabric/src/main/java/dev/cammiescorner/icarus/fabric/entrypoints/Main.java @@ -79,25 +79,7 @@ public void onInitialize() { return false; }; - EntityElytraEvents.CUSTOM.register((entity, tickElytra) -> { - var component = TrinketsApi.getTrinketComponent(entity); - if (component.isPresent()) { - var items = component.orElseThrow().getEquipped(stack -> stack.getItem() instanceof WingItem); - if (!items.isEmpty()) { - var slot = items.get(0); - var stack = slot.getB(); - var copy = stack.copy(); - if (!stack.isEmpty() && IcarusHelper.onFallFlyingTick(entity, stack, tickElytra)) { - if(!ItemStack.matches(stack, copy)) { - slot.getA().inventory().markUpdate(); - } - return true; - } - } - } - - return false; - }); + EntityElytraEvents.CUSTOM.register((entity, tickElytra) -> IcarusHelper.onFallFlyingTick(entity, IcarusHelper.getEquippedWings(entity), tickElytra)); ServerLifecycleEvents.SERVER_STARTING.register(Icarus::onServerStart); diff --git a/Quilt/src/main/java/dev/cammiescorner/icarus/quilt/entrypoints/Main.java b/Quilt/src/main/java/dev/cammiescorner/icarus/quilt/entrypoints/Main.java index a18996d..bc797df 100644 --- a/Quilt/src/main/java/dev/cammiescorner/icarus/quilt/entrypoints/Main.java +++ b/Quilt/src/main/java/dev/cammiescorner/icarus/quilt/entrypoints/Main.java @@ -82,25 +82,7 @@ public void onInitialize(ModContainer mod) { return false; }; - EntityElytraEvents.CUSTOM.register((entity, tickElytra) -> { - var component = TrinketsApi.getTrinketComponent(entity); - if (component.isPresent()) { - var items = component.orElseThrow().getEquipped(stack -> stack.getItem() instanceof WingItem); - if (!items.isEmpty()) { - var slot = items.get(0); - var stack = slot.getB(); - var copy = stack.copy(); - if (!stack.isEmpty() && IcarusHelper.onFallFlyingTick(entity, stack, tickElytra)) { - if (!ItemStack.matches(stack, copy)) { - slot.getA().inventory().markUpdate(); - } - return true; - } - } - } - - return false; - }); + EntityElytraEvents.CUSTOM.register((entity, tickElytra) -> IcarusHelper.onFallFlyingTick(entity, IcarusHelper.getEquippedWings(entity), tickElytra)); ServerEntityTickCallback.EVENT.register((entity, isPassengerTick) -> { if (!isPassengerTick && entity instanceof Player player) {