CyberdyneCC / Thermos

(NO LONGER DEVELOPED) Minecraft Forge Server Software implementing the Spigot/Bukkit API, formerly known as Cauldron/MCPC
http://cyberdynecc.github.io/Thermos/
GNU General Public License v3.0
258 stars 185 forks source link

[Bug] PlayerInteractEvent calling twice #263

Open TheAndrey opened 8 years ago

TheAndrey commented 8 years ago

I tried to solve one problem with the WG flag interact and have discovered one interesting feature of the kernel. When clicking (RMB) on a block with an empty hand PlayerInteractEvent is called twice. I found this using your plugin, adding the printing of the call stack.

[19:55:35] [Server thread/WARN]: java.lang.Exception
[19:55:35] [Server thread/WARN]:    at redserver.redguard.modules.BlocksGuard.handlePlayerInteractHighest(BlocksGuard.java:74)
[19:55:35] [Server thread/WARN]:    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[19:55:35] [Server thread/WARN]:    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[19:55:35] [Server thread/WARN]:    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[19:55:35] [Server thread/WARN]:    at java.lang.reflect.Method.invoke(Unknown Source)
[19:55:35] [Server thread/WARN]:    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:334)
[19:55:35] [Server thread/WARN]:    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
[19:55:35] [Server thread/WARN]:    at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:507)
[19:55:35] [Server thread/WARN]:    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:492)
[19:55:35] [Server thread/WARN]:    at org.bukkit.craftbukkit.v1_7_R4.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:223)
[19:55:35] [Server thread/WARN]:    at net.minecraft.server.management.ItemInWorldManager.func_73078_a(ItemInWorldManager.java:429)
[19:55:35] [Server thread/WARN]:    at net.minecraft.network.NetHandlerPlayServer.func_147346_a(NetHandlerPlayServer.java:853)
[19:55:35] [Server thread/WARN]:    at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.func_148833_a(SourceFile:60)
[19:55:35] [Server thread/WARN]:    at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.func_148833_a(SourceFile:9)
[19:55:35] [Server thread/WARN]:    at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:245)
[19:55:35] [Server thread/WARN]:    at net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:173)
[19:55:35] [Server thread/WARN]:    at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:1013)
[19:55:35] [Server thread/WARN]:    at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:431)
[19:55:35] [Server thread/WARN]:    at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:831)
[19:55:35] [Server thread/WARN]:    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:683)
[19:55:35] [Server thread/WARN]:    at java.lang.Thread.run(Unknown Source)
[19:55:35] [Server thread/WARN]: java.lang.Exception
[19:55:35] [Server thread/WARN]:    at redserver.redguard.modules.BlocksGuard.handlePlayerInteractHighest(BlocksGuard.java:74)
[19:55:35] [Server thread/WARN]:    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[19:55:35] [Server thread/WARN]:    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[19:55:35] [Server thread/WARN]:    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[19:55:35] [Server thread/WARN]:    at java.lang.reflect.Method.invoke(Unknown Source)
[19:55:35] [Server thread/WARN]:    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:334)
[19:55:35] [Server thread/WARN]:    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
[19:55:35] [Server thread/WARN]:    at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:507)
[19:55:35] [Server thread/WARN]:    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:492)
[19:55:35] [Server thread/WARN]:    at org.bukkit.craftbukkit.v1_7_R4.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:223)
[19:55:35] [Server thread/WARN]:    at org.bukkit.craftbukkit.v1_7_R4.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:193)
[19:55:35] [Server thread/WARN]:    at net.minecraft.network.NetHandlerPlayServer.func_147350_a(NetHandlerPlayServer.java:1388)
[19:55:35] [Server thread/WARN]:    at net.minecraft.network.play.client.C0APacketAnimation.func_148833_a(SourceFile:43)
[19:55:35] [Server thread/WARN]:    at net.minecraft.network.play.client.C0APacketAnimation.func_148833_a(SourceFile:9)
[19:55:35] [Server thread/WARN]:    at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:245)
[19:55:35] [Server thread/WARN]:    at net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:173)
[19:55:35] [Server thread/WARN]:    at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:1013)
[19:55:35] [Server thread/WARN]:    at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:431)
[19:55:35] [Server thread/WARN]:    at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:831)
[19:55:35] [Server thread/WARN]:    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:683)
[19:55:35] [Server thread/WARN]:    at java.lang.Thread.run(Unknown Source)

Thermos Version: 52 beta Forge Version: 1614

JewishDog commented 8 years ago

Ооо, Redserver. Как у вас дела?)

sameer commented 8 years ago

This is not my plugin? 0.o Вхат ышу ар ю хавинг

TheAndrey commented 8 years ago

@JewishDog хорошо.

@Robotia My plugin shows that the event is invoked at a time of C08PacketPlayerBlockPlacement and C0APacketAnimation.

sameer commented 8 years ago

@TheAndrey then it is accidentally done again?