Skip to content

Commit

Permalink
dont animate swap in crative inventory
Browse files Browse the repository at this point in the history
  • Loading branch information
brachy84 committed Jul 15, 2024
1 parent 4f45add commit 77d39bd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ public boolean init(Slot hoveredSlot, List<Slot> 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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 77d39bd

Please sign in to comment.