Attempting to cancel a non cancellable event
tenten8401 opened this issue ยท 5 comments
Left clicking with an unpackaged banned item crashes the client.
[B#347] [16:17:44] [Client thread/FATAL]: Unreported exception thrown!
[B#347] java.lang.IllegalArgumentException: Attempted to cancel a non cancellable event
[B#347] at net.minecraftforge.fml.common.eventhandler.Event.setCanceled(Event.java:93) ~[Event.class:?]
[B#347] at net.doubledoordev.itemblacklist.util.ServerEventHandlers.playerInteractEvent(ServerEventHandlers.java:104) ~[ServerEventHandlers.class:?]
[B#347] at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_471_ServerEventHandlers_playerInteractEvent_PlayerInteractEvent.invoke(.dynamic) ~[?:?]
[B#347] at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:72) ~[ASMEventHandler.class:?]
[B#347] at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:168) ~[EventBus.class:?]
[B#347] at net.minecraftforge.common.ForgeHooks.onEmptyLeftClick(ForgeHooks.java:1012) ~[ForgeHooks.class:?]
[B#347] at net.minecraft.client.Minecraft.func_147116_af(Minecraft.java:1471) ~[bcx.class:?]
[B#347] at net.minecraft.client.Minecraft.func_184117_aA(Minecraft.java:2179) ~[bcx.class:?]
[B#347] at net.minecraft.client.Minecraft.func_184118_az(Minecraft.java:1961) ~[bcx.class:?]
[B#347] at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:1749) ~[bcx.class:?]
[B#347] at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1055) ~[bcx.class:?]
[B#347] at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:371) [bcx.class:?]
[B#347] at net.minecraft.client.main.Main.main(SourceFile:124) [Main.class:?]
[B#347] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_101]
[B#347] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_101]
[B#347] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_101]
[B#347] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_101]
[B#347] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
[B#347] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
So the item was not in locked form? What item was it?
What version of forge and the mod are you using?
ps: if you use the ```
to surround code, put it around the text, on a new line. It looks much better now ๐
Pulled the item from the creative menu, it was a sponge. Banning said sponge and left clicking with it will crash the client. Using forge 12.18.1.2045 and ItemBlacklist 1.9.4-1.2.0.11. Plus, I think this should check their inventory on events such as crafting the item and let them know it's banned before they craft it.
Ok, will verify and fix.
I'm trying my best to avoid ASMing in stuff, and that would, last I checked, require ASM hooks.
Not to self: When catching events with sub-events (or in general really) use if (event.isCancelable())
before event.setCanceled(true);