use of com.plotsquared.bukkit.player.BukkitPlayer in project PlotSquared by IntellectualSites.
the class BukkitInventoryUtil method open.
// Paper deprecation
@SuppressWarnings("deprecation")
@Override
public void open(PlotInventory inv) {
BukkitPlayer bp = (BukkitPlayer) inv.getPlayer();
Inventory inventory = Bukkit.createInventory(null, inv.getLines() * 9, ChatColor.translateAlternateColorCodes('&', inv.getTitle()));
PlotItemStack[] items = inv.getItems();
for (int i = 0; i < inv.getLines() * 9; i++) {
PlotItemStack item = items[i];
if (item != null) {
inventory.setItem(i, getItem(item));
}
}
bp.player.openInventory(inventory);
}
Aggregations