mirror of
https://github.com/EarthMC/QuickShop-Reremake.git
synced 2026-11-24 17:39:52 -05:00
Suppressing all exceptions caused by InventoryCloseEvent
These are caused by bad implementations not related to QuickShop, but exceptions are annoying.
This commit is contained in:
1 parent
dd607b4244
commit
19e4b2b678
1 file changed
+19
-15
@@ -204,21 +204,25 @@ public class PlayerListener implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onInventoryClose(InventoryCloseEvent e) {
|
||||
final Inventory inventory = e.getInventory();
|
||||
if (inventory == null) {
|
||||
return;
|
||||
try {
|
||||
final Inventory inventory = e.getInventory();
|
||||
if (inventory == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
final Location location = inventory.getLocation();
|
||||
if (location == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
final Shop shop = plugin.getShopManager().getShop(location);
|
||||
if (shop == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
shop.setSignText();
|
||||
} catch (Throwable t) {
|
||||
|
||||
}
|
||||
|
||||
final Location location = inventory.getLocation();
|
||||
if (location == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
final Shop shop = plugin.getShopManager().getShop(location);
|
||||
if (shop == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
shop.setSignText();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user