From 5e52a1327d2778caf11c6df6ec0c0daffc0201c9 Mon Sep 17 00:00:00 2001 From: xuyin <1573880184@qq.com> Date: Sun, 29 Dec 2024 13:05:02 +0800 Subject: [PATCH 1/2] Update to 3.4.0. --- build.gradle.kts | 31 +++++++----------- settings.gradle.kts | 1 - .../tag/compound/CompoundTag.java | 5 --- .../github/xiefrish2021/tag/list/ListTag.java | 5 +++ .../kotlin/me/coderfrish/test/KotlinTest.kt | 23 ------------- src/test/resources/test.nbt | Bin 95 -> 47 bytes 6 files changed, 17 insertions(+), 48 deletions(-) delete mode 100644 src/test/kotlin/me/coderfrish/test/KotlinTest.kt diff --git a/build.gradle.kts b/build.gradle.kts index d7c1c02..164a38e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,11 +1,10 @@ plugins { - id("java") - id("maven-publish") - kotlin("jvm") version "2.0.0" + java + `maven-publish` } group = "io.github.xiefrish2021" -version = "3.4.0-20241229-pre" +version = "3.4.0" repositories { mavenCentral() @@ -13,31 +12,30 @@ repositories { dependencies { implementation("org.jetbrains:annotations:26.0.1") - implementation("org.jetbrains.kotlin:kotlin-stdlib:1.6.0") } java { - sourceCompatibility = JavaVersion.VERSION_22 - targetCompatibility = JavaVersion.VERSION_22 + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 + + withJavadocJar() + withSourcesJar() } tasks.withType() { destinationDirectory = layout.buildDirectory.dir("targets") } -java { - withJavadocJar() - withSourcesJar() -} - publishing { repositories { repositories { maven("https://repo.menthamc.com/repository/maven-releases/") { name = "MenthaMC" credentials { - username = System.getenv("MAVEN_USERNAME") - password = System.getenv("MAVEN_PASSWORD") +// username = System.getenv("MAVEN_USERNAME") +// password = System.getenv("MAVEN_PASSWORD") + username = "coderfrish" + password = "20100422Frish2021" } } } @@ -75,11 +73,6 @@ publishing { developerConnection = "scm:git:ssh://github.com/XieFrish2021/NBT.git" url = "https://github.com/XieFrish2021/NBT" } - - dependencies { - implementation("org.jetbrains:annotations:26.0.1") - implementation("org.jetbrains.kotlin:kotlin-stdlib:1.6.0") - } } } } diff --git a/settings.gradle.kts b/settings.gradle.kts index af9be77..52c1ef5 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -7,4 +7,3 @@ pluginManagement { } rootProject.name = "NBT" - diff --git a/src/main/java/io/github/xiefrish2021/tag/compound/CompoundTag.java b/src/main/java/io/github/xiefrish2021/tag/compound/CompoundTag.java index 14d7462..1eef506 100644 --- a/src/main/java/io/github/xiefrish2021/tag/compound/CompoundTag.java +++ b/src/main/java/io/github/xiefrish2021/tag/compound/CompoundTag.java @@ -1,6 +1,5 @@ package io.github.xiefrish2021.tag.compound; -import kotlin.reflect.KProperty; import org.jetbrains.annotations.NotNull; import io.github.xiefrish2021.ITag; import io.github.xiefrish2021.TagType; @@ -156,10 +155,6 @@ public String toString() { return builder.toString(); } - public @NotNull NBTElement getValue(@Nullable Void nothing, @NotNull KProperty property) { - return get(property.getName()); - } - public interface Entry { String key(); diff --git a/src/main/java/io/github/xiefrish2021/tag/list/ListTag.java b/src/main/java/io/github/xiefrish2021/tag/list/ListTag.java index 13c3a54..210ad37 100644 --- a/src/main/java/io/github/xiefrish2021/tag/list/ListTag.java +++ b/src/main/java/io/github/xiefrish2021/tag/list/ListTag.java @@ -56,6 +56,11 @@ public V getFirst() { return get(0); } + public ListTag set(int index, V value) { + list.set(index, value); + return this; + } + public V getLast() { return get(size()); } diff --git a/src/test/kotlin/me/coderfrish/test/KotlinTest.kt b/src/test/kotlin/me/coderfrish/test/KotlinTest.kt deleted file mode 100644 index 4806306..0000000 --- a/src/test/kotlin/me/coderfrish/test/KotlinTest.kt +++ /dev/null @@ -1,23 +0,0 @@ -package me.coderfrish.test - -import io.github.xiefrish2021.NBT -import io.github.xiefrish2021.tag.array.ByteArrayTag -import io.github.xiefrish2021.tag.compound.NBTElement -import java.io.FileInputStream - -fun main() { - val nbt = NBT.getInstance() -// val compound = CompoundTag() - -// compound.put("hello", StringTag("Frish2021")) -// nbt.writeUnnamedNBT(compound, FileOutputStream("D:\\NBT\\src\\test\\resources\\test1.nbt")) - - val compound = nbt.readUnnamedNBT(FileInputStream("D:\\NBT\\src\\test\\resources\\test.nbt")) -// println(compound["hello"].asString()) -// val hello: NBTElement by compound -// println(hello.asString) -// println(compound["hello"].asString) -// println(hello) - val sa: NBTElement by compound - println(sa.asIntArray) -} diff --git a/src/test/resources/test.nbt b/src/test/resources/test.nbt index f9b7a1fe175eba513ad9ffb2e255ef1f9f25a412..ea9e802d93b1c2c9ab5929ee61837e1d34ca31b1 100644 GIT binary patch literal 47 zcmd;LVBlb2DM>9ZVc>Kt$}G+>GB7e^W?(B$D^5u(W?&G~V`pH>NM&GPU@k5$W&i-@ CC<&zi literal 95 zcmXAf%?&_67zHP5 Date: Sun, 29 Dec 2024 13:06:15 +0800 Subject: [PATCH 2/2] Update to 3.4.0. --- CHANGES.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 8057cd6..69cd03e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,9 @@ # 版本更新 (3.0.0开始算起): +### 3.4.0 - 更新 + - 移除了kotlin委托 + - 正式发布了3.4.0版本 + ### 3.4.0-20241229-pre - 更新 - 修改了部分代码 - 删除了多余的Exception并把他们的用法全改成了NBTException