41 lines
1009 B
Java
41 lines
1009 B
Java
package it.ytnoos.lpx.adapter;
|
|
|
|
import it.ytnoos.lpx.api.adapter.InventoryViewAdapter;
|
|
|
|
import org.bukkit.entity.Player;
|
|
import org.bukkit.inventory.Inventory;
|
|
import org.bukkit.inventory.InventoryView;
|
|
|
|
public class LegacyInventoryViewAdapter implements InventoryViewAdapter {
|
|
|
|
private final InventoryView inventoryView;
|
|
|
|
public LegacyInventoryViewAdapter(Player player) {
|
|
this.inventoryView = player.getOpenInventory();
|
|
}
|
|
|
|
public boolean isNull() {
|
|
return this.inventoryView == null;
|
|
}
|
|
|
|
public String getType() {
|
|
return this.inventoryView.getType().name();
|
|
}
|
|
|
|
public Inventory getTopInventory() {
|
|
return this.inventoryView.getTopInventory();
|
|
}
|
|
|
|
public Inventory getBottomInventory() {
|
|
return this.inventoryView.getBottomInventory();
|
|
}
|
|
|
|
public int countSlots() {
|
|
return this.inventoryView.countSlots();
|
|
}
|
|
|
|
public int convertSlot(int value) {
|
|
return this.inventoryView.convertSlot(value);
|
|
}
|
|
}
|