From feba194bc4896181621724d9e8802d4dbe418311 Mon Sep 17 00:00:00 2001 From: LazyGon Date: Fri, 20 Aug 2021 23:50:15 +0900 Subject: [PATCH 1/4] Change event priority since it conflicts with stackableitems. --- src/main/java/net/okocraft/box/listeners/PlayerListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/okocraft/box/listeners/PlayerListener.java b/src/main/java/net/okocraft/box/listeners/PlayerListener.java index 521d667728..ab8ee90d2d 100644 --- a/src/main/java/net/okocraft/box/listeners/PlayerListener.java +++ b/src/main/java/net/okocraft/box/listeners/PlayerListener.java @@ -133,7 +133,7 @@ public void onJoin(PlayerJoinEvent event) { * * @param event EntityPickupItemEvent */ - @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) + @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) public void autoStoreDroppedItem(EntityPickupItemEvent event) { if (!config.isAutoStoreEnabled()) { return; From 982060f93b31b0f31a0fc096c3b065c0ffc8910c Mon Sep 17 00:00:00 2001 From: LazyGon Date: Sun, 22 Aug 2021 04:45:50 +0900 Subject: [PATCH 2/4] Changed to give stick in offhand --- .../net/okocraft/box/command/box/StickCommand.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/okocraft/box/command/box/StickCommand.java b/src/main/java/net/okocraft/box/command/box/StickCommand.java index 0951f4914a..85728ddbfc 100644 --- a/src/main/java/net/okocraft/box/command/box/StickCommand.java +++ b/src/main/java/net/okocraft/box/command/box/StickCommand.java @@ -20,6 +20,7 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; +import org.bukkit.inventory.PlayerInventory; import net.okocraft.box.command.BaseCommand; @@ -43,6 +44,15 @@ public boolean runCommand(CommandSender sender, String[] args) { return false; } - return ((Player) sender).getInventory().addItem(config.getStick()).isEmpty(); + Player player = (Player) sender; + PlayerInventory inv = player.getInventory(); + int firstEmpty = inv.firstEmpty(); + if (firstEmpty == -1) { + messages.sendInventoryIsFull(sender); + return true; + } + inv.setItem(firstEmpty, inv.getItemInOffHand()); + inv.setItemInOffHand(config.getStick()); + return true; } } \ No newline at end of file From eb11836b4e56c8ec42856dbb3a3f446f8977c9f8 Mon Sep 17 00:00:00 2001 From: LazyGon Date: Sun, 19 Sep 2021 21:20:49 +0900 Subject: [PATCH 3/4] [Fix] commented out updateItems method that increases many invalid entries on db --- src/main/java/net/okocraft/box/database/ItemTable.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/okocraft/box/database/ItemTable.java b/src/main/java/net/okocraft/box/database/ItemTable.java index ec9572af56..750177c810 100644 --- a/src/main/java/net/okocraft/box/database/ItemTable.java +++ b/src/main/java/net/okocraft/box/database/ItemTable.java @@ -58,7 +58,7 @@ final class ItemTable { this.database = database; database.execute("CREATE TABLE IF NOT EXISTS " + TABLE + " (id INTEGER PRIMARY KEY " + (database.isSQLite() ? "AUTOINCREMENT" : "AUTO_INCREMENT") + ", item VARCHAR(4096) NOT NULL, customname VARCHAR(255) UNIQUE)"); loadItems(); - updateItems(); + // updateItems(); addDefaultItems(); } From 03409e04d6fcbb0fb128849c4b262881bcf25632 Mon Sep 17 00:00:00 2001 From: LazyGon Date: Sun, 19 Sep 2021 21:22:20 +0900 Subject: [PATCH 4/4] [Update] update pom The last version from LazyGon Next update will be provided by Siroshun09 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 92c38b8957..871fec16a4 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ net.okocraft.box Box - 3.1.5-SNAPSHOT + 3.1.6 Box https://github.com/okocraft/Box