Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Per world inventory data import #433

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

benwoo1110
Copy link
Member

Add support for PerWorldInventory data import! Fixes #410. Will need #432 to be merged first.

@benwoo1110 benwoo1110 added PR: Enhancement Pull requests to implement a feature or improvement in code. State: Needs Review By Dev Pull requests requires the approve of lead dev. labels Mar 2, 2021
@benwoo1110
Copy link
Member Author

Test Build:
Multiverse-Inventories-4.2.3-SNAPSHOT.zip

@Deltik
Copy link

Deltik commented Dec 14, 2021

Got some early feedback on the current state of this pull request:

  • The usage help (/mv with no arguments) doesn't show PerWorldInventory as an import source.
  • There's an error while importing:
    [16:50:20 WARN]: java.lang.ClassCastException: class java.util.LinkedHashMap cannot be cast to class me.ebonjaeger.perworldinventory.data.PlayerProfile (java.util.LinkedHashMap is in module java.base of loader 'bootstrap'; me.ebonjaeger.perworldinventory.data.PlayerProfile is in unnamed module of loader 'perworldinventory-kt-2.3.2.jar' @7f60e718)
    [16:50:20 WARN]:        at Multiverse-Inventories-4.2.3-SNAPSHOT.jar//com.onarandombox.multiverseinventories.dataimport.perworldinventory.PwiImportHelper.getPWIPlayerData(PwiImportHelper.java:176)
    [16:50:20 WARN]:        at Multiverse-Inventories-4.2.3-SNAPSHOT.jar//com.onarandombox.multiverseinventories.dataimport.perworldinventory.PwiImportHelper.saveMVDataForGroup(PwiImportHelper.java:140)
    [16:50:20 WARN]:        at Multiverse-Inventories-4.2.3-SNAPSHOT.jar//com.onarandombox.multiverseinventories.dataimport.perworldinventory.PwiImportHelper.importData(PwiImportHelper.java:66)
    [16:50:20 WARN]:        at Multiverse-Inventories-4.2.3-SNAPSHOT.jar//com.onarandombox.multiverseinventories.dataimport.perworldinventory.PerWorldInventoryImporter.doDataImport(PerWorldInventoryImporter.java:33)
    [16:50:20 WARN]:        at Multiverse-Inventories-4.2.3-SNAPSHOT.jar//com.onarandombox.multiverseinventories.dataimport.AbstractDataImporter.importData(AbstractDataImporter.java:38)
    [16:50:20 WARN]:        at Multiverse-Inventories-4.2.3-SNAPSHOT.jar//com.onarandombox.multiverseinventories.dataimport.AbstractDataImporter.importData(AbstractDataImporter.java:59)
    [16:50:20 WARN]:        at Multiverse-Inventories-4.2.3-SNAPSHOT.jar//com.onarandombox.multiverseinventories.command.ImportCommand.runCommand(ImportCommand.java:44)
    [16:50:20 WARN]:        at Multiverse-Core-4.3.1.jar//com.onarandombox.commandhandler.CommandHandler.checkAndRunCommand(CommandHandler.java:296)
    [16:50:20 WARN]:        at Multiverse-Core-4.3.1.jar//com.onarandombox.commandhandler.CommandHandler.processFoundCommands(CommandHandler.java:143)
    [16:50:20 WARN]:        at Multiverse-Core-4.3.1.jar//com.onarandombox.commandhandler.CommandHandler.locateAndRunCommand(CommandHandler.java:93)
    [16:50:20 WARN]:        at Multiverse-Core-4.3.1.jar//com.onarandombox.commandhandler.CommandHandler.locateAndRunCommand(CommandHandler.java:71)
    [16:50:20 WARN]:        at Multiverse-Inventories-4.2.3-SNAPSHOT.jar//com.onarandombox.multiverseinventories.MultiverseInventories.onCommand(MultiverseInventories.java:230)
    [16:50:20 WARN]:        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45)
    [16:50:20 WARN]:        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:159)
    [16:50:20 WARN]:        at org.bukkit.craftbukkit.v1_17_R1.CraftServer.dispatchCommand(CraftServer.java:869)
    [16:50:20 WARN]:        at org.bukkit.craftbukkit.v1_17_R1.CraftServer.dispatchServerCommand(CraftServer.java:832)
    [16:50:20 WARN]:        at net.minecraft.server.dedicated.DedicatedServer.handleCommandQueue(DedicatedServer.java:529)
    [16:50:20 WARN]:        at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:491)
    [16:50:20 WARN]:        at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1483)
    [16:50:20 WARN]:        at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1282)
    [16:50:20 WARN]:        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:319)
    [16:50:20 WARN]:        at java.base/java.lang.Thread.run(Thread.java:833)
    [16:50:20 ERROR]: [Multiverse-Inventories] Unable to parse file into profile: /home/dtkms/mc/main/plugins/PerWorldInventory/data/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/default_creative.json
    [16:50:20 WARN]: Unexpected exception while parsing console command "mvinv import PerWorldInventory"
    org.bukkit.command.CommandException: Unhandled exception executing command 'mvinv' in plugin Multiverse-Inventories v4.2.3-SNAPSHOT-bUNKNOWN
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[patched_1.17.1.jar:git-Paper-399]
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:159) ~[patched_1.17.1.jar:git-Paper-399]
            at org.bukkit.craftbukkit.v1_17_R1.CraftServer.dispatchCommand(CraftServer.java:869) ~[patched_1.17.1.jar:git-Paper-399]
            at org.bukkit.craftbukkit.v1_17_R1.CraftServer.dispatchServerCommand(CraftServer.java:832) ~[patched_1.17.1.jar:git-Paper-399]
            at net.minecraft.server.dedicated.DedicatedServer.handleConsoleInputs(DedicatedServer.java:529) ~[patched_1.17.1.jar:git-Paper-399]
            at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:491) ~[patched_1.17.1.jar:git-Paper-399]
            at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1483) ~[patched_1.17.1.jar:git-Paper-399]
            at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1282) ~[patched_1.17.1.jar:git-Paper-399]
            at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:319) ~[patched_1.17.1.jar:git-Paper-399]
            at java.lang.Thread.run(Thread.java:833) ~[?:?]
    Caused by: java.lang.NullPointerException: Cannot invoke "java.lang.Exception.getMessage()" because the return value of "com.onarandombox.multiverseinventories.dataimport.DataImportException.getCauseException()" is null
            at com.onarandombox.multiverseinventories.dataimport.AbstractDataImporter.importData(AbstractDataImporter.java:41) ~[Multiverse-Inventories-4.2.3-SNAPSHOT.jar:?]
            at com.onarandombox.multiverseinventories.dataimport.AbstractDataImporter.importData(AbstractDataImporter.java:59) ~[Multiverse-Inventories-4.2.3-SNAPSHOT.jar:?]
            at com.onarandombox.multiverseinventories.command.ImportCommand.runCommand(ImportCommand.java:44) ~[Multiverse-Inventories-4.2.3-SNAPSHOT.jar:?]
            at com.onarandombox.commandhandler.CommandHandler.checkAndRunCommand(CommandHandler.java:296) ~[Multiverse-Core-4.3.1.jar:?]
            at com.onarandombox.commandhandler.CommandHandler.processFoundCommands(CommandHandler.java:143) ~[Multiverse-Core-4.3.1.jar:?]
            at com.onarandombox.commandhandler.CommandHandler.locateAndRunCommand(CommandHandler.java:93) ~[Multiverse-Core-4.3.1.jar:?]
            at com.onarandombox.commandhandler.CommandHandler.locateAndRunCommand(CommandHandler.java:71) ~[Multiverse-Core-4.3.1.jar:?]
            at com.onarandombox.multiverseinventories.MultiverseInventories.onCommand(MultiverseInventories.java:230) ~[Multiverse-Inventories-4.2.3-SNAPSHOT.jar:?]
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[patched_1.17.1.jar:git-Paper-399]
            ... 9 more
    The contents of that file, /home/dtkms/mc/main/plugins/PerWorldInventory/data/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/default_creative.json, are as follows:
    {"data-format":2,"ender-chest":[],"inventory":{"inventory":[{"index":0,"item":"rO0ABXNyABpvcmcuYnVra2l0LnV0aWwuaW8uV3JhcHBlcvJQR+zxEm8FAgABTAADbWFwdAAPTGph\ndmEvdXRpbC9NYXA7eHBzcgA1Y29tLmdvb2dsZS5jb21tb24uY29sbGVjdC5JbW11dGFibGVNYXAk\nU2VyaWFsaXplZEZvcm0AAAAAAAAAAAIA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plY3Q7WwAG\ndmFsdWVzcQB+AAR4cHVyABNbTGphdmEubGFuZy5PYmplY3Q7kM5YnxBzKWwCAAB4cAAAAAJ0AAI9\nPXQABHR5cGV1cQB+AAYAAAACdAAeb3JnLmJ1a2tpdC5pbnZlbnRvcnkuSXRlbVN0YWNrdAAGRUxZ\nVFJB\n"}],"armor":[{"index":2,"item":"rO0ABXNyABpvcmcuYnVra2l0LnV0aWwuaW8uV3JhcHBlcvJQR+zxEm8FAgABTAADbWFwdAAPTGph\ndmEvdXRpbC9NYXA7eHBzcgA1Y29tLmdvb2dsZS5jb21tb24uY29sbGVjdC5JbW11dGFibGVNYXAk\nU2VyaWFsaXplZEZvcm0AAAAAAAAAAAIAAlsABGtleXN0ABNbTGphdmEvbGFuZy9PYmplY3Q7WwAG\ndmFsdWVzcQB+AAR4cHVyABNbTGphdmEubGFuZy5PYmplY3Q7kM5YnxBzKWwCAAB4cAAAAAJ0AAI9\nPXQABHR5cGV1cQB+AAYAAAACdAAeb3JnLmJ1a2tpdC5pbnZlbnRvcnkuSXRlbVN0YWNrdAAGRUxZ\nVFJB\n"}]},"stats":{"can-fly":true,"display-name":"§2Builder§f xmaybedino_§r","exhaustion":0.0,"exp":0.70588243,"flying":true,"food":20,"gamemode":"CREATIVE","max-health":20.0,"health":20.0,"level":5,"potion-effects":[],"saturation":5.0,"fallDistance":0.0,"fireTicks":-20,"maxAir":300,"remainingAir":300},"economy":{"balance":0.0}}

