This repository has been archived by the owner on Jan 21, 2024. It is now read-only.
MapInitializeEvent cannot be triggered asynchronously from inside synchronized code. #109
Labels
bug
Something isn't working
Describe the bug
I have created a plugin which creates an image and places it on ItemFrame, the code works fine for all other forks or paperspigot or spigot itself but gives an error in WindSpigot.
[19:57:37] [nioEventLoopGroup-3-1/ERROR]: Could not pass event PlayerInteractEntityEvent to Bedwars1058-Cosmetics v1.0 org.bukkit.event.EventException: null at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:299) ~[WindSpigot-2.1.2.jar:] at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:74) ~[WindSpigot-2.1.2.jar:] at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:67) ~[WindSpigot-2.1.2.jar:] at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:511) ~[WindSpigot-2.1.2.jar:] at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:496) ~[WindSpigot-2.1.2.jar:] at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:1665) ~[WindSpigot-2.1.2.jar:] at net.minecraft.server.v1_8_R3.PacketPlayInUseEntity.a(PacketPlayInUseEntity.java:39) ~[WindSpigot-2.1.2.jar:] at net.minecraft.server.v1_8_R3.PacketPlayInUseEntity.a(PacketPlayInUseEntity.java:7) ~[WindSpigot-2.1.2.jar:] at net.minecraft.server.v1_8_R3.NetworkManager.a(NetworkManager.java:203) ~[WindSpigot-2.1.2.jar:] at net.minecraft.server.v1_8_R3.NetworkManager.channelRead0(NetworkManager.java:544) ~[WindSpigot-2.1.2.jar:] at net.minecraft.server.v1_8_R3.NetworkManager.channelRead0(NetworkManager.java:44) ~[WindSpigot-2.1.2.jar:] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99) ~[WindSpigot-2.1.2.jar:] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[WindSpigot-2.1.2.jar:] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[WindSpigot-2.1.2.jar:] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[WindSpigot-2.1.2.jar:] at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:93) ~[WindSpigot-2.1.2.jar:] at com.comphenix.tinyprotocol.TinyProtocol$PacketInterceptor.channelRead(TinyProtocol.java:331) ~[?:?] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[WindSpigot-2.1.2.jar:] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[WindSpigot-2.1.2.jar:] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[WindSpigot-2.1.2.jar:] at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324) ~[WindSpigot-2.1.2.jar:] at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296) ~[WindSpigot-2.1.2.jar:] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[WindSpigot-2.1.2.jar:] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[WindSpigot-2.1.2.jar:] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[WindSpigot-2.1.2.jar:] at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324) ~[WindSpigot-2.1.2.jar:] at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296) ~[WindSpigot-2.1.2.jar:] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[WindSpigot-2.1.2.jar:] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[WindSpigot-2.1.2.jar:] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[WindSpigot-2.1.2.jar:] at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324) ~[WindSpigot-2.1.2.jar:] at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:311) ~[WindSpigot-2.1.2.jar:] at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:432) ~[WindSpigot-2.1.2.jar:] at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:276) ~[WindSpigot-2.1.2.jar:] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[WindSpigot-2.1.2.jar:] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[WindSpigot-2.1.2.jar:] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[WindSpigot-2.1.2.jar:] at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286) ~[WindSpigot-2.1.2.jar:] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[WindSpigot-2.1.2.jar:] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[WindSpigot-2.1.2.jar:] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[WindSpigot-2.1.2.jar:] at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[WindSpigot-2.1.2.jar:] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[WindSpigot-2.1.2.jar:] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[WindSpigot-2.1.2.jar:] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[WindSpigot-2.1.2.jar:] at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166) ~[WindSpigot-2.1.2.jar:] at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:719) ~[WindSpigot-2.1.2.jar:] at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:655) ~[WindSpigot-2.1.2.jar:] at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:581) ~[WindSpigot-2.1.2.jar:] at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493) ~[WindSpigot-2.1.2.jar:] at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) ~[WindSpigot-2.1.2.jar:] at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[WindSpigot-2.1.2.jar:] at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[WindSpigot-2.1.2.jar:] at java.lang.Thread.run(Thread.java:829) ~[?:?] Caused by: java.lang.IllegalStateException: MapInitializeEvent cannot be triggered asynchronously from inside synchronized code. at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) ~[WindSpigot-2.1.2.jar:] at net.minecraft.server.v1_8_R3.ItemWorldMap.getSavedMap(ItemWorldMap.java:35) ~[WindSpigot-2.1.2.jar:] at org.bukkit.craftbukkit.v1_8_R3.CraftServer.createMap(CraftServer.java:1456) ~[WindSpigot-2.1.2.jar:] at org.bukkit.craftbukkit.v1_8_R3.CraftServer.createMap(CraftServer.java:172) ~[WindSpigot-2.1.2.jar:] at org.bukkit.Bukkit.createMap(Bukkit.java:556) ~[WindSpigot-2.1.2.jar:] at me.defender.cosmetics.Sprays.SpraysUtil.spawnSprays(SpraysUtil.java:52) ~[?:?] at me.defender.cosmetics.Sprays.OnRightClick.onRightClick(OnRightClick.java:32) ~[?:?] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?] at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?] at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:297) ~[WindSpigot-2.1.2.jar:] ... 53 more
SprayUtil.java line 52:
MapView view = Bukkit.createMap(p.getWorld());
OnRightClick.java line 32
SpraysUtil.spawnSprays(p, (ItemFrame) e.getRightClicked());
(reffers to the SprayUtil.java line 52Bug on latest
Yes
Expected behavior
It should put the map on itemframe
The text was updated successfully, but these errors were encountered: