Skip to content

Commit

Permalink
feat: 1.20.5+ support
Browse files Browse the repository at this point in the history
  • Loading branch information
Boy0000 committed May 18, 2024
1 parent 7c24e3d commit d8d0a4d
Show file tree
Hide file tree
Showing 16 changed files with 298 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
java-version: 21
cache: gradle

- name: Build
Expand Down
43 changes: 23 additions & 20 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import io.papermc.paperweight.userdev.ReobfArtifactConfiguration
import net.minecrell.pluginyml.paper.PaperPluginDescription

plugins {
Expand All @@ -8,19 +9,19 @@ plugins {
id("com.mineinabyss.conventions.autoversion")
id("xyz.jpenilla.run-paper") version "2.0.1" // Adds runServer and runMojangMappedServer tasks for testing
id("net.minecrell.plugin-yml.paper") version "0.6.0"
id("io.papermc.paperweight.userdev") version "1.5.11"
id("io.papermc.paperweight.userdev") version "1.7.1"
}

paperweight.reobfArtifactConfiguration.set(ReobfArtifactConfiguration.MOJANG_PRODUCTION)

allprojects {
apply(plugin = "java")

version = rootProject.version

dependencies {
compileOnly(kotlin("stdlib-jdk8"))
}

repositories {
maven("https://repo.mineinabyss.com/releases")
maven("https://repo.mineinabyss.com/snapshots")
mavenLocal()
}
}
Expand All @@ -34,14 +35,15 @@ dependencies {
compileOnly(idofrontLibs.minecraft.mccoroutine)

// Shaded
paperweight.paperDevBundle("1.20.4-R0.1-SNAPSHOT") //NMS
paperweight.paperDevBundle("1.20.6-R0.1-SNAPSHOT") //NMS
implementation(project(path = ":core"))
implementation(project(path = ":v1_19_R1", configuration = "reobf"))
implementation(project(path = ":v1_19_R2", configuration = "reobf"))
implementation(project(path = ":v1_19_R3", configuration = "reobf"))
implementation(project(path = ":v1_20_R1", configuration = "reobf"))
implementation(project(path = ":v1_20_R2", configuration = "reobf"))
implementation(project(path = ":v1_20_R3", configuration = "reobf"))
//implementation(project(path = ":v1_19_R1", configuration = "reobf"))
//implementation(project(path = ":v1_19_R2", configuration = "reobf"))
//implementation(project(path = ":v1_19_R3", configuration = "reobf"))
//implementation(project(path = ":v1_20_R1", configuration = "reobf"))
//implementation(project(path = ":v1_20_R2", configuration = "reobf"))
//implementation(project(path = ":v1_20_R3", configuration = "reobf"))
implementation(project(path = ":v1_20_R4"))
}

tasks {
Expand All @@ -52,7 +54,7 @@ tasks {

compileJava {
options.encoding = Charsets.UTF_8.name()
options.release.set(17)
options.release.set(21)
}

javadoc {
Expand All @@ -69,12 +71,13 @@ tasks {
}

shadowJar {
dependsOn(":v1_19_R1:reobfJar")
dependsOn(":v1_19_R2:reobfJar")
dependsOn(":v1_19_R3:reobfJar")
dependsOn(":v1_20_R1:reobfJar")
dependsOn(":v1_20_R2:reobfJar")
dependsOn(":v1_20_R3:reobfJar")
//dependsOn(":v1_19_R1:reobfJar")
//dependsOn(":v1_19_R2:reobfJar")
//dependsOn(":v1_19_R3:reobfJar")
//dependsOn(":v1_20_R1:reobfJar")
//dependsOn(":v1_20_R2:reobfJar")
//dependsOn(":v1_20_R3:reobfJar")
dependsOn(":v1_20_R4:reobfJar")
archiveFileName.set("Emojy.jar")
}

Expand All @@ -88,7 +91,7 @@ paper {
val version: String by project
this.version = version
authors = listOf("boy0000")
apiVersion = "1.19"
apiVersion = "1.20"

serverDependencies {
register("Idofront") {
Expand Down
1 change: 1 addition & 0 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ plugins {
repositories {
gradlePluginPortal()
maven("https://repo.mineinabyss.com/releases")
maven("https://repo.mineinabyss.com/snapshots")
maven("https://repo.papermc.io/repository/maven-public/")
maven("https://repo.unnamed.team/repository/unnamed-public/")
google()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ import org.bukkit.entity.Player

object EmojyNMSHandlers {

private val SUPPORTED_VERSION = arrayOf("v1_19_R1", "v1_19_R2", "v1_19_R3", "v1_20_R1", "v1_20_R2", "v1_20_R3")
private val SUPPORTED_VERSION = arrayOf(/*"v1_19_R1", "v1_19_R2", "v1_19_R3", "v1_20_R1", "v1_20_R2", "v1_20_R3", */"v1_20_R4")

fun setup(): IEmojyNMSHandler {
SUPPORTED_VERSION.forEach { version ->
runCatching {
Class.forName("org.bukkit.craftbukkit.$version.entity.CraftPlayer")
//Class.forName("org.bukkit.craftbukkit.entity.CraftPlayer")
return Class.forName("com.mineinabyss.emojy.nms.${version}.EmojyNMSHandler").getConstructor()
.newInstance() as IEmojyNMSHandler
}
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
group=com.mineinabyss
version=0.8
idofrontVersion=0.23.0
version=0.9
idofrontVersion=0.24.0-dev.10
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 3 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ pluginManagement {
mavenCentral()
google()
maven("https://repo.mineinabyss.com/releases")
maven("https://repo.mineinabyss.com/snapshots")
maven("https://repo.papermc.io/repository/maven-public/")
mavenLocal()
}
Expand All @@ -23,6 +24,7 @@ dependencyResolutionManagement {

repositories {
maven("https://repo.mineinabyss.com/releases")
maven("https://repo.mineinabyss.com/snapshots")
mavenLocal()
}

Expand All @@ -33,4 +35,4 @@ dependencyResolutionManagement {
}
}

include("core", "v1_19_R1", "v1_19_R2", "v1_19_R3", "v1_20_R1", "v1_20_R2", "v1_20_R3")
include("core", /*"v1_19_R1", "v1_19_R2", "v1_19_R3", "v1_20_R1", "v1_20_R2", */"v1_20_R3", "v1_20_R4")
5 changes: 3 additions & 2 deletions v1_19_R1/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
plugins {
id("com.mineinabyss.conventions.kotlin.jvm")
id("com.mineinabyss.conventions.autoversion")
id("io.papermc.paperweight.userdev") version "1.5.11"
id("io.papermc.paperweight.userdev") version "1.7.1"
}

repositories {
gradlePluginPortal()
maven("https://repo.mineinabyss.com/releases")
maven("https://repo.mineinabyss.com/snapshots")
maven("https://repo.papermc.io/repository/maven-public/")
google()
}
Expand All @@ -32,7 +33,7 @@ tasks {

compileJava {
options.encoding = Charsets.UTF_8.name()
options.release.set(17)
options.release.set(21)
}
javadoc {
options.encoding = Charsets.UTF_8.name()
Expand Down
5 changes: 3 additions & 2 deletions v1_19_R2/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
plugins {
id("com.mineinabyss.conventions.kotlin.jvm")
id("com.mineinabyss.conventions.autoversion")
id("io.papermc.paperweight.userdev") version "1.5.11"
id("io.papermc.paperweight.userdev") version "1.7.1"
}

repositories {
gradlePluginPortal()
maven("https://repo.mineinabyss.com/releases")
maven("https://repo.mineinabyss.com/snapshots")
maven("https://repo.papermc.io/repository/maven-public/")
google()
}
Expand All @@ -32,7 +33,7 @@ tasks {

compileJava {
options.encoding = Charsets.UTF_8.name()
options.release.set(17)
options.release.set(21)
}
javadoc {
options.encoding = Charsets.UTF_8.name()
Expand Down
5 changes: 3 additions & 2 deletions v1_19_R3/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
plugins {
id("com.mineinabyss.conventions.kotlin.jvm")
id("com.mineinabyss.conventions.autoversion")
id("io.papermc.paperweight.userdev") version "1.5.11"
id("io.papermc.paperweight.userdev") version "1.7.1"
}

repositories {
gradlePluginPortal()
maven("https://repo.mineinabyss.com/releases")
maven("https://repo.mineinabyss.com/snapshots")
maven("https://repo.papermc.io/repository/maven-public/")
google()
}
Expand All @@ -32,7 +33,7 @@ tasks {

compileJava {
options.encoding = Charsets.UTF_8.name()
options.release.set(17)
options.release.set(21)
}
javadoc {
options.encoding = Charsets.UTF_8.name()
Expand Down
5 changes: 3 additions & 2 deletions v1_20_R1/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
plugins {
id("com.mineinabyss.conventions.kotlin.jvm")
id("com.mineinabyss.conventions.autoversion")
id("io.papermc.paperweight.userdev") version "1.5.11"
id("io.papermc.paperweight.userdev") version "1.7.1"
}

repositories {
gradlePluginPortal()
maven("https://repo.mineinabyss.com/releases")
maven("https://repo.mineinabyss.com/snapshots")
maven("https://repo.papermc.io/repository/maven-public/")
google()
}
Expand All @@ -32,7 +33,7 @@ tasks {

compileJava {
options.encoding = Charsets.UTF_8.name()
options.release.set(17)
options.release.set(21)
}
javadoc {
options.encoding = Charsets.UTF_8.name()
Expand Down
5 changes: 3 additions & 2 deletions v1_20_R2/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
plugins {
id("com.mineinabyss.conventions.kotlin.jvm")
id("com.mineinabyss.conventions.autoversion")
id("io.papermc.paperweight.userdev") version "1.5.11"
id("io.papermc.paperweight.userdev") version "1.7.1"
}

repositories {
gradlePluginPortal()
maven("https://repo.mineinabyss.com/releases")
maven("https://repo.mineinabyss.com/snapshots")
maven("https://repo.papermc.io/repository/maven-public/")
google()
}
Expand All @@ -32,7 +33,7 @@ tasks {

compileJava {
options.encoding = Charsets.UTF_8.name()
options.release.set(17)
options.release.set(21)
}
javadoc {
options.encoding = Charsets.UTF_8.name()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import io.netty.handler.codec.ByteToMessageDecoder
import io.netty.handler.codec.MessageToByteEncoder
import io.papermc.paper.adventure.PaperAdventure
import net.kyori.adventure.text.Component
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer
import net.minecraft.nbt.CompoundTag
import net.minecraft.nbt.ListTag
import net.minecraft.nbt.StringTag
Expand Down Expand Up @@ -161,7 +162,7 @@ class EmojyNMSHandler : IEmojyNMSHandler {

override fun readUtf(maxLength: Int): String {
return super.readUtf(maxLength).let { string ->
runCatching { string.miniMsg() }.recover { legacy.deserialize(string) }
runCatching { string.miniMsg() }.recover { LegacyComponentSerializer.legacySection().deserialize(string) }
.getOrNull()?.transform(player, true)?.serialize() ?: string
}
}
Expand Down
5 changes: 3 additions & 2 deletions v1_20_R3/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
plugins {
id("com.mineinabyss.conventions.kotlin.jvm")
id("com.mineinabyss.conventions.autoversion")
id("io.papermc.paperweight.userdev") version "1.5.11"
id("io.papermc.paperweight.userdev") version "1.7.1"
}

repositories {
gradlePluginPortal()
maven("https://repo.mineinabyss.com/releases")
maven("https://repo.mineinabyss.com/snapshots")
maven("https://repo.papermc.io/repository/maven-public/")
google()
}
Expand All @@ -32,7 +33,7 @@ tasks {

compileJava {
options.encoding = Charsets.UTF_8.name()
options.release.set(17)
options.release.set(21)
}
javadoc {
options.encoding = Charsets.UTF_8.name()
Expand Down
48 changes: 48 additions & 0 deletions v1_20_R4/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import io.papermc.paperweight.userdev.ReobfArtifactConfiguration

plugins {
id("com.mineinabyss.conventions.kotlin.jvm")
id("com.mineinabyss.conventions.autoversion")
id("io.papermc.paperweight.userdev") version "1.7.1"
}

repositories {
gradlePluginPortal()
maven("https://repo.mineinabyss.com/releases")
maven("https://repo.mineinabyss.com/snapshots")
maven("https://repo.papermc.io/repository/maven-public/")
google()
}

paperweight.reobfArtifactConfiguration.set(ReobfArtifactConfiguration.MOJANG_PRODUCTION)

dependencies {
// MineInAbyss platform
compileOnly(idofrontLibs.kotlinx.serialization.json)
compileOnly(idofrontLibs.kotlinx.serialization.kaml)
compileOnly(idofrontLibs.kotlinx.coroutines)
compileOnly(idofrontLibs.minecraft.mccoroutine)

// Shaded
implementation(idofrontLibs.bundles.idofront.core)
implementation(project(":core"))
paperweight.paperDevBundle("1.20.6-R0.1-SNAPSHOT") //NMS
}

tasks {

build {
dependsOn(reobfJar)
}

compileJava {
options.encoding = Charsets.UTF_8.name()
options.release.set(21)
}
javadoc {
options.encoding = Charsets.UTF_8.name()
}
processResources {
filteringCharset = Charsets.UTF_8.name()
}
}
Loading

0 comments on commit d8d0a4d

Please sign in to comment.