Compare commits

...

5 Commits

Author SHA1 Message Date
fafeef079f chore(build): Update versions to match upstream and commit build publishing changes 2024-08-09 09:48:25 -06:00
Leander Riefel
f8ff18c19b Fix unregistering the wrong GUI on InventoryCloseEvent (#69)
* fix unregistering the wrong gui

* removed unused import

* fix indentation

(cherry picked from commit 35c4c77869)
2024-08-09 09:11:31 -06:00
Leander Riefel
35c4c77869 Fix unregistering the wrong GUI on InventoryCloseEvent (#69)
* fix unregistering the wrong gui

* removed unused import

* fix indentation
2024-08-08 16:01:13 +02:00
Paul Kindler
85bc92aee1 Update to 1.21 (#68)
* update project version, update papermc version

* Use correct versioning pattern

---------

Co-authored-by: Jakob K <jakob.kmar@gmail.com>
2024-08-08 01:49:59 +02:00
Marlon
77e2e72f06 Update to Minecraft 1.20.6 (#66)
* bump dependencies + updated to minecraft version 1.20.6 & java 21

* moved to stable kotlinx dependencies

* Change versions for 1.20.6 update

* Make 1.20.6 update compile

---------

Co-authored-by: Jakob K <dev@jakobk.de>
2024-05-31 18:19:02 +02:00
4 changed files with 30 additions and 26 deletions

View File

@@ -1,23 +1,22 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
val githubRepo = "jakobkmar/KSpigot"
group = "net.axay"
version = "1.20.1"
version = "1.20.1.2-VAL"
description = "A Kotlin API for Minecraft plugins using the Spigot or Paper toolchain"
plugins {
kotlin("jvm") version "1.8.22"
kotlin("plugin.serialization") version "1.8.22"
kotlin("jvm") version "1.9.24"
kotlin("plugin.serialization") version "1.9.24"
`java-library`
`maven-publish`
signing
id("org.jetbrains.dokka") version "1.8.20"
id("org.jetbrains.dokka") version "1.9.20"
id("io.papermc.paperweight.userdev") version "1.5.5"
id("io.papermc.paperweight.userdev") version "1.7.1"
}
repositories {
@@ -27,9 +26,9 @@ repositories {
dependencies {
paperweight.paperDevBundle("1.20.1-R0.1-SNAPSHOT")
api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1")
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.1")
api("org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:1.7.1")
api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3")
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1")
api("org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:1.8.1")
}
tasks {
@@ -39,11 +38,11 @@ tasks {
withType<JavaCompile> {
options.encoding = "UTF-8"
options.release.set(17)
options.release.set(21)
}
withType<KotlinCompile> {
kotlinOptions.jvmTarget = "17"
compilerOptions.jvmTarget.set(JvmTarget.JVM_21)
}
dokkaHtml.configure {
@@ -56,15 +55,21 @@ java {
withJavadocJar()
}
//signing {
// sign(publishing.publications)
//}
val giteaToken: String by project
publishing {
repositories {
maven("https://oss.sonatype.org/service/local/staging/deploy/maven2") {
name = "ossrh"
credentials(PasswordCredentials::class)
maven("https://git.valence-smp.net/api/packages/star/maven") {
name = "gitea"
credentials(HttpHeaderCredentials::class) {
name = "Authorization"
value = "token $giteaToken"
}
authentication {
create<HttpHeaderAuthentication>("header")
}
}
}
@@ -94,11 +99,11 @@ publishing {
}
}
url.set("https://github.com/${githubRepo}")
url.set("https://git.valence-smp.net/api/packages/star/maven")
scm {
connection.set("scm:git:git://github.com/${githubRepo}.git")
url.set("https://github.com/${githubRepo}/tree/main")
connection.set("scm:git:git://git.valence-smp.net/api/packages/star/maven.git")
url.set("https://git.valence-smp.net/star/KSpigot")
}
}
}

View File

@@ -1,7 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View File

@@ -3,7 +3,6 @@ package net.axay.kspigot.chat;
import net.kyori.adventure.text.format.TextColor;
import net.kyori.adventure.text.format.TextDecoration;
import java.lang.reflect.Field;
import java.util.*;
import java.util.stream.Collectors;

View File

@@ -99,7 +99,9 @@ class GUIIndividual<T : ForInventory>(
init {
if (resetOnClose || data.onClose != null) {
listen<InventoryCloseEvent> {
if (data.onClose != null && playerInstances[it.player]?.bukkitInventory == it.inventory) {
if (playerInstances[it.player]?.bukkitInventory != it.inventory) return@listen
if (data.onClose != null) {
data.onClose.invoke(GUICloseEvent(it, playerInstances[it.player]!!, it.player as Player))
}