Add shops support.

This commit is contained in:
Major-
2015-08-29 22:40:08 +01:00
parent cdffc15dfc
commit f7661a7fc8
6 changed files with 403 additions and 3 deletions
@@ -25,7 +25,7 @@ public final class ItemVerificationHandler extends MessageHandler<InventoryItemM
* @author Major
*/
@FunctionalInterface
public static interface InventorySupplier {
public interface InventorySupplier {
/**
* Gets the appropriate {@link Inventory}.
@@ -33,7 +33,7 @@ public final class ItemVerificationHandler extends MessageHandler<InventoryItemM
* @param player The {@link Player} who prompted the verification call.
* @return The inventory. Must not be {@code null}.
*/
public Inventory getInventory(Player player);
Inventory getInventory(Player player);
}
@@ -80,7 +80,7 @@ public final class ItemVerificationHandler extends MessageHandler<InventoryItemM
Inventory inventory = supplier.getInventory(player);
int slot = message.getSlot();
if (slot < 0 || slot >= inventory.capacity()) {
if (inventory == null || slot < 0 || slot >= inventory.capacity()) {
message.terminate();
return;
}