Files
OpenLPX/src/main/java/it/ytnoos/lpx/adapter/LegacyInventoryViewAdapter.java
T
2026-11-01 21:26:40 -05:00

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);
}
}