diff --git a/src/main/java/com/cleanroommc/neverenoughanimations/animations/SwapHolder.java b/src/main/java/com/cleanroommc/neverenoughanimations/animations/SwapHolder.java index 5adffc0..966a854 100644 --- a/src/main/java/com/cleanroommc/neverenoughanimations/animations/SwapHolder.java +++ b/src/main/java/com/cleanroommc/neverenoughanimations/animations/SwapHolder.java @@ -41,6 +41,10 @@ public boolean init(Slot hoveredSlot, List slots, int hotbarIndex) { } public void performSwap() { + if (this.hotbarSlot == null || this.targetSlot == null || this.hotbarStack == null || this.targetStack == null) { + reset(); + return; + } IItemLocation hotbar = IItemLocation.of(this.hotbarSlot); IItemLocation hovering = IItemLocation.of(this.targetSlot); long time = Minecraft.getSystemTime(); diff --git a/src/main/java/com/cleanroommc/neverenoughanimations/core/mixin/ContainerMixin.java b/src/main/java/com/cleanroommc/neverenoughanimations/core/mixin/ContainerMixin.java index fcbb05f..42df2d3 100644 --- a/src/main/java/com/cleanroommc/neverenoughanimations/core/mixin/ContainerMixin.java +++ b/src/main/java/com/cleanroommc/neverenoughanimations/core/mixin/ContainerMixin.java @@ -71,6 +71,8 @@ public void slotClick(int slotId, int dragType, ClickType clickTypeIn, EntityPla if (candidates != null) ItemMoveAnimation.handleMove(slot5, oldStack, candidates); cir.setReturnValue(itemstack); } else if (clickTypeIn == ClickType.SWAP && dragType >= 0 && dragType < 9) { + // fuck creative inventory + if ((Object) this instanceof GuiContainerCreative.ContainerCreative) return; Slot targetSlot = this.inventorySlots.get(slotId); if (SwapHolder.INSTANCE.init(targetSlot, this.inventorySlots, dragType)) { swapHolder.set(SwapHolder.INSTANCE);