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

NoSuchElementException savePlayerInventory #129

Open
ghost opened this issue Jul 29, 2016 · 4 comments
Open

NoSuchElementException savePlayerInventory #129

ghost opened this issue Jul 29, 2016 · 4 comments
Assignees
Labels

Comments

@ghost
Copy link

ghost commented Jul 29, 2016

http://pastebin.com/iK89auJQ

@hsyyid
Copy link
Owner

hsyyid commented Jul 29, 2016

Not a NullPointerException but okay.

@hsyyid hsyyid added the bug label Jul 29, 2016
@hsyyid hsyyid self-assigned this Jul 29, 2016
@hsyyid hsyyid changed the title NPE NoSuchElementException savePlayerInventory Jul 29, 2016
@ghost
Copy link
Author

ghost commented Jul 30, 2016

In the attached pastebin are two exception - title of issue is type of first exception:

[17:39:10] [Server thread/ERROR] [Sponge]: Could not pass DisplaceEntityEvent$Move$TargetPlayer$Impl to org.spongepowered.mod.plugin.SpongeModPluginContainer@6ba5d2c4
java.lang.NullPointerException

@MarkL4YG
Copy link

MarkL4YG commented Jul 31, 2016

@hunter688 can you provide information about your setup? Songe version, (forge version), Minecraft version etc?

By the way, I took a quick peek over the trace:

Problematic part:
PlayerMoveListener.java#88

        if (!event.getFromTransform().getExtent().getUniqueId().equals(event.getToTransform().getExtent().getUniqueId()))
        {
            World oldWorld = event.getFromTransform().getExtent();
            World newWorld = event.getToTransform().getExtent();

            Utils.savePlayerInventory(player, oldWorld.getUniqueId());

            if (!Utils.doShareInventories(oldWorld.getName(), newWorld.getName()))
            {
                Utils.updatePlayerInventory(player, newWorld.getUniqueId());
            }

            player.offer(Keys.GAME_MODE, newWorld.getProperties().getGameMode());
        }

-> newWorld.getUniqueId() causes problems in:
Utils.java#1296

        String worldName = Sponge.getServer().getWorld(worldUuid).get().getName();

Seems like that either the UUID is invalid or null, or that the world with that UUID is not returned by #getWorld
Anyways: The Optional is not present.

Also:
Is this necessary? World->uuid->world->name?
You could e.g. just use the world as a parameter for #savePlayerInventory

@ghost
Copy link
Author

ghost commented Jul 31, 2016

its 1.8.9 spongeforge build 1625, forge 1890

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants