Closed seyfahni closed 4 years ago
This PR fixes the following issue:
The players items should be reordered / stacked to fit inside the now smaller inventory.
An exception is thrown and the players inventory is cleared:
[14:45:19] [Craft Scheduler Thread - 193/WARN]: java.lang.IllegalArgumentException: Item cannot be null [14:45:19] [Craft Scheduler Thread - 193/WARN]: at org.apache.commons.lang.Validate.noNullElements(Validate.java:364) [14:45:19] [Craft Scheduler Thread - 193/WARN]: at org.bukkit.craftbukkit.v1_15_R1.inventory.CraftInventory.addItem(CraftInventory.java:287) [14:45:19] [Craft Scheduler Thread - 193/WARN]: at net.craftersland.customenderchest.storage.MysqlStorage.decodeInventory(MysqlStorage.java:303) [14:45:19] [Craft Scheduler Thread - 193/WARN]: at net.craftersland.customenderchest.storage.MysqlStorage.loadEnderChest(MysqlStorage.java:264) [14:45:19] [Craft Scheduler Thread - 193/WARN]: at net.craftersland.customenderchest.DataHandler.loadPlayerFromStorage(DataHandler.java:65) [14:45:19] [Craft Scheduler Thread - 193/WARN]: at net.craftersland.customenderchest.PlayerHandler$1.run(PlayerHandler.java:54) [14:45:19] [Craft Scheduler Thread - 193/WARN]: at org.bukkit.craftbukkit.v1_15_R1.scheduler.CraftTask.run(CraftTask.java:84) [14:45:19] [Craft Scheduler Thread - 193/WARN]: at org.bukkit.craftbukkit.v1_15_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:54) [14:45:19] [Craft Scheduler Thread - 193/WARN]: at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) [14:45:19] [Craft Scheduler Thread - 193/WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [14:45:19] [Craft Scheduler Thread - 193/WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [14:45:19] [Craft Scheduler Thread - 193/WARN]: at java.base/java.lang.Thread.run(Thread.java:834) [14:45:19] [Craft Scheduler Thread - 193/ERROR]: [CustomEnderChest] Failed to decode inventory for Player! Error: Length of Base64 encoded input string is not a multiple of 4. [14:45:19] [Craft Scheduler Thread - 193/WARN]: java.lang.IllegalArgumentException: Length of Base64 encoded input string is not a multiple of 4. [14:45:19] [Craft Scheduler Thread - 193/WARN]: at org.yaml.snakeyaml.external.biz.base64Coder.Base64Coder.decode(Base64Coder.java:267) [14:45:19] [Craft Scheduler Thread - 193/WARN]: at org.yaml.snakeyaml.external.biz.base64Coder.Base64Coder.decodeLines(Base64Coder.java:218) [14:45:19] [Craft Scheduler Thread - 193/WARN]: at net.craftersland.customenderchest.utils.EncodingUtil.fromBase64(EncodingUtil.java:37) [14:45:19] [Craft Scheduler Thread - 193/WARN]: at net.craftersland.customenderchest.storage.MysqlStorage.decodeInventory(MysqlStorage.java:311) [14:45:19] [Craft Scheduler Thread - 193/WARN]: at net.craftersland.customenderchest.storage.MysqlStorage.loadEnderChest(MysqlStorage.java:264) [14:45:19] [Craft Scheduler Thread - 193/WARN]: at net.craftersland.customenderchest.DataHandler.loadPlayerFromStorage(DataHandler.java:65) [14:45:19] [Craft Scheduler Thread - 193/WARN]: at net.craftersland.customenderchest.PlayerHandler$1.run(PlayerHandler.java:54) [14:45:19] [Craft Scheduler Thread - 193/WARN]: at org.bukkit.craftbukkit.v1_15_R1.scheduler.CraftTask.run(CraftTask.java:84) [14:45:19] [Craft Scheduler Thread - 193/WARN]: at org.bukkit.craftbukkit.v1_15_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:54) [14:45:19] [Craft Scheduler Thread - 193/WARN]: at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) [14:45:19] [Craft Scheduler Thread - 193/WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [14:45:19] [Craft Scheduler Thread - 193/WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [14:45:19] [Craft Scheduler Thread - 193/WARN]: at java.base/java.lang.Thread.run(Thread.java:834)
This PR fixes the following issue:
Prerequisites
Reproduction steps
Expected result
The players items should be reordered / stacked to fit inside the now smaller inventory.
Actual result
An exception is thrown and the players inventory is cleared: