Fix Build

This commit is contained in:
James Peters 2021-07-14 00:14:36 +01:00
parent ca7ed9519c
commit d7e07c042b
2 changed files with 7 additions and 3 deletions

View File

@ -186,6 +186,7 @@
<artifactSet>
<includes>
<include>fr.minuskube.inv*:*</include>
<include>com.github.MinusKube*:*</include>
<include>net.wesjd:anvilgui*</include>
<include>org.bstats*:*</include>
<include>com.jamesdpeters.minecraft.chests</include>

View File

@ -10,7 +10,11 @@ import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.*;
import org.bukkit.event.inventory.InventoryAction;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryCloseEvent;
import org.bukkit.event.inventory.InventoryDragEvent;
import org.bukkit.event.inventory.InventoryInteractEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
@ -26,8 +30,7 @@ public class InventoryListener implements Listener {
public void onInventoryClose(InventoryCloseEvent event) {
try {
InventoryHolder holder = event.getInventory().getHolder();
if (holder instanceof VirtualInventoryHolder) {
VirtualInventoryHolder vHolder = (VirtualInventoryHolder) holder;
if (holder instanceof VirtualInventoryHolder vHolder) {
vHolder.openPreviousInventory();
if (vHolder.didPlayerRemoteOpen(event.getPlayer().getUniqueId())) {
Utils.closeInventorySound((Player) event.getPlayer(), event.getInventory());