My name is Jakob, I am interested in Kotlin and Minecraft modding using Fabric.
An overview of all links to my profiles and more can be found on my homepage.
Extended Spigot and Bukkit API for Kotlin
Home Page: https://jakobkmar.github.io/KSpigot
License: GNU General Public License v3.0
If I want to close a GUI after awaiting a process in a Coroutine, it throws this exception when I call the function guiInstance.gui.closeGUI()
:
java.util.ConcurrentModificationException: null
at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1013) ~[?:?]
at java.util.ArrayList$Itr.next(ArrayList.java:967) ~[?:?]
at com.github.prisonmc.shadow.net.axay.kspigot.extensions.bukkit.InventoryExtensionsKt.closeForViewers(InventoryExtensions.kt:19) ~[?:?]
at com.github.prisonmc.shadow.net.axay.kspigot.gui.GUI.unregisterAndClose(GUI.kt:48) ~[?:?]
at com.github.prisonmc.shadow.net.axay.kspigot.gui.GUIIndividual.closeGUI(GUI.kt:99) ~[?:?]
at com.github.prisonmc.game.shop.impl.prisoners.BlackMarket$gui$1$2$1.invoke(BlackMarket.kt:62) ~[?:?]
at com.github.prisonmc.game.shop.impl.prisoners.BlackMarket$gui$1$2$1.invoke(BlackMarket.kt:24) ~[?:?]
at com.github.prisonmc.shadow.net.axay.kspigot.gui.elements.GUIButton.onClickElement(GUIButton.kt:17) ~[?:?]
at com.github.prisonmc.shadow.net.axay.kspigot.gui.GUIElement.onClick(GUIElements.kt:17) ~[?:?]
at com.github.prisonmc.shadow.net.axay.kspigot.gui.GUIHolder$$special$$inlined$listen$1.onEvent(KSpigotListeners.kt:89) ~[?:?]
at com.github.prisonmc.shadow.net.axay.kspigot.gui.GUIHolder$$special$$inlined$listen$2.invoke(KSpigotListeners.kt:56) ~[?:?]
at com.github.prisonmc.shadow.net.axay.kspigot.gui.GUIHolder$$special$$inlined$listen$2.invoke(KSpigotListeners.kt) ~[?:?]
at com.github.prisonmc.shadow.net.axay.kspigot.event.KSpigotListenersKt$sam$i$org_bukkit_plugin_EventExecutor$0.execute(KSpigotListeners.kt) ~[?:?]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[patched_1.16.4.jar:git-Paper-313]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[patched_1.16.4.jar:git-Paper-313]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:607) ~[patched_1.16.4.jar:git-Paper-313]
at net.minecraft.server.v1_16_R3.PlayerConnection.a(PlayerConnection.java:2527) ~[patched_1.16.4.jar:git-Paper-313]
at net.minecraft.server.v1_16_R3.PacketPlayInWindowClick.a(SourceFile:32) ~[patched_1.16.4.jar:git-Paper-313]
at net.minecraft.server.v1_16_R3.PacketPlayInWindowClick.a(SourceFile:10) ~[patched_1.16.4.jar:git-Paper-313]
at net.minecraft.server.v1_16_R3.PlayerConnectionUtils.lambda$ensureMainThread$1(PlayerConnectionUtils.java:23) ~[patched_1.16.4.jar:git-Paper-313]
at net.minecraft.server.v1_16_R3.TickTask.run(SourceFile:18) ~[patched_1.16.4.jar:git-Paper-313]
at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:136) ~[patched_1.16.4.jar:git-Paper-313]
at net.minecraft.server.v1_16_R3.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[patched_1.16.4.jar:git-Paper-313]
at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:109) ~[patched_1.16.4.jar:git-Paper-313]
at net.minecraft.server.v1_16_R3.MinecraftServer.bb(MinecraftServer.java:1133) ~[patched_1.16.4.jar:git-Paper-313]
at net.minecraft.server.v1_16_R3.MinecraftServer.executeNext(MinecraftServer.java:1126) ~[patched_1.16.4.jar:git-Paper-313]
at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.awaitTasks(IAsyncTaskHandler.java:119) ~[patched_1.16.4.jar:git-Paper-313]
at net.minecraft.server.v1_16_R3.MinecraftServer.sleepForTick(MinecraftServer.java:1087) ~[patched_1.16.4.jar:git-Paper-313]
at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1001) ~[patched_1.16.4.jar:git-Paper-313]
at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:177) ~[patched_1.16.4.jar:git-Paper-313]
at java.lang.Thread.run(Thread.java:832) [?:?]
My code looks like this:
button(Slots.RowThreeSlotThree, ShopService.acceptItem) {
GlobalScope.launch {
// awaiting stuff
)
sync {
it.guiInstance.gui.closeGUI()
}
}
}
I have suggestions:
suggestListSuspending {
Bukkit.getOnlinePlayers().map { it.name }
}
When I executes any command with that suggestions, I get crash with error https://pastebin.com/XnjtZ9zf
I have Kotlin in my jar
Version: 1.20.3 (Minecraft 1.20.4)
Software: PaperMC #496
Errors / Stacktraces: None
Problem Description:
I want to implement functionality to switch between different independent GUIs using changeGUI()
. For me this helps maintain GUI independence without merging them all into a single gui and using pages. However, there currently is an issue where the GUI targeted by changeGUI()
becomes unresponsive.
Steps to reproduce:
Player#openGui()
extension functionchangeGUI()
button to switch to another GUI (GUI B).Expected Behavior:
Clickable elements in GUI B should function normally and trigger corresponding event listeners or actions, as they do when accessed directly from their own GUI context.
Actual Behavior:
After using changeGUI()
to switch to GUI B, none of the elements within GUI B respond to clicks or other interactions. All the items are in the right places, but it appears as though the event listeners are not active or are not recognizing interactions.
Additional Information:
changeGUI()
button is the only function that doesn't work for me. Other buttons that change around items like changePage()
, nextPage()
, or previousPage()
work without any problems, so this has probably to do with how the gui gets registered when opening?Player#openGui()
inside a action of a normal button works but resets the mouse cursor to the center, as it closes the current inventory before opening the new GUI, so this isn't really a good solution for me.When I switch the page via the gotoPage function and I switch back, things like buttons aren't working anymore.
What about change all legacy strings to adventure components? And add adventure utils (for ex. String.contentToComponent() = Component.text(this) and String.legacyToComponent() = LegacyComponentSerializer.legacyAmpersand().deserialize(this) and Component.toLegacy() = LegacyComponentSerializer.legacyAmpersand().serialize(this))
In order to guarantee a consistent code style across this project as well as in regard to other Kotlin code, I suggest the use of the Kotlin style guide.
The main documentation can be found here, with a more detailed migration guide also available here.
I believe that this code style is optimally designed for use with Kotlin and works very well, while allowing everyone to easily adapt and contribute. It is available in major IDE's like IntellJ, meaning no .editorconfig
or similar would be required to define style guidelines.
idk if this is still being maintained and I know its very easy to just fork and change but just wanted to ask.
org.bukkit.command.CommandException: Unhandled exception executing 'randomrush start' in org.bukkit.craftbukkit.v1_18_R1.command.VanillaCommandWrapper(randomrush)
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:169) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_18_R1.CraftServer.dispatchCommand(CraftServer.java:907) ~[paper-1.18.1.jar:git-Paper-205]
at net.minecraft.server.network.ServerGamePacketListenerImpl.handleCommand(ServerGamePacketListenerImpl.java:2289) ~[?:?]
at net.minecraft.server.network.ServerGamePacketListenerImpl.handleChat(ServerGamePacketListenerImpl.java:2100) ~[?:?]
at net.minecraft.server.network.ServerGamePacketListenerImpl.handleChat(ServerGamePacketListenerImpl.java:2081) ~[?:?]
at net.minecraft.network.protocol.game.ServerboundChatPacket.handle(ServerboundChatPacket.java:46) ~[?:?]
at net.minecraft.network.protocol.game.ServerboundChatPacket.a(ServerboundChatPacket.java:6) ~[?:?]
at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$1(PacketUtils.java:56) ~[?:?]
at net.minecraft.server.TickTask.run(TickTask.java:18) ~[paper-1.18.1.jar:git-Paper-205]
at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:149) ~[?:?]
at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:23) ~[?:?]
at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1414) ~[paper-1.18.1.jar:git-Paper-205]
at net.minecraft.server.MinecraftServer.c(MinecraftServer.java:189) ~[paper-1.18.1.jar:git-Paper-205]
at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:122) ~[?:?]
at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1391) ~[paper-1.18.1.jar:git-Paper-205]
at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1384) ~[paper-1.18.1.jar:git-Paper-205]
at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:132) ~[?:?]
at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1362) ~[paper-1.18.1.jar:git-Paper-205]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1268) ~[paper-1.18.1.jar:git-Paper-205]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:317) ~[paper-1.18.1.jar:git-Paper-205]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.NoSuchMethodError: 'net.minecraft.commands.CommandSourceStack net.axay.kspigot.commands.CommandContext.getSender()'
at ru.snappyland.randomrush.command.AdminCommandKt$settingAdminCommand$lambda-2$$inlined$runs$1.run(Execution.kt:50) ~[RandomRush-plugin-1.0.0.jar:?]
at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:263) ~[paper-1.18.1.jar:?]
at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:177) ~[paper-1.18.1.jar:?]
at net.minecraft.commands.Commands.performCommand(Commands.java:291) ~[?:?]
at org.bukkit.craftbukkit.v1_18_R1.command.VanillaCommandWrapper.execute(VanillaCommandWrapper.java:45) ~[paper-1.18.1.jar:git-Paper-205]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:159) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
... 20 more
Code that causes error:
command(...) {
// ...
runs {
// ...
sender.bukkitSender.sendMessage(...)
// ^ ^ error causes here
}
}
In order to remove content from an GUI compound
I would appreciate a function like removeContent() as a complement to addContent()
This is not the issue about a problem but the issue about readme and docs
I was thinking about trying different libraries for making spigot plugins. By default I tried to use shadowJar to pack my plugin, but I was receiving weird error about paper runtime not having net.minecraft.commands.CommandSourceStack
in the runtime classpath. My build script was fine. After fiddling with libraries and playing mind games with docs, I tried building plain java jar using jar
task and exception disappeared. I personally don't know why building with shadowJar was causing this, maybe if someone tried to prove that shadowJar was the main cause of the exception, readme and docs can be appended with don't use shadowJar. To reproduce the exception just add shadowJar in the example buildscript in docs and try to use command
I am a bit confused that KSpigot uses paper dependencies as main minecraft dependency. Is there any functionality in the KSpigot that depends on only Paper functionality? That would be awesome to see in docs
kspigot 1.18.0 commands dont work on 1.18.2 so please publish the new version ๐
I am currently working on a plugin, however an error when loading the plugin is preventing me from implementing it.
[19:30:26 ERROR]: Error occurred while enabling Tavern v1.0-SNAPSHOT (Is it up to date?)
java.lang.NoClassDefFoundError: org/bukkit/craftbukkit/v1_19_R3/CraftServer
at net.axay.kspigot.commands.internal.BrigardierSupport.resolveCommandManager(BrigardierSupport.kt:36) ~[?:?]
at net.axay.kspigot.commands.internal.BrigardierSupport.registerAll$KSpigot(BrigardierSupport.kt:45) ~[?:?]
at net.axay.kspigot.main.KSpigot.onEnable(KSpigot.kt:71) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:542) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugin(CraftServer.java:565) ~[paper-1.19.2.jar:git-Paper-307]
at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugins(CraftServer.java:479) ~[paper-1.19.2.jar:git-Paper-307]
at org.bukkit.craftbukkit.v1_19_R1.CraftServer.reload(CraftServer.java:1025) ~[paper-1.19.2.jar:git-Paper-307]
at org.bukkit.Bukkit.reload(Bukkit.java:930) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:54) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:155) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_19_R1.CraftServer.dispatchCommand(CraftServer.java:916) ~[paper-1.19.2.jar:git-Paper-307]
at org.bukkit.craftbukkit.v1_19_R1.CraftServer.dispatchServerCommand(CraftServer.java:879) ~[paper-1.19.2.jar:git-Paper-307]
at net.minecraft.server.dedicated.DedicatedServer.handleConsoleInputs(DedicatedServer.java:500) ~[paper-1.19.2.jar:git-Paper-307]
at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:447) ~[paper-1.19.2.jar:git-Paper-307]
at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1397) ~[paper-1.19.2.jar:git-Paper-307]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1173) ~[paper-1.19.2.jar:git-Paper-307]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:305) ~[paper-1.19.2.jar:git-Paper-307]
at java.lang.Thread.run(Thread.java:1623) ~[?:?]
Caused by: java.lang.ClassNotFoundException: org.bukkit.craftbukkit.v1_19_R3.CraftServer
at java.net.URLClassLoader.findClass(URLClassLoader.java:445) ~[?:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:588) ~[?:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:521) ~[?:?]
... 20 more
[19:30:26 INFO]: [Tavern] Disabling Tavern v1.0-SNAPSHOT
[19:30:26 INFO]: [Tavern] Disabled
name: Tavern
version: '${version}'
main: io.klebe.tavern.Plugin
api-version: 1.19
libraries:
- "net.axay:kspigot:1.19.2"
commands:
tavern:
description: Tavern-Plugin Commands
usage: /<command> <subcommand>
plugins {
id 'idea'
id 'java'
id 'org.jetbrains.kotlin.jvm' version '1.8.10'
//id 'com.github.johnrengelman.shadow' version '2.0.4'
id 'io.papermc.paperweight.userdev' version "1.5.5"
}
group = 'io.klebe'
version = '1.0-SNAPSHOT'
idea {
module {
downloadJavadoc = true
downloadSources = true
}
}
repositories {
mavenCentral()
maven {
name = 'papermc-repo'
url = 'https://repo.papermc.io/repository/maven-public/'
}
maven {
name = 'sonatype'
url = 'https://oss.sonatype.org/content/groups/public/'
}
maven {
url = "https://libraries.minecraft.net"
}
}
dependencies {
paperweight.paperDevBundle "1.19.4-R0.1-SNAPSHOT"
implementation 'net.axay:kspigot:1.19.2'
}
def targetJavaVersion = 17
java {
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
if (JavaVersion.current() < javaVersion) {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}
}
tasks {
build {
dependsOn(reobfJar)
}
compileJava {
options.encoding = "UTF-8"
options.release.set targetJavaVersion
}
compileKotlin {
kotlinOptions.jvmTarget = targetJavaVersion
}
}
processResources {
def props = [version: version]
inputs.properties props
filteringCharset 'UTF-8'
filesMatching('plugin.yml') {
expand props
}
}
compileKotlin {
kotlinOptions {
jvmTarget = targetJavaVersion
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = targetJavaVersion
}
}
Server: Paper version git-Paper-307 (MC: 1.19.2) (Implementing API version 1.19.2-R0.1-SNAPSHOT) (Git: 476ef25)
Also tested with: paper-1.19.4-550
and paper-1.20.1-18
~ same error
Is this a bug or did I miss something?
Currently KSpigot is licensed under Apache. However, you are subclassing JavaPlugin - which is licensed under bukkit's GPL license
This creates a derivative work, shown from GPL's FAQ: https://www.gnu.org/licenses/gpl-faq.en.html#OOPLang
Therefore, KSpigot must be licensed under GPL rather than Apache in order to continue using Bukkit without copyright infringement.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.