Update version to 1.1.1-SNAPSHOT and refactor to use HumanEntity instead of Player in InventoryGui
This commit is contained in:
parent
6f72215414
commit
813d76b992
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ val nexusUser = providers.gradleProperty("alttdSnapshotUsername").orNull ?: Syst
|
|||
val nexusPass = providers.gradleProperty("alttdSnapshotPassword").orNull ?: System.getenv("NEXUS_PASSWORD")
|
||||
|
||||
group = "com.alttd.inventory_gui"
|
||||
version = "1.1.0-SNAPSHOT"
|
||||
version = "1.1.1-SNAPSHOT"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user