In case the line numbers don't line up, I did do a git merge main, which merged revisions 97490d0 and 9d217df.

@IoIxD
Copy link

IoIxD commented Dec 15, 2021

Well this is quite a bit more important now that PerWorldInventory's repository has been archived with no explanation, and it was never even updated to 1.17, which tells me that it's a dead plugin.

@Deltik
Copy link

Deltik commented Dec 17, 2021

I was able to progress more with this patch:

diff --git a/src/main/java/com/onarandombox/multiverseinventories/dataimport/perworldinventory/PwiImportHelper.java b/src/main/java/com/onarandombox/multiverseinventories/dataimport/perworldinventory/PwiImportHelper.java
index fa76d5c..2c606ac 100644
--- a/src/main/java/com/onarandombox/multiverseinventories/dataimport/perworldinventory/PwiImportHelper.java
+++ b/src/main/java/com/onarandombox/multiverseinventories/dataimport/perworldinventory/PwiImportHelper.java
@@ -173,6 +173,7 @@ class PwiImportHelper {
         PlayerProfile pwiPlayerProfile;
         try {
             JSONObject jsonObject = (JSONObject) PARSER.parse(new FileInputStream(pwiPlayerDataFile));
+            jsonObject.put("==", "me.ebonjaeger.perworldinventory.data.PlayerProfile");
             pwiPlayerProfile = (PlayerProfile) SerializationHelper.deserialize(jsonObject);
         } catch (Exception e) {
             e.printStackTrace();

Here's my build with that patch: Multiverse-Inventories-4.2.3-SNAPSHOT.zip

I get this output now:

[16:49:44] [Server thread/INFO]: Deltik issued server command: /mvinv import PerWorldInventory
[16:49:44] [Server thread/WARN]: [PerWorldInventory] Creating a new group on the fly for 'world_delkit'. Please double check your `worlds.yml` file configuration!
[16:49:44] [Server thread/WARN]: [PerWorldInventory] Creating a new group on the fly for 'world_zombidz'. Please double check your `worlds.yml` file configuration!
[16:49:44] [Server thread/WARN]: [PerWorldInventory] Creating a new group on the fly for 'world_sg_1'. Please double check your `worlds.yml` file configuration!
[16:49:44] [Server thread/WARN]: [PerWorldInventory] Creating a new group on the fly for 'world_sg_2'. Please double check your `worlds.yml` file configuration!
[16:49:44] [Server thread/WARN]: [PerWorldInventory] Creating a new group on the fly for 'world_airport'. Please double check your `worlds.yml` file configuration!
[16:49:44] [Server thread/ERROR]: [org.bukkit.configuration.serialization.ConfigurationSerialization] Could not call method 'public static final me.ebonjaeger.perworldinventory.data.PlayerProfile me.ebonjaeger.perworldinventory.data.PlayerProfile.deserialize(java.util.Map)' of class me.ebonjaeger.perworldinventory.data.PlayerProfile for deserialization
me.ebonjaeger.perworldinventory.kotlin.TypeCastException: null cannot be cast to non-null type kotlin.collections.List<*>
	at me.ebonjaeger.perworldinventory.data.PlayerProfile$Companion.deserialize(PlayerProfile.kt:83) ~[perworldinventory-kt-2.3.2.jar:?]
	at me.ebonjaeger.perworldinventory.data.PlayerProfile.deserialize(PlayerProfile.kt) ~[perworldinventory-kt-2.3.2.jar:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
	at org.bukkit.configuration.serialization.ConfigurationSerialization.deserializeViaMethod(ConfigurationSerialization.java:85) ~[patched_1.17.1.jar:git-Paper-400]
	at org.bukkit.configuration.serialization.ConfigurationSerialization.deserialize(ConfigurationSerialization.java:127) ~[patched_1.17.1.jar:git-Paper-400]
	at org.bukkit.configuration.serialization.ConfigurationSerialization.deserializeObject(ConfigurationSerialization.java:207) ~[patched_1.17.1.jar:git-Paper-400]
	at com.onarandombox.multiverseinventories.utils.configuration.util.SerializationHelper.deserialize(SerializationHelper.java:125) ~[Multiverse-Inventories-4.2.3-SNAPSHOT.jar:?]
	at com.onarandombox.multiverseinventories.dataimport.perworldinventory.PwiImportHelper.getPWIPlayerData(PwiImportHelper.java:177) ~[Multiverse-Inventories-4.2.3-SNAPSHOT.jar:?]
	at com.onarandombox.multiverseinventories.dataimport.perworldinventory.PwiImportHelper.saveMVDataForGroup(PwiImportHelper.java:140) ~[Multiverse-Inventories-4.2.3-SNAPSHOT.jar:?]
	at com.onarandombox.multiverseinventories.dataimport.perworldinventory.PwiImportHelper.importData(PwiImportHelper.java:66) ~[Multiverse-Inventories-4.2.3-SNAPSHOT.jar:?]
	at com.onarandombox.multiverseinventories.dataimport.perworldinventory.PerWorldInventoryImporter.doDataImport(PerWorldInventoryImporter.java:33) ~[Multiverse-Inventories-4.2.3-SNAPSHOT.jar:?]
	at com.onarandombox.multiverseinventories.dataimport.AbstractDataImporter.importData(AbstractDataImporter.java:38) ~[Multiverse-Inventories-4.2.3-SNAPSHOT.jar:?]
	at com.onarandombox.multiverseinventories.dataimport.AbstractDataImporter.importData(AbstractDataImporter.java:59) ~[Multiverse-Inventories-4.2.3-SNAPSHOT.jar:?]
	at com.onarandombox.multiverseinventories.command.ImportCommand.runCommand(ImportCommand.java:44) ~[Multiverse-Inventories-4.2.3-SNAPSHOT.jar:?]
	at com.onarandombox.commandhandler.CommandHandler.checkAndRunCommand(CommandHandler.java:296) ~[Multiverse-Core-4.3.1.jar:?]
	at com.onarandombox.commandhandler.CommandHandler.processFoundCommands(CommandHandler.java:143) ~[Multiverse-Core-4.3.1.jar:?]
	at com.onarandombox.commandhandler.CommandHandler.locateAndRunCommand(CommandHandler.java:93) ~[Multiverse-Core-4.3.1.jar:?]
	at com.onarandombox.commandhandler.CommandHandler.locateAndRunCommand(CommandHandler.java:71) ~[Multiverse-Core-4.3.1.jar:?]
	at com.onarandombox.multiverseinventories.MultiverseInventories.onCommand(MultiverseInventories.java:230) ~[Multiverse-Inventories-4.2.3-SNAPSHOT.jar:?]
	at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[patched_1.17.1.jar:git-Paper-400]
	at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:159) ~[patched_1.17.1.jar:git-Paper-400]
	at org.bukkit.craftbukkit.v1_17_R1.CraftServer.dispatchCommand(CraftServer.java:869) ~[patched_1.17.1.jar:git-Paper-400]
	at net.minecraft.server.network.ServerGamePacketListenerImpl.handleCommand(ServerGamePacketListenerImpl.java:2262) ~[app:?]
	at net.minecraft.server.network.ServerGamePacketListenerImpl.handleChat(ServerGamePacketListenerImpl.java:2073) ~[app:?]
	at net.minecraft.server.network.ServerGamePacketListenerImpl.handleChat(ServerGamePacketListenerImpl.java:2054) ~[app:?]
	at net.minecraft.network.protocol.game.ServerboundChatPacket.handle(ServerboundChatPacket.java:46) ~[app:?]
	at net.minecraft.network.protocol.game.ServerboundChatPacket.a(ServerboundChatPacket.java:6) ~[app:?]
	at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$1(PacketUtils.java:56) ~[app:?]
	at net.minecraft.server.TickTask.run(TickTask.java:18) ~[patched_1.17.1.jar:git-Paper-400]
	at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:149) ~[app:?]
	at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:23) ~[app:?]
	at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1426) ~[patched_1.17.1.jar:git-Paper-400]
	at net.minecraft.server.MinecraftServer.executeTask(MinecraftServer.java:192) ~[patched_1.17.1.jar:git-Paper-400]
	at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:122) ~[app:?]
	at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1404) ~[patched_1.17.1.jar:git-Paper-400]
	at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1397) ~[patched_1.17.1.jar:git-Paper-400]
	at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:132) ~[app:?]
	at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1375) ~[patched_1.17.1.jar:git-Paper-400]
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1286) ~[patched_1.17.1.jar:git-Paper-400]
	at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:319) ~[patched_1.17.1.jar:git-Paper-400]
	at java.lang.Thread.run(Thread.java:833) ~[?:?]
… [TRUNCATED] …
[16:49:50] [Server thread/WARN]: [Multiverse-Inventories] Empty serialization for ProfileKey{uuid='xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', group='world_sg_1', gameMode='creative'}.
[16:49:50] [Server thread/ERROR]: [org.bukkit.configuration.serialization.ConfigurationSerialization] Could not call method 'public static final me.ebonjaeger.perworldinventory.data.PlayerProfile me.ebonjaeger.perworldinventory.data.PlayerProfile.deserialize(java.util.Map)' of class me.ebonjaeger.perworldinventory.data.PlayerProfile for deserialization
me.ebonjaeger.perworldinventory.kotlin.TypeCastException: null cannot be cast to non-null type kotlin.collections.List<*>
	at me.ebonjaeger.perworldinventory.data.PlayerProfile$Companion.deserialize(PlayerProfile.kt:83) ~[perworldinventory-kt-2.3.2.jar:?]
	at me.ebonjaeger.perworldinventory.data.PlayerProfile.deserialize(PlayerProfile.kt) ~[perworldinventory-kt-2.3.2.jar:?]
	at jdk.internal.reflect.GeneratedMethodAccessor43.invoke(Unknown Source) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
	at org.bukkit.configuration.serialization.ConfigurationSerialization.deserializeViaMethod(ConfigurationSerialization.java:85) ~[patched_1.17.1.jar:git-Paper-400]
	at org.bukkit.configuration.serialization.ConfigurationSerialization.deserialize(ConfigurationSerialization.java:127) ~[patched_1.17.1.jar:git-Paper-400]
	at org.bukkit.configuration.serialization.ConfigurationSerialization.deserializeObject(ConfigurationSerialization.java:207) ~[patched_1.17.1.jar:git-Paper-400]
	at com.onarandombox.multiverseinventories.utils.configuration.util.SerializationHelper.deserialize(SerializationHelper.java:125) ~[Multiverse-Inventories-4.2.3-SNAPSHOT.jar:?]
	at com.onarandombox.multiverseinventories.dataimport.perworldinventory.PwiImportHelper.getPWIPlayerData(PwiImportHelper.java:177) ~[Multiverse-Inventories-4.2.3-SNAPSHOT.jar:?]
	at com.onarandombox.multiverseinventories.dataimport.perworldinventory.PwiImportHelper.saveMVDataForGroup(PwiImportHelper.java:140) ~[Multiverse-Inventories-4.2.3-SNAPSHOT.jar:?]
	at com.onarandombox.multiverseinventories.dataimport.perworldinventory.PwiImportHelper.importData(PwiImportHelper.java:66) ~[Multiverse-Inventories-4.2.3-SNAPSHOT.jar:?]
	at com.onarandombox.multiverseinventories.dataimport.perworldinventory.PerWorldInventoryImporter.doDataImport(PerWorldInventoryImporter.java:33) ~[Multiverse-Inventories-4.2.3-SNAPSHOT.jar:?]
	at com.onarandombox.multiverseinventories.dataimport.AbstractDataImporter.importData(AbstractDataImporter.java:38) ~[Multiverse-Inventories-4.2.3-SNAPSHOT.jar:?]
	at com.onarandombox.multiverseinventories.dataimport.AbstractDataImporter.importData(AbstractDataImporter.java:59) ~[Multiverse-Inventories-4.2.3-SNAPSHOT.jar:?]
	at com.onarandombox.multiverseinventories.command.ImportCommand.runCommand(ImportCommand.java:44) ~[Multiverse-Inventories-4.2.3-SNAPSHOT.jar:?]
	at com.onarandombox.commandhandler.CommandHandler.checkAndRunCommand(CommandHandler.java:296) ~[Multiverse-Core-4.3.1.jar:?]
	at com.onarandombox.commandhandler.CommandHandler.processFoundCommands(CommandHandler.java:143) ~[Multiverse-Core-4.3.1.jar:?]
	at com.onarandombox.commandhandler.CommandHandler.locateAndRunCommand(CommandHandler.java:93) ~[Multiverse-Core-4.3.1.jar:?]
	at com.onarandombox.commandhandler.CommandHandler.locateAndRunCommand(CommandHandler.java:71) ~[Multiverse-Core-4.3.1.jar:?]
	at com.onarandombox.multiverseinventories.MultiverseInventories.onCommand(MultiverseInventories.java:230) ~[Multiverse-Inventories-4.2.3-SNAPSHOT.jar:?]
	at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[patched_1.17.1.jar:git-Paper-400]
	at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:159) ~[patched_1.17.1.jar:git-Paper-400]
	at org.bukkit.craftbukkit.v1_17_R1.CraftServer.dispatchCommand(CraftServer.java:869) ~[patched_1.17.1.jar:git-Paper-400]
	at net.minecraft.server.network.ServerGamePacketListenerImpl.handleCommand(ServerGamePacketListenerImpl.java:2262) ~[app:?]
	at net.minecraft.server.network.ServerGamePacketListenerImpl.handleChat(ServerGamePacketListenerImpl.java:2073) ~[app:?]
	at net.minecraft.server.network.ServerGamePacketListenerImpl.handleChat(ServerGamePacketListenerImpl.java:2054) ~[app:?]
	at net.minecraft.network.protocol.game.ServerboundChatPacket.handle(ServerboundChatPacket.java:46) ~[app:?]
	at net.minecraft.network.protocol.game.ServerboundChatPacket.a(ServerboundChatPacket.java:6) ~[app:?]
	at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$1(PacketUtils.java:56) ~[app:?]
	at net.minecraft.server.TickTask.run(TickTask.java:18) ~[patched_1.17.1.jar:git-Paper-400]
	at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:149) ~[app:?]
	at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:23) ~[app:?]
	at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1426) ~[patched_1.17.1.jar:git-Paper-400]
	at net.minecraft.server.MinecraftServer.executeTask(MinecraftServer.java:192) ~[patched_1.17.1.jar:git-Paper-400]
	at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:122) ~[app:?]
	at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1404) ~[patched_1.17.1.jar:git-Paper-400]
	at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1397) ~[patched_1.17.1.jar:git-Paper-400]
	at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:132) ~[app:?]
	at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1375) ~[patched_1.17.1.jar:git-Paper-400]
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1286) ~[patched_1.17.1.jar:git-Paper-400]
	at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:319) ~[patched_1.17.1.jar:git-Paper-400]
	at java.lang.Thread.run(Thread.java:833) ~[?:?]
