use of com.bgsoftware.wildchests.api.objects.data.ChestData in project WildChests by BG-Software-LLC.
the class WRegularChest method setPage.
@Override
public Inventory setPage(int page, int size, String title) {
ChestData chestData = getData();
checkCapacity(page + 1, chestData.getDefaultSize(), chestData.getDefaultTitle());
CraftWildInventory inventory = plugin.getNMSInventory().createInventory(this, size, title, page);
inventories.set(page, inventory);
updateTitles();
return inventory;
}
use of com.bgsoftware.wildchests.api.objects.data.ChestData in project WildChests by BG-Software-LLC.
the class ChestsHandler method loadChest.
public WChest loadChest(UUID placer, Location location, ChestData chestData) {
WChest chest;
switch(chestData.getChestType()) {
case CHEST:
chest = new WRegularChest(placer, location, chestData);
break;
case LINKED_CHEST:
chest = new WLinkedChest(placer, location, chestData);
break;
case STORAGE_UNIT:
chest = new WStorageChest(placer, location, chestData);
break;
default:
throw new IllegalArgumentException("Invalid chest at " + location);
}
chests.put(location, chest);
chestsByChunks.computeIfAbsent(ChunkPosition.of(location), s -> Sets.newConcurrentHashSet()).add(chest);
return chest;
}
Aggregations