Minepacks

Minepacks

2M Downloads

Backpack size recovery

GuillaumeASSIER opened this issue ยท 4 comments

commented

Help request

Problem
We update our server to the latest version of minecraft (1.15.2) from version 1.1.3.2. In version 1.13.2 we give players the ability to process 81 items in backpacks, but with version 1.15.2 we can't open our backpacks. This error appears in the console :

[11:38:08 WARN]: [Minepacks] Plugin Minepacks v2.1.3 generated an exception while executing task 600171
java.lang.IllegalArgumentException: Size for custom inventory must be a multiple of 9 between 9 and 54 slots (got 81)
at org.apache.commons.lang.Validate.isTrue(Validate.java:136) ~[patched_1.15.2.jar:git-Paper-71]
at org.bukkit.craftbukkit.v1_15_R1.CraftServer.createInventory(CraftServer.java:1629) ~[patched_1.15.2.jar:git-Paper-71]
at org.bukkit.Bukkit.createInventory(Bukkit.java:1037) ~[patched_1.15.2.jar:git-Paper-71]
at at.pcgamingfreaks.Minepacks.Bukkit.Backpack.<init>(Backpack.java:95) ~[?:?]
at at.pcgamingfreaks.Minepacks.Bukkit.Backpack.<init>(Backpack.java:112) ~[?:?]
at at.pcgamingfreaks.Minepacks.Bukkit.Database.SQL.lambda$loadBackpack$4(SQL.java:365) ~[?:?]
at org.bukkit.craftbukkit.v1_15_R1.scheduler.CraftTask.run(CraftTask.java:84) ~[patched_1.15.2.jar:git-Paper-71]
at org.bukkit.craftbukkit.v1_15_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:54) ~[patched_1.15.2.jar:git-Paper-71]
at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[patched_1.15.2.jar:git-Paper-71]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_212]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_212]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212]

We don't want to lose the inside of the players' backpacks and we don't know how to get them to get the equipment back.

What I have tried
We looked in the database to get a list of the items in each backpack, but it's now in binary.

commented

Thanks for the report.
It seems like Minecraft 1.14 and newer no longer allow the glitch that allowed more than 6 rows in the backpack.
Please try this build: https://ci.pcgamingfreaks.at/job/Minepacks/154/artifact/a/Minepacks-2.1.4-SNAPSHOT-Release.jar
It should give your players access to their items again. Please make sure that everyone who currently has the permission to use backpacks with more than 6 rows has the backpack.size.6 permission.
This update will try to remove the empty space in the first 54 slots of the backpack to fit the additional items. If there still is not enough space in the inventory and the player is online (so viewing backpacks with more than 6 rows might not work) the additional items will be dropped on the ground (You might want to inform your players about this).

I will try to improve this a bit further by trying to combine items stacks and placing them in the players inventory (if possible).

commented

This build should now try to stack items before resorting to dropping them.

commented

This release should fix it as good as possible (for now).
Bigger backpacks will be supported again in the future with multiple pages, please see #5 for more details.

commented

Thanks