From 9212d76779ae37af2e8f9b52cb8c61b7a595fae8 Mon Sep 17 00:00:00 2001 From: stefvanschie Date: Tue, 2 Feb 2021 20:01:39 +0100 Subject: [PATCH] Fix items sometimes failing to apply UUID correctly --- .../github/stefvanschie/inventoryframework/gui/GuiItem.java | 3 +-- .../stefvanschie/inventoryframework/pane/OutlinePane.java | 2 +- .../stefvanschie/inventoryframework/pane/StaticPane.java | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/IF/src/main/java/com/github/stefvanschie/inventoryframework/gui/GuiItem.java b/IF/src/main/java/com/github/stefvanschie/inventoryframework/gui/GuiItem.java index 7aebb9d2..fe09b0d6 100644 --- a/IF/src/main/java/com/github/stefvanschie/inventoryframework/gui/GuiItem.java +++ b/IF/src/main/java/com/github/stefvanschie/inventoryframework/gui/GuiItem.java @@ -69,11 +69,10 @@ public GuiItem(@NotNull ItemStack item, @Nullable Consumer this.action = action; this.visible = true; this.properties = new ArrayList<>(); + this.item = item; //remove this call after the removal of InventoryComponent#setItem(ItemStack, int, int) applyUUID(); - - this.item = item; } /** diff --git a/IF/src/main/java/com/github/stefvanschie/inventoryframework/pane/OutlinePane.java b/IF/src/main/java/com/github/stefvanschie/inventoryframework/pane/OutlinePane.java index 1587e276..fdda3e95 100644 --- a/IF/src/main/java/com/github/stefvanschie/inventoryframework/pane/OutlinePane.java +++ b/IF/src/main/java/com/github/stefvanschie/inventoryframework/pane/OutlinePane.java @@ -153,7 +153,7 @@ public void display(@NotNull InventoryComponent inventoryComponent, int paneOffs int finalRow = getY() + newY + paneOffsetY; int finalColumn = getX() + newX + paneOffsetX; - inventoryComponent.setItem(item.getItem(), finalColumn, finalRow); + inventoryComponent.setItem(item, finalColumn, finalRow); } int gapCount = gap; diff --git a/IF/src/main/java/com/github/stefvanschie/inventoryframework/pane/StaticPane.java b/IF/src/main/java/com/github/stefvanschie/inventoryframework/pane/StaticPane.java index a71df043..b77249f3 100644 --- a/IF/src/main/java/com/github/stefvanschie/inventoryframework/pane/StaticPane.java +++ b/IF/src/main/java/com/github/stefvanschie/inventoryframework/pane/StaticPane.java @@ -85,7 +85,7 @@ public void display(@NotNull InventoryComponent inventoryComponent, int paneOffs int finalRow = getY() + y + paneOffsetY; int finalColumn = getX() + x + paneOffsetX; - inventoryComponent.setItem(item.getItem(), finalColumn, finalRow); + inventoryComponent.setItem(item, finalColumn, finalRow); }); }