EnderContainers

EnderContainers

2.5k Downloads

Enderchest open not work with offline players

andris155 opened this issue · 2 comments

commented
[15:01:25 INFO]: MrZeri issued server command: /ecp open MrZero
[15:01:25 ERROR]: [EnderContainers] Cannot access the offline player profile
java.lang.NoSuchMethodException: net.minecraft.server.v1_14_R1.PlayerInteractManager.<init>(net.minecraft.server.v1_14_R1.World)
at java.lang.Class.getConstructor0(Unknown Source) ~[?:?]
at java.lang.Class.getDeclaredConstructor(Unknown Source) ~[?:?]
at fr.utarwyn.endercontainers.util.NMSHacks.getPlayerObjectOfOfflinePlayer(NMSHacks.java:74) ~[?:?]
at fr.utarwyn.endercontainers.util.EUtil.getVanillaEnderchestOf(EUtil.java:88) ~[?:?]
at fr.utarwyn.endercontainers.menu.EnderChestMenu.getFilledSlotsNb(EnderChestMenu.java:63) ~[?:?]
at fr.utarwyn.endercontainers.enderchest.EnderChest.getFillPercentage(EnderChest.java:113) ~[?:?]
at fr.utarwyn.endercontainers.menu.EnderChestHubMenu.getItemStackOf(EnderChestHubMenu.java:184) ~[?:?]
at fr.utarwyn.endercontainers.menu.EnderChestHubMenu.prepare(EnderChestHubMenu.java:118) ~[?:?]
at fr.utarwyn.endercontainers.enderchest.EnderChestManager.openHubMenuFor(EnderChestManager.java:116) ~[?:?]
at fr.utarwyn.endercontainers.command.main.OpenCommand.performPlayer(OpenCommand.java:50) ~[?:?]
at fr.utarwyn.endercontainers.command.AbstractCommand.onCommand(AbstractCommand.java:119) ~[?:?]
at fr.utarwyn.endercontainers.command.AbstractCommand.onCommand(AbstractCommand.java:76) ~[?:?]
at fr.utarwyn.endercontainers.command.AbstractCommand.execute(AbstractCommand.java:206) ~[?:?]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:159) ~[patched_1.14.4.jar:git-Paper-"4b854b5b"]
at org.bukkit.craftbukkit.v1_14_R1.CraftServer.dispatchCommand(CraftServer.java:739) ~[patched_1.14.4.jar:git-Paper-"4b854b5b"]
at net.minecraft.server.v1_14_R1.PlayerConnection.handleCommand(PlayerConnection.java:1800) ~[patched_1.14.4.jar:git-Paper-"4b854b5b"]
at net.minecraft.server.v1_14_R1.PlayerConnection.a(PlayerConnection.java:1608) ~[patched_1.14.4.jar:git-Paper-"4b854b5b"]
at net.minecraft.server.v1_14_R1.PacketPlayInChat.a(PacketPlayInChat.java:47) ~[patched_1.14.4.jar:git-Paper-"4b854b5b"]
at net.minecraft.server.v1_14_R1.PacketPlayInChat.a(PacketPlayInChat.java:5) ~[patched_1.14.4.jar:git-Paper-"4b854b5b"]
at net.minecraft.server.v1_14_R1.PlayerConnectionUtils.lambda$ensureMainThread$0(PlayerConnectionUtils.java:23) ~[patched_1.14.4.jar:git-Paper-"4b854b5b"]
at net.minecraft.server.v1_14_R1.TickTask.run(SourceFile:18) ~[patched_1.14.4.jar:git-Paper-"4b854b5b"]
at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:136) ~[patched_1.14.4.jar:git-Paper-"4b854b5b"]
at net.minecraft.server.v1_14_R1.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[patched_1.14.4.jar:git-Paper-"4b854b5b"]
at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:109) ~[patched_1.14.4.jar:git-Paper-"4b854b5b"]
at net.minecraft.server.v1_14_R1.MinecraftServer.aX(MinecraftServer.java:1013) ~[patched_1.14.4.jar:git-Paper-"4b854b5b"]
at net.minecraft.server.v1_14_R1.MinecraftServer.executeNext(MinecraftServer.java:1006) ~[patched_1.14.4.jar:git-Paper-"4b854b5b"]
at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.awaitTasks(IAsyncTaskHandler.java:119) ~[patched_1.14.4.jar:git-Paper-"4b854b5b"]
at net.minecraft.server.v1_14_R1.MinecraftServer.sleepForTick(MinecraftServer.java:990) ~[patched_1.14.4.jar:git-Paper-"4b854b5b"]
at net.minecraft.server.v1_14_R1.MinecraftServer.run(MinecraftServer.java:923) ~[patched_1.14.4.jar:git-Paper-"4b854b5b"]
at java.lang.Thread.run(Unknown Source) [?:?]
[15:01:25 ERROR]: null
org.bukkit.command.CommandException: Unhandled exception executing 'ecp open MrZero' in fr.utarwyn.endercontainers.command.MainCommand(endercontainers)
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:169) ~[patched_1.14.4.jar:git-Paper-"4b854b5b"]
at org.bukkit.craftbukkit.v1_14_R1.CraftServer.dispatchCommand(CraftServer.java:739) ~[patched_1.14.4.jar:git-Paper-"4b854b5b"]
at net.minecraft.server.v1_14_R1.PlayerConnection.handleCommand(PlayerConnection.java:1800) ~[patched_1.14.4.jar:git-Paper-"4b854b5b"]
at net.minecraft.server.v1_14_R1.PlayerConnection.a(PlayerConnection.java:1608) ~[patched_1.14.4.jar:git-Paper-"4b854b5b"]
at net.minecraft.server.v1_14_R1.PacketPlayInChat.a(PacketPlayInChat.java:47) ~[patched_1.14.4.jar:git-Paper-"4b854b5b"]
at net.minecraft.server.v1_14_R1.PacketPlayInChat.a(PacketPlayInChat.java:5) ~[patched_1.14.4.jar:git-Paper-"4b854b5b"]
at net.minecraft.server.v1_14_R1.PlayerConnectionUtils.lambda$ensureMainThread$0(PlayerConnectionUtils.java:23) ~[patched_1.14.4.jar:git-Paper-"4b854b5b"]
at net.minecraft.server.v1_14_R1.TickTask.run(SourceFile:18) ~[patched_1.14.4.jar:git-Paper-"4b854b5b"]
at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:136) ~[patched_1.14.4.jar:git-Paper-"4b854b5b"]
at net.minecraft.server.v1_14_R1.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[patched_1.14.4.jar:git-Paper-"4b854b5b"]
at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:109) ~[patched_1.14.4.jar:git-Paper-"4b854b5b"]
at net.minecraft.server.v1_14_R1.MinecraftServer.aX(MinecraftServer.java:1013) ~[patched_1.14.4.jar:git-Paper-"4b854b5b"]
at net.minecraft.server.v1_14_R1.MinecraftServer.executeNext(MinecraftServer.java:1006) ~[patched_1.14.4.jar:git-Paper-"4b854b5b"]
at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.awaitTasks(IAsyncTaskHandler.java:119) ~[patched_1.14.4.jar:git-Paper-"4b854b5b"]
at net.minecraft.server.v1_14_R1.MinecraftServer.sleepForTick(MinecraftServer.java:990) ~[patched_1.14.4.jar:git-Paper-"4b854b5b"]
at net.minecraft.server.v1_14_R1.MinecraftServer.run(MinecraftServer.java:923) ~[patched_1.14.4.jar:git-Paper-"4b854b5b"]
at java.lang.Thread.run(Unknown Source) [?:?]
Caused by: java.lang.NullPointerException
at fr.utarwyn.endercontainers.util.EUtil.getInventorySize(EUtil.java:40) ~[?:?]
at fr.utarwyn.endercontainers.menu.EnderChestMenu.getFilledSlotsNb(EnderChestMenu.java:66) ~[?:?]
at fr.utarwyn.endercontainers.enderchest.EnderChest.getFillPercentage(EnderChest.java:113) ~[?:?]
at fr.utarwyn.endercontainers.menu.EnderChestHubMenu.getItemStackOf(EnderChestHubMenu.java:184) ~[?:?]
at fr.utarwyn.endercontainers.menu.EnderChestHubMenu.prepare(EnderChestHubMenu.java:118) ~[?:?]
at fr.utarwyn.endercontainers.enderchest.EnderChestManager.openHubMenuFor(EnderChestManager.java:116) ~[?:?]
at fr.utarwyn.endercontainers.command.main.OpenCommand.performPlayer(OpenCommand.java:50) ~[?:?]
at fr.utarwyn.endercontainers.command.AbstractCommand.onCommand(AbstractCommand.java:119) ~[?:?]
at fr.utarwyn.endercontainers.command.AbstractCommand.onCommand(AbstractCommand.java:76) ~[?:?]
at fr.utarwyn.endercontainers.command.AbstractCommand.execute(AbstractCommand.java:206) ~[?:?]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:159) ~[patched_1.14.4.jar:git-Paper-"4b854b5b"]
... 16 more
commented

I have worked on this issue to allow admins to open vanilla enderchests of offline players. It seems to work well on both 1.8 and 1.15 versions of Bukkit. However, it is a little bit complicated to manage inventories and data when the owner connects or disconnects while an administrator is viewing its chest.

So, there may still be some bugs with this new feature, so don't hesitate to reopen this issue or create a new one.

Feature preview

commented

Yep, the offline management system of the plugin (NMSHacks class) is not very clean and works only for some versions of Bukkit/Spigot (1.14 versions are not supported for example).

I also have to work on that! Thank you for the feedback.