Update version to 1.1.1-SNAPSHOT and refactor to use HumanEntity instead of Player in InventoryGui
This commit is contained in:
@@ -8,6 +8,7 @@ import lombok.Getter;
|
||||
import lombok.NonNull;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.HumanEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
@@ -57,11 +58,11 @@ public class InventoryGui {
|
||||
|
||||
/**
|
||||
* Creates a new inventory for the specified player.
|
||||
* @param player the player for whom to create the inventory
|
||||
* @param humanEntity the player for whom to create the inventory
|
||||
* @return a new inventory instance
|
||||
*/
|
||||
public Inventory createInventory(Player player) {
|
||||
return Bukkit.createInventory(player, rows * 9, title);
|
||||
public Inventory createInventory(HumanEntity humanEntity) {
|
||||
return Bukkit.createInventory(humanEntity, rows * 9, title);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -74,16 +75,16 @@ public class InventoryGui {
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens the GUI for the specified player.
|
||||
* @param player the player for whom to open the GUI
|
||||
* Opens the GUI for the specified human entity.
|
||||
* @param humanEntity the human entity for whom to open the GUI
|
||||
*/
|
||||
public void open(Player player) {
|
||||
public void open(HumanEntity humanEntity) {
|
||||
InventoryGuiLib.ensureInit(plugin);
|
||||
|
||||
Inventory inv = createInventory(player);
|
||||
Inventory inv = createInventory(humanEntity);
|
||||
render(inv);
|
||||
GuiSession.bind(player.getUniqueId(), plugin.getName(), this, inv);
|
||||
player.openInventory(inv);
|
||||
GuiSession.bind(humanEntity.getUniqueId(), plugin.getName(), this, inv);
|
||||
humanEntity.openInventory(inv);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user