2.20.1 - Fixed right click issue with sell gui

This commit is contained in:
Kiran Hart 2021-07-15 15:47:49 -04:00
parent 42e7faf7b4
commit d4b3147fed
2 changed files with 3 additions and 1 deletions

View File

@ -6,7 +6,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>ca.tweetzy</groupId> <groupId>ca.tweetzy</groupId>
<artifactId>auctionhouse</artifactId> <artifactId>auctionhouse</artifactId>
<version>2.20.0</version> <version>2.20.1</version>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

View File

@ -54,6 +54,7 @@ public class GUISellItem extends Gui {
setDefaultItem(Settings.GUI_SELL_BG_ITEM.getMaterial().parseItem()); setDefaultItem(Settings.GUI_SELL_BG_ITEM.getMaterial().parseItem());
setUseLockedCells(true); setUseLockedCells(true);
setAcceptsItems(true); setAcceptsItems(true);
setAllowDrops(false);
setRows(5); setRows(5);
draw(); draw();
@ -89,6 +90,7 @@ public class GUISellItem extends Gui {
// the draw item that is being listed // the draw item that is being listed
setButton(1, 4, this.itemToBeListed, e -> { setButton(1, 4, this.itemToBeListed, e -> {
if (e.clickType == ClickType.RIGHT) e.event.setCancelled(true);
// Is the user selling with an item in hand? // Is the user selling with an item in hand?
if (AuctionHouse.getInstance().getAuctionPlayerManager().getSellHolding().containsKey(e.player.getUniqueId())) { if (AuctionHouse.getInstance().getAuctionPlayerManager().getSellHolding().containsKey(e.player.getUniqueId())) {
if (AuctionHouse.getInstance().getAuctionPlayerManager().getSellHolding().get(e.player.getUniqueId()).getType() != XMaterial.AIR.parseMaterial()) { if (AuctionHouse.getInstance().getAuctionPlayerManager().getSellHolding().get(e.player.getUniqueId()).getType() != XMaterial.AIR.parseMaterial()) {