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

Event Exception (and server stops responding) when throwing ender pearls #44

Closed
Amunak opened this issue Oct 13, 2014 · 4 comments
Closed

Comments

@Amunak
Copy link
Contributor

Amunak commented Oct 13, 2014

Trying out the plugin with disabled ender pearl damage I encountered this error on CraftBukkit version git-Spigot-.7.9-R0.2-207-g03373bb (MC: 1.7.10) (Implementing API version 1.7.10-R0.1-SNAPSHOT) with UHPlugin build #62 (latest as of now):

    [22:10:37 ERROR]: Could not pass event PlayerTeleportEvent to UHPlugin v1.1.2 ▒cdev▒r
    org.bukkit.event.EventException
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302) ~[spigot-patched.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot-patched.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
            at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:509) ~[spigot-patched.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:494) ~[spigot-patched.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
            at org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer.teleport(CraftPlayer.java:485) ~[spigot-patched.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
            at me.azenet.UHPlugin.listeners.UHGameplayListener.onPlayerTeleport(UHGameplayListener.java:137) ~[?:?]
            at sun.reflect.GeneratedMethodAccessor43.invoke(Unknown Source) ~[?:?]
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_67]
            at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_67]
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:298) ~[spigot-patched.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot-patched.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
            at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:509) ~[spigot-patched.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:494) ~[spigot-patched.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
            at org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer.teleport(CraftPlayer.java:485) ~[spigot-patched.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
            at me.azenet.UHPlugin.listeners.UHGameplayListener.onPlayerTeleport(UHGameplayListener.java:137) ~[?:?]
            at sun.reflect.GeneratedMethodAccessor43.invoke(Unknown Source) ~[?:?]
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_67]
            at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_67]
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:298) ~[spigot-patched.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot-patched.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
            at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:509) ~[spigot-patched.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:494) ~[spigot-patched.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
            at org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer.teleport(CraftPlayer.java:485) ~[spigot-patched.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
            at me.azenet.UHPlugin.listeners.UHGameplayListener.onPlayerTeleport(UHGameplayListener.java:137) ~[?:?]
            at sun.reflect.GeneratedMethodAccessor43.invoke(Unknown Source) ~[?:?]
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_67]
            at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_67]
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:298) ~[spigot-patched.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot-patched.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
            at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:509) ~[spigot-patched.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:494) ~[spigot-patched.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
            at org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer.teleport(CraftPlayer.java:485) ~[spigot-patched.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
            at me.azenet.UHPlugin.listeners.UHGameplayListener.onPlayerTeleport(UHGameplayListener.java:137) ~[?:?]
            at sun.reflect.GeneratedMethodAccessor43.invoke(Unknown Source) ~[?:?]
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_67]
            at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_67]

To reproduce just throw some ender pearls while playing and wait a while, you should get console full of messages like that.

@AmauryCarrade AmauryCarrade added this to the 1.2 – Stable milestone Oct 13, 2014
@AmauryCarrade AmauryCarrade self-assigned this Oct 13, 2014
@AmauryCarrade
Copy link
Member

Ok, on my side (Spigot 1.7.10) the server stops responding when I throw an ender pearl with damages disabled, without exception.

Log here.

CraftBukkit version git-Spigot-1551 (MC: 1.7.10) (Implementing API version 1.7.10-R0.1-SNAPSHOT).
Plugins (5): WorldBorder, PTweaks, ProtocolLib, SpectatorPlus (latest dev version), UHPlugin (latest dev version).

I'll investigate soon (I cannot work on the plugin today, I will be able to soon). Thanks for your report.

@Amunak
Copy link
Contributor Author

Amunak commented Oct 13, 2014

oh, interesting. I tried looking into the code what could be causing it but didn't find anything suspicious. I also asked the guys over on Quakenet at #spigot just to make sure it's the plugin and not spigot causing it, and apparently it must be the plugin.

My plugins are (9): WorldBorder, WorldEdit, ProtocolLib, PermissionsEx, NoCheatPlus, TelePlusPlus, SpectatorPlus, TagAPI, UHPlugin; the majority would be latest dev builds.

Oh, did I say it's awesome? Your UHC plugin is awesome.

@AmauryCarrade
Copy link
Member

I tried looking into the code what could be causing it but didn't find anything suspicious.

I tried that too, without any obvious cause found.

I also asked the guys over on Quakenet at #spigot just to make sure it's the plugin and not spigot causing it, and apparently it must be the plugin.

Thanks for that.

Oh, did I say it's awesome? Your UHC plugin is awesome.

Thanks! :)

@AmauryCarrade AmauryCarrade changed the title Event Exception when throwing ender pearls Event Exception (and server stops responding) when throwing ender pearls Oct 22, 2014
@AmauryCarrade
Copy link
Member

FOUND.

    /**
    * Used to disable enderpearl damages (if needed).
    *
    * @param ev
    */
    @EventHandler(ignoreCancelled = true)
    public void onPlayerTeleport(final PlayerTeleportEvent ev) {
        if(p.getConfig().getBoolean("gameplay-changes.disableEnderpearlsDamages")) {
            if(ev.getCause() == TeleportCause.ENDER_PEARL) {
                ev.setCancelled(true);
                ev.getPlayer().teleport(ev.getTo(), TeleportCause.ENDER_PEARL);
            }
        }
    }

If I teleport a player with the tag TeleportCause.ENDER_PEARL, it will fire a PlayerTeleportEvent event with the cause TeleportCause.ENDER_PEARL. This event will be caught by my event. Re-firing a PlayerTeleportEvent with the cause TeleportCause.ENDER_PEARL. And... Infinite loop.


Introduced by e2bf107 (18 August).

@AmauryCarrade AmauryCarrade removed their assignment Nov 2, 2015
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