Taiterio / ce

The Official Custom Enchantments Repository
GNU Lesser General Public License v3.0
18 stars 38 forks source link

NPE on PlayerMoveEvent #30

Closed RoboMWM closed 8 years ago

RoboMWM commented 8 years ago

Nothing is in my inventory, seems like a recent update broke this :S

[21:40:31 ERROR]: Could not pass event PlayerMoveEvent to CustomEnchantments v2.4b                                                                                             
org.bukkit.event.EventException                                                                                                                                                
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302) ~[patched_1.9.jar:git-Paper-473]                                                       
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:78) ~[patched_1.9.jar:git-Paper-473]                                                            
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[patched_1.9.jar:git-Paper-473]                                                         
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:517) [patched_1.9.jar:git-Paper-473]                                                       
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:502) [patched_1.9.jar:git-Paper-473]                                                       
        at net.minecraft.server.v1_9_R1.PlayerConnection.a(PlayerConnection.java:608) [patched_1.9.jar:git-Paper-473]                                                          
        at net.minecraft.server.v1_9_R1.PacketPlayInFlying.a(SourceFile:126) [patched_1.9.jar:git-Paper-473]                                                                   
        at net.minecraft.server.v1_9_R1.PacketPlayInFlying$PacketPlayInPositionLook.a(SourceFile:18) [patched_1.9.jar:git-Paper-473]                                           
        at net.minecraft.server.v1_9_R1.PlayerConnectionUtils$1.run(SourceFile:13) [patched_1.9.jar:git-Paper-473]                                                             
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_45]                                                                                
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_45]                                                                                               
        at net.minecraft.server.v1_9_R1.SystemUtils.a(SourceFile:45) [patched_1.9.jar:git-Paper-473]                                                                           
        at net.minecraft.server.v1_9_R1.MinecraftServer.D(MinecraftServer.java:775) [patched_1.9.jar:git-Paper-473]                                                            
        at net.minecraft.server.v1_9_R1.DedicatedServer.D(DedicatedServer.java:404) [patched_1.9.jar:git-Paper-473]                                                            
        at net.minecraft.server.v1_9_R1.MinecraftServer.C(MinecraftServer.java:714) [patched_1.9.jar:git-Paper-473]                                                            
        at net.minecraft.server.v1_9_R1.MinecraftServer.run(MinecraftServer.java:613) [patched_1.9.jar:git-Paper-473]                                                          
        at java.lang.Thread.run(Thread.java:745) [?:1.8.0_45]                                                                                                                  
Caused by: java.lang.NullPointerException                                                                                                                                      
        at com.taiter.ce.CEventHandler.handleEvent(CEventHandler.java:94) ~[?:?]                                                                                               
        at com.taiter.ce.CEListener.PlayerMoveEvent(CEListener.java:658) ~[?:?]                                                                                                
        at sun.reflect.GeneratedMethodAccessor128.invoke(Unknown Source) ~[?:?]                                                                                                
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_45]                                                                 
        at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_45]                                                                                                      
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:300) ~[patched_1.9.jar:git-Paper-473]                                                       
        ... 16 more
ninmore commented 8 years ago

This was fixed in the recent updated of Spigot. Never mind it was not fixed. It might just be Spigot.

RoboMWM commented 8 years ago

This is very similar to an issue with a plugin I now maintain: https://github.com/MLG-Fortress/ExtraHardMode/issues/21 (this error only appears when I'm not wearing a full set of armor)

All the info is there in that issue, along with the fix. In essence, armor now returns null instead of air when the slot is empty

Anikamarie4 commented 8 years ago

I have the same issue. I have "could not pass event PlayerMoveEvent" and PlayerInteractEvent. I'm on the latest Spigot build and CE 2.4b Enchanted some boots with springs and it didn't work.

[06:18:38] [Server thread/ERROR]: Could not pass event PlayerInteractEvent to CustomEnchantments v2.4b
org.bukkit.event.EventException
    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[spigot.jar:git-Spigot-6f291ea-0c7ae56]
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot.jar:git-Spigot-6f291ea-0c7ae56]
    at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [spigot.jar:git-Spigot-6f291ea-0c7ae56]
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [spigot.jar:git-Spigot-6f291ea-0c7ae56]
    at org.bukkit.craftbukkit.v1_9_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:227) [spigot.jar:git-Spigot-6f291ea-0c7ae56]
    at net.minecraft.server.v1_9_R1.PlayerInteractManager.a(PlayerInteractManager.java:482) [spigot.jar:git-Spigot-6f291ea-0c7ae56]
    at net.minecraft.server.v1_9_R1.PlayerConnection.a(PlayerConnection.java:880) [spigot.jar:git-Spigot-6f291ea-0c7ae56]
    at net.minecraft.server.v1_9_R1.PacketPlayInUseItem.a(SourceFile:55) [spigot.jar:git-Spigot-6f291ea-0c7ae56]
    at net.minecraft.server.v1_9_R1.PacketPlayInUseItem.a(SourceFile:11) [spigot.jar:git-Spigot-6f291ea-0c7ae56]
    at net.minecraft.server.v1_9_R1.PlayerConnectionUtils$1.run(SourceFile:13) [spigot.jar:git-Spigot-6f291ea-0c7ae56]
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_73]
    at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_73]
    at net.minecraft.server.v1_9_R1.SystemUtils.a(SourceFile:45) [spigot.jar:git-Spigot-6f291ea-0c7ae56]
    at net.minecraft.server.v1_9_R1.MinecraftServer.D(MinecraftServer.java:721) [spigot.jar:git-Spigot-6f291ea-0c7ae56]
    at net.minecraft.server.v1_9_R1.DedicatedServer.D(DedicatedServer.java:400) [spigot.jar:git-Spigot-6f291ea-0c7ae56]
    at net.minecraft.server.v1_9_R1.MinecraftServer.C(MinecraftServer.java:660) [spigot.jar:git-Spigot-6f291ea-0c7ae56]
    at net.minecraft.server.v1_9_R1.MinecraftServer.run(MinecraftServer.java:559) [spigot.jar:git-Spigot-6f291ea-0c7ae56]
    at java.lang.Thread.run(Unknown Source) [?:1.8.0_73]