[16:49:50] [Server thread/WARN]: [Multiverse-Inventories] Empty serialization for ProfileKey{uuid='8f519135-8105-48db-bdcd-6d3ae7379e0e', group='world_sg_1', gameMode='survival'}.
[16:49:50] [Server thread/INFO]: [Multiverse-Inventories] Successfully imported data from PerWorldInventory!
[16:49:50] [Server thread/INFO]: [Multiverse-Inventories] Disabling PerWorldInventory...
[16:49:50] [Server thread/INFO]: [PerWorldInventory] Disabling PerWorldInventory v2.3.2
[16:49:50] [Server thread/INFO]: [Multiverse-Inventories] Successfully disabled data importer for 'PerWorldInventory'.

@bensuperpc
Copy link

This is a feature I would be very interested in, perworldinventory-kt no longer seems active :/

@seema84
Copy link

seema84 commented Apr 8, 2023

Is there any progress yet? I could use it too.

@alekso56
Copy link

alekso56 commented Apr 15, 2023

Got some early feedback on the current state of this pull request:

* The usage help (`/mv` with no arguments) doesn't show PerWorldInventory as an import source.

* There's an error while importing:
  ```java
  [16:50:20 WARN]: java.lang.ClassCastException: class java.util.LinkedHashMap cannot be cast to class 

i made #523 to adress your concerns, the error you posted is because you did not run "/pwi migrate" before running "/mvinv import".

  1. it's important that all your files are the same version. (version must be higher than 1 for migration)
  2. pwi will skip migration of files that do not have a offlineplayer equalient, so mvinv importer will also skip these with my pr.

I was able to progress more with this patch:

All you did here was trick pwi into thinking your stuff was already migrated, this is bad. 👎🏼

So the new pullrequest accept order is #523 #432 #433

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Enhancement Pull requests to implement a feature or improvement in code. State: Needs Review By Dev Pull requests requires the approve of lead dev.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The ability to import your data from Per World Inventory to this.
6 participants