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

Entity Teleportation Not Syncing to Client #1006

Open
Dev296 opened this issue Jan 19, 2019 · 2 comments
Open

Entity Teleportation Not Syncing to Client #1006

Dev296 opened this issue Jan 19, 2019 · 2 comments

Comments

@Dev296
Copy link

Dev296 commented Jan 19, 2019

Title: Entity Teleportation Not Syncing to Client
Glowstone Version: 2018.9.0.e83d836

I was trying to develop a plugin that involves moving an entity by teleporting it a lot. I was running my teleportation code in a BukkitRunnable.

To reproduce the problem put the following code as your onCommand:

    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        getLogger().info("onCommand has been invoked!");
        if (cmd.getName().equalsIgnoreCase("test")) {
            World world = Bukkit.getServer().getWorld("world");
            Entity e = world.spawnEntity(new Location(world, 0.0, 256.0, 0.0), ARMOR_STAND);
            new BukkitRunnable() {
                @Override
                public void run() {
                    e.teleport(new Location(world, 10.0, 256.0, 10.0, e.getLocation().getYaw(), e.getLocation().getPitch()));
                }

            }.runTaskLater(this, 20);

        }
        return false;
    }

Then compile the plugin, start the glowstone server and fly to 0, 256, 0. Then run /test. An armor stand appears at 0,256,0 as intended however, it when it teleports to to 10, 256, 10 it does not move client side. Reloging fixes this issue.

Potentially related to #993.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@aramperes
Copy link
Member

Does the issue occur without using the BukkitRunnable? (like calling the teleport method directly after spawning, or after a second command is called, etc)

@Dev296
Copy link
Author

Dev296 commented Jan 19, 2019

It works directly after spawning, but a BukkitRunnable is how you would add a delay. Just sleeping would hang the main thread.

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

No branches or pull requests

2 participants