Caused by: java.lang.NullPointerException
    at com.taiter.ce.CEventHandler.handleEvent(CEventHandler.java:94) ~[?:?]
    at com.taiter.ce.CEListener.PlayerInteractEvent(CEListener.java:502) ~[?:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_73]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_73]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_73]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_73]
    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot.jar:git-Spigot-6f291ea-0c7ae56]
ianblankg commented 8 years ago

same problem here, this is the only plugin on my 1.9 server that has any errors. any suggestions? or eta on a fix?

RoboMWM commented 8 years ago

I'd try to fix if this had some sort of build system like maven. Heck, even when disabling this plugin it breaks all other tasks because it decides to cancel all tasks onDisable (see #31). Either way, author seems to be inactive for a month.

ianblankg commented 8 years ago

If I get you maven could you try?

ianblankg commented 8 years ago

Or do you mean if it had some sort of build system like maven?

DrkMatr1984 commented 8 years ago

One of us could always fork it and update it ourselves, and fix a few bugs. If I get around to it, I'll try to post a link to my forked repo and share the source.

And I think I did add maven to this project once a long time ago, but Taitero removed it for some reason. (I think it was after CraftBukkit died and you had to compile spigot from BuildTools yourself in order for it to end up in your local repo...I don't think he liked that.)

ianblankg commented 8 years ago

That would be awesome! You'd be helping a lot of people.

RoboMWM commented 8 years ago

Yea, right now my time is super limited and I haven't had much time to experiment with this plugin, so I'm unaware of what dependencies and such to look for.

ianblankg commented 8 years ago

Well it seems more likely that you'll get to it before taiterio does. Whenever you can, no rush.

Anikamarie4 commented 8 years ago

if I even knew what to do or how to do it, I would totally be on this in an instant. I guess time to learn java?

DrkMatr1984 commented 8 years ago

^^ Google power baby! I taught myself by reviewing code here on github and tons of googling. In the beginning I basically just changed a few lines here or there in existing plugins. Eventually I got better. It's 3 years later and now given enough time and enough google I can code pretty much anything.

I wrote much of this short tutorial on how to compile my old plugin, papermail, from source. It's a good start to learn and you could use the instructions to compile most plugins.

https://github.com/BukkitCodersUnited/paperMail/wiki

Anikamarie4 commented 8 years ago

yeah yeah and three years later this will be updated. :D thanks for the info, I foresee coding in my future. running a server just isn't good enough anymore :P

RoboMWM commented 8 years ago

If you want to try fixing this @Anikamarie4, try looking at the fix I made in ExtraHardMode (commit is mentioned in issue): https://github.com/MLG-Fortress/ExtraHardMode/issues/21

However as for compiling the plugin, you're on your own for that since I'm not sure of the dependencies this plugin requires (otherwise I would've long since forked and fixed this), nor do I want to spend time figuring that out.

Anikamarie4 commented 8 years ago

oh no, I run a server and don't know java at all. I'm not at all able to fix this--but boy I wish i was

On Thu, Mar 24, 2016 at 10:05 PM, RoboMWM notifications@github.com wrote:

If you want to try fixing this @Anikamarie4 https://github.com/Anikamarie4, try looking at the fix I made in ExtraHardMode (commit is mentioned in issue): MLG-Fortress/ExtraHardMode#21 https://github.com/MLG-Fortress/ExtraHardMode/issues/21

However as for compiling the plugin, you're on your own for that since I'm not sure of the dependencies this plugin requires (otherwise I would've long since forked and fixed this), nor do I want to spend time figuring that out.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/Taiterio/ce/issues/30#issuecomment-201136701

LesserHydra commented 8 years ago

Taiterio/ce#33 fixes this with a null check.

@RoboMWM I've got it working with Vault, WorldGuard, and WorldEdit as dependencies.

DrkMatr1984 commented 8 years ago

Nice. If you get anything done Pls don't hesitate to PM me. DrkMatr1984 @ dev.bukkit.org DrkMatr1984 @ spigotmc.org Drkmatr1984@gmail.com DrkMatr1984 (Skype)

Taiterio commented 8 years ago

@DrkMatr1984 Afaik this project never had maven at any point. Never bothered to set it up since the only dependency that needs updating is Spigot. If it would open the project up for more people to contribute, I'd be happy to do that :)

@RoboMWM The dependencies are listed on the main page of the repository :)

Closing this as the issue is resolved in b4d7042405a3d72090545d542ec773723a3212d9.