File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed
src/main/java/org/maxgamer/quickshop/shop Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -1527,9 +1527,9 @@ public void setCurrency(@Nullable String currency) {
15271527 @ Override
15281528 public void openPreview (@ NotNull Player player ) {
15291529 if (inventoryPreview == null ) {
1530- inventoryPreview = new InventoryPreview (plugin , getItem (), player );
1530+ inventoryPreview = new InventoryPreview (plugin , getItem (). clone () );
15311531 }
1532- inventoryPreview .show ();
1532+ inventoryPreview .show (player );
15331533 }
15341534
15351535 @ Override
Original file line number Diff line number Diff line change 4747public class InventoryPreview implements Listener {
4848
4949 private final ItemStack itemStack ;
50- private final Player player ;
5150 private final QuickShop plugin = QuickShop .getInstance ();
5251 @ Nullable
5352 private Inventory inventory ;
@@ -62,10 +61,9 @@ public class InventoryPreview implements Listener {
6261 * @param player Target player.
6362 * @param plugin The plugin instance.
6463 */
65- public InventoryPreview (@ NotNull QuickShop plugin , @ NotNull ItemStack itemStack , @ NotNull Player player ) {
64+ public InventoryPreview (@ NotNull QuickShop plugin , @ NotNull ItemStack itemStack ) {
6665 Util .ensureThread (false );
6766 this .itemStack = itemStack .clone ();
68- this .player = player ;
6967 ItemMeta itemMeta ;
7068 if (itemStack .hasItemMeta ()) {
7169 itemMeta = this .itemStack .getItemMeta ();
@@ -99,7 +97,7 @@ public static boolean isPreviewItem(@Nullable ItemStack stack) {
9997 /**
10098 * Open the preview GUI for player.
10199 */
102- public void show () {
100+ public void show (Player player ) {
103101 Util .ensureThread (false );
104102 if (itemStack == null || player == null || player .isSleeping ()) // Null pointer exception
105103 {
You can’t perform that action at this time.
0 commit comments