Skip to content

Conversation

@Hai-tun
Copy link

@Hai-tun Hai-tun commented Dec 20, 2020

Upgrade menu module

@DevSrSouza
Copy link
Owner

Hey @Hai-tun, this for the PR, but, you can explain the changes that this PR does?

@Hai-tun
Copy link
Author

Hai-tun commented Dec 21, 2020


menu : Separate cancelOnClick into cancelOnTopClick(defalut = true) and cancelOnBottomClick(defalut = false)
(The bottom inventory will be clickable and moveable)


top drag : Changed from canceling the event to returning the illegally dragged item back to the cursor


bottom inventory double click : Add anti illegal bottom inventory shift click


bottom inventory shift click : Add anti illegal bottom inventory shift click


related errors:
[13:49:45] [Server thread/WARN]: java.lang.ClassCastException: org.bukkit.craftbukkit.v1_16_R3.command.ColouredConsoleSender cannot be cast to org.bukkit.entity.Player
[13:49:45] [Server thread/WARN]: 	at moe.orangemc.userservice.Main$onPluginEnable$5$1.invokeSuspend(Main.kt:83)
[13:49:45] [Server thread/WARN]: 	at moe.orangemc.userservice.Main$onPluginEnable$5$1.invoke(Main.kt)
[13:49:45] [Server thread/WARN]: 	at br.com.devsrsouza.kotlinbukkitapi.dsl.command.CommandDSL$execute$1$1.invokeSuspend(CommandDSL.kt:193)
[13:49:45] [Server thread/WARN]: 	at br.com.devsrsouza.kotlinbukkitapi.dsl.command.CommandDSL$execute$1$1.invoke(CommandDSL.kt)
[13:49:45] [Server thread/WARN]: 	at br.com.devsrsouza.kotlinbukkitapi.dsl.command.CommandDSL.treatFail(CommandDSL.kt:251)
[13:49:45] [Server thread/WARN]: 	at br.com.devsrsouza.kotlinbukkitapi.dsl.command.CommandDSL$execute$1.invokeSuspend(CommandDSL.kt:192)
[13:49:45] [Server thread/WARN]: 	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
[13:49:45] [Server thread/WARN]: 	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
[13:49:45] [Server thread/WARN]: 	at com.okkero.skedule.BukkitDispatcher.dispatch(BukkitDispatcher.kt:45)
[13:49:45] [Server thread/WARN]: 	at kotlinx.coroutines.DispatchedContinuationKt.resumeCancellableWith(DispatchedContinuation.kt:288)
[13:49:45] [Server thread/WARN]: 	at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable(Cancellable.kt:26)
[13:49:45] [Server thread/WARN]: 	at kotlinx.coroutines.CoroutineStart.invoke(CoroutineStart.kt:109)
[13:49:45] [Server thread/WARN]: 	at kotlinx.coroutines.AbstractCoroutine.start(AbstractCoroutine.kt:158)
[13:49:45] [Server thread/WARN]: 	at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(Builders.common.kt:56)
[13:49:45] [Server thread/WARN]: 	at kotlinx.coroutines.BuildersKt.launch(Unknown Source)
[13:49:45] [Server thread/WARN]: 	at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch$default(Builders.common.kt:49)
[13:49:45] [Server thread/WARN]: 	at kotlinx.coroutines.BuildersKt.launch$default(Unknown Source)
[13:49:45] [Server thread/WARN]: 	at br.com.devsrsouza.kotlinbukkitapi.dsl.command.CommandDSL.execute(CommandDSL.kt:190)
[13:49:45] [Server thread/WARN]: 	at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:149)
[13:49:45] [Server thread/WARN]: 	at org.bukkit.craftbukkit.v1_16_R3.CraftServer.dispatchCommand(CraftServer.java:763)
[13:49:45] [Server thread/WARN]: 	at org.bukkit.craftbukkit.v1_16_R3.CraftServer.dispatchServerCommand(CraftServer.java:748)
[13:49:45] [Server thread/WARN]: 	at net.minecraft.server.v1_16_R3.DedicatedServer.handleCommandQueue(DedicatedServer.java:387)
[13:49:45] [Server thread/WARN]: 	at net.minecraft.server.v1_16_R3.DedicatedServer.b(DedicatedServer.java:356)
[13:49:45] [Server thread/WARN]: 	at net.minecraft.server.v1_16_R3.MinecraftServer.a(MinecraftServer.java:1008)
[13:49:45] [Server thread/WARN]: 	at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:847)
[13:49:45] [Server thread/WARN]: 	at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$0(MinecraftServer.java:164)
[13:49:45] [Server thread/WARN]: 	at java.lang.Thread.run(Thread.java:748)
@Hai-tun
Copy link
Author

Hai-tun commented Jan 8, 2021

@DevSrSouza Add an executor priority fix

@Hai-tun
Copy link
Author

Hai-tun commented Jan 8, 2021

@DevSrSouza Plz, review code and merge.

@devnatan
Copy link

devnatan commented Jan 18, 2021

i think it would be better if you kept the cancelOnClick parameter of the menu func, for reasons of backward compatibility.

@Hai-tun
Copy link
Author

Hai-tun commented Jan 19, 2021

It seems to be able to improve compatibility by that way... but in fact, the signature of the method has changed due to the addition of parameters. So even if cancelOnClick is not modified, the bytecode still unable to be compatible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants