From 9ac70846ce0a6314ddb467110b0c815a5ed5eb51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=B7=E6=B3=A2=20=E6=9B=BE?= Date: Fri, 22 Apr 2022 23:38:54 +0800 Subject: [PATCH 01/12] fix for worldedit 7.2.x --- .../arclight/patcher/definition/DefinitionMain.java | 1 + .../izzel/arclight/patcher/definition/WorldEdit.java | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/patcher-definition/src/main/java/io/izzel/arclight/patcher/definition/DefinitionMain.java b/patcher-definition/src/main/java/io/izzel/arclight/patcher/definition/DefinitionMain.java index 3f069f5..a808052 100644 --- a/patcher-definition/src/main/java/io/izzel/arclight/patcher/definition/DefinitionMain.java +++ b/patcher-definition/src/main/java/io/izzel/arclight/patcher/definition/DefinitionMain.java @@ -16,6 +16,7 @@ public class DefinitionMain implements PluginPatcher { static { SPECIFIC.put("com/sk89q/worldedit/bukkit/BukkitAdapter", WorldEdit::handleBukkitAdapter); + SPECIFIC.put("com/sk89q/worldedit/bukkit/adapter/Refraction", WorldEdit::handlePickName); GENERAL.add(WorldEdit::handleGetProperties); GENERAL.add(WorldEdit::handleWatchdog); } diff --git a/patcher-definition/src/main/java/io/izzel/arclight/patcher/definition/WorldEdit.java b/patcher-definition/src/main/java/io/izzel/arclight/patcher/definition/WorldEdit.java index 229efac..6e0a35b 100644 --- a/patcher-definition/src/main/java/io/izzel/arclight/patcher/definition/WorldEdit.java +++ b/patcher-definition/src/main/java/io/izzel/arclight/patcher/definition/WorldEdit.java @@ -50,6 +50,17 @@ public static void handleBukkitAdapter(ClassNode node, PluginPatcher.ClassRepo r } } + public static void handlePickName(ClassNode node, PluginPatcher.ClassRepo repo) { + for (MethodNode method : node.methods) { + if (method.name.equals("pickName")) { + method.instructions.clear(); + method.instructions.add(new VarInsnNode(Opcodes.ALOAD, 1)); + method.instructions.add(new InsnNode(Opcodes.ARETURN)); + return; + } + } + } + private static void handleAdapt(ClassNode node, MethodNode standardize, MethodNode method) { switch (method.desc) { case "(Lcom/sk89q/worldedit/world/item/ItemType;)Lorg/bukkit/Material;": From bbfaba3dbcc346025aa3af5d517e29ff016b4407 Mon Sep 17 00:00:00 2001 From: jdh5968 Date: Sat, 23 Apr 2022 13:04:42 +0900 Subject: [PATCH 02/12] Update JAVA 17, Gradle 7.4, MC 1.18.1 --- build.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- patcher-definition/build.gradle | 2 +- patcher-loader/build.gradle | 4 ++-- patcher-loader/src/main/resources/plugin.yml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index e5247c9..be3e3fe 100644 --- a/build.gradle +++ b/build.gradle @@ -6,5 +6,5 @@ allprojects { group 'io.izzel.arclight' version '1.0.0' - sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17 } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 69a9715..41dfb87 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/patcher-definition/build.gradle b/patcher-definition/build.gradle index 27b9e92..b3146e0 100644 --- a/patcher-definition/build.gradle +++ b/patcher-definition/build.gradle @@ -8,7 +8,7 @@ repositories { } dependencies { - implementation 'io.izzel.arclight:arclight-api:1.1.+' + implementation 'io.izzel.arclight:arclight-api:1.2.+' implementation 'org.ow2.asm:asm:9.2' implementation 'org.ow2.asm:asm-tree:9.2' implementation 'org.ow2.asm:asm-commons:9.2' diff --git a/patcher-loader/build.gradle b/patcher-loader/build.gradle index 3de4dd2..3434ac2 100644 --- a/patcher-loader/build.gradle +++ b/patcher-loader/build.gradle @@ -9,10 +9,10 @@ repositories { } dependencies { - implementation 'io.izzel.arclight:arclight-api:1.1.+' + implementation 'io.izzel.arclight:arclight-api:1.2.+' implementation 'org.ow2.asm:asm:9.2' implementation 'org.ow2.asm:asm-tree:9.2' - implementation 'org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT' + implementation 'org.spigotmc:spigot-api:1.18.1-R0.1-SNAPSHOT' } jar { diff --git a/patcher-loader/src/main/resources/plugin.yml b/patcher-loader/src/main/resources/plugin.yml index 2cf666b..b4608c6 100644 --- a/patcher-loader/src/main/resources/plugin.yml +++ b/patcher-loader/src/main/resources/plugin.yml @@ -1,6 +1,6 @@ name: ArclightPatcher main: io.izzel.arclight.patcher.PluginMain version: ${version} -api-version: 1.16 +api-version: 1.18 arclight: patcher: io.izzel.arclight.patcher.PatcherMain \ No newline at end of file From 51952103ac7cae589520ec3fbb47ec3459ee03c6 Mon Sep 17 00:00:00 2001 From: jdh5968 Date: Wed, 27 Apr 2022 18:16:13 +0900 Subject: [PATCH 03/12] Update .gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 36879bc..57e0a8b 100644 --- a/.gitignore +++ b/.gitignore @@ -114,3 +114,6 @@ gradle-app.setting # gradle/wrapper/gradle-wrapper.properties .idea/ + +# workload directory +tmp/ From dd198d0ceb4952af45cb99ffa21c35afe2f843eb Mon Sep 17 00:00:00 2001 From: jdh5968 Date: Sun, 31 Jul 2022 12:21:02 +0900 Subject: [PATCH 04/12] Update plugin to 1.18.2 --- patcher-loader/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patcher-loader/build.gradle b/patcher-loader/build.gradle index 3434ac2..38d0663 100644 --- a/patcher-loader/build.gradle +++ b/patcher-loader/build.gradle @@ -12,7 +12,7 @@ dependencies { implementation 'io.izzel.arclight:arclight-api:1.2.+' implementation 'org.ow2.asm:asm:9.2' implementation 'org.ow2.asm:asm-tree:9.2' - implementation 'org.spigotmc:spigot-api:1.18.1-R0.1-SNAPSHOT' + implementation 'org.spigotmc:spigot-api:1.18.2-R0.1-SNAPSHOT' } jar { From 3be5027c1ef1a68dc8fc1a84374166d11a0aed5b Mon Sep 17 00:00:00 2001 From: Dohyeon Jeon Date: Tue, 2 Aug 2022 10:09:09 +0900 Subject: [PATCH 05/12] Bump version & add 1.19.1 support --- build.gradle | 2 +- patcher-loader/build.gradle | 3 ++- patcher-loader/src/main/resources/plugin.yml | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index be3e3fe..2e44193 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ plugins { allprojects { group 'io.izzel.arclight' - version '1.0.0' + version '1.0.1' sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17 } diff --git a/patcher-loader/build.gradle b/patcher-loader/build.gradle index 38d0663..2372621 100644 --- a/patcher-loader/build.gradle +++ b/patcher-loader/build.gradle @@ -12,7 +12,8 @@ dependencies { implementation 'io.izzel.arclight:arclight-api:1.2.+' implementation 'org.ow2.asm:asm:9.2' implementation 'org.ow2.asm:asm-tree:9.2' - implementation 'org.spigotmc:spigot-api:1.18.2-R0.1-SNAPSHOT' + //implementation 'org.spigotmc:spigot-api:1.18.2-R0.1-SNAPSHOT' + implementation 'org.spigotmc:spigot-api:1.19.1-Ro.1-SNAPSHOT' } jar { diff --git a/patcher-loader/src/main/resources/plugin.yml b/patcher-loader/src/main/resources/plugin.yml index b4608c6..b70c6a2 100644 --- a/patcher-loader/src/main/resources/plugin.yml +++ b/patcher-loader/src/main/resources/plugin.yml @@ -1,6 +1,6 @@ name: ArclightPatcher main: io.izzel.arclight.patcher.PluginMain version: ${version} -api-version: 1.18 +api-version: 1.19 arclight: patcher: io.izzel.arclight.patcher.PatcherMain \ No newline at end of file From c278c120954c4e3885de80323af82eb3405c3344 Mon Sep 17 00:00:00 2001 From: Dohyeon Jeon Date: Tue, 2 Aug 2022 10:19:23 +0900 Subject: [PATCH 06/12] Fix typo --- patcher-loader/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patcher-loader/build.gradle b/patcher-loader/build.gradle index 2372621..fd472b9 100644 --- a/patcher-loader/build.gradle +++ b/patcher-loader/build.gradle @@ -13,7 +13,7 @@ dependencies { implementation 'org.ow2.asm:asm:9.2' implementation 'org.ow2.asm:asm-tree:9.2' //implementation 'org.spigotmc:spigot-api:1.18.2-R0.1-SNAPSHOT' - implementation 'org.spigotmc:spigot-api:1.19.1-Ro.1-SNAPSHOT' + implementation 'org.spigotmc:spigot-api:1.19.1-R0.1-SNAPSHOT' } jar { @@ -33,4 +33,4 @@ processResources { filesMatching('plugin.yml') { expand props } -} \ No newline at end of file +} From d8870a4990f25f9c66b7e7b408e8e862e5d63794 Mon Sep 17 00:00:00 2001 From: jdh5968 Date: Tue, 2 Aug 2022 23:13:41 +0900 Subject: [PATCH 07/12] Make former lines back to life since sometimes you'll want to build it and fight it with those versions --- build.gradle | 4 +++- patcher-loader/build.gradle | 7 +++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 2e44193..9f564fc 100644 --- a/build.gradle +++ b/build.gradle @@ -6,5 +6,7 @@ allprojects { group 'io.izzel.arclight' version '1.0.1' - sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17 + //sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8 //for up to 1.16 + //sourceCompatibility = targetCompatibility = JavaVersion.VERSION_16 //for 1.17 & 1.17.1 + sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17 //for 1.18+ } diff --git a/patcher-loader/build.gradle b/patcher-loader/build.gradle index fd472b9..2b80853 100644 --- a/patcher-loader/build.gradle +++ b/patcher-loader/build.gradle @@ -12,8 +12,11 @@ dependencies { implementation 'io.izzel.arclight:arclight-api:1.2.+' implementation 'org.ow2.asm:asm:9.2' implementation 'org.ow2.asm:asm-tree:9.2' - //implementation 'org.spigotmc:spigot-api:1.18.2-R0.1-SNAPSHOT' - implementation 'org.spigotmc:spigot-api:1.19.1-R0.1-SNAPSHOT' + //implementation 'org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT' //for 1.16.5 + //implementation 'org.spigotmc:spigot-api:1.17.1-R0.1-SNAPSHOT' //for 1.17.1 + //implementation 'org.spigotmc:spigot-api:1.18.1-R0.1-SNAPSHOT' //for 1.18.1 + //implementation 'org.spigotmc:spigot-api:1.18.2-R0.1-SNAPSHOT' //for 1.18.2 + implementation 'org.spigotmc:spigot-api:1.19.1-R0.1-SNAPSHOT' //for 1.19.1 } jar { From a2818f9a0b74b2117d6ffb91e7ba5bf549917a25 Mon Sep 17 00:00:00 2001 From: jdh5968 Date: Tue, 2 Aug 2022 23:45:20 +0900 Subject: [PATCH 08/12] README with some instructions you might want Implement "Get Pre-built Binaries" instruction Implement "Update" instruction Implement "Build" instruction --- README.md | 48 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9f34c5c..951caf0 100644 --- a/README.md +++ b/README.md @@ -1 +1,47 @@ -## patcher \ No newline at end of file +## Arclight Plugin Patcher + +**NOTE**: This repository only contains the WorldEdit-related patch. +You'll have to code it yourself, with looking through Arclight API & Spigot API, +if you want to patch other plugins not properly working on Arclight. + +### Get Pre-built Binaries + +Head to Releases, and grab some. +You should make your own build if you're using customized server. +(for example, your server is at 1.15.2) + +Please note that this binary would support you **only when you're on Java 17**. + +### Update Instructions + +**WARN**: If you don't remove `{server-root}/.arclight/patcher` directory, the new patch won't apply! + +1. You want to replace plugin file, so you *must* stop the server first. +2. Drop `patcher-loader-(version).jar` in `plugins`. +3. Head to `.arclight`. This will exist on the root of the server. +4. Remove `patcher` directory. If you don't remove it, the new patch won't be applied. +5. Now you can start the server. + +### Build + +The build uses Spigot-API, so you don't have to build it with buildtools. +However, if an error arises, try building it again with done with buidtools. +If you're using prebuilt spigot binary on your PC, +add `mavenLocal()` to the repositories in `patcher-loader/build.gradle`. + +1. You'll want to make your clone _(you can download the source code too)_ of this repo. +I'll recommend creating your own fork before cloning, and work on that fork. +2. If you want to customize it, you'll want to head up to two `build.gradle`, one at the root and the other in `patcher-loader`. +You can manage the build distributions with some uncommenting (removing `//`) and commenting (adding `//` at the very first of the very line). + > **WARN**: If two-or-more definition of Spigot-API or Java Version exists, the build can fail. Implement *only* one Spigot-API, and define *only* one JAVA version! + **Note**: If you want to customize it out of the code, you'll have to add your own version of Spigot-API. Further, you'll have to check the build number(like `R0.1`) to successfully configure it. +3. You'll want to grab some Java JDK, according to the setup on `build.gradle` of the root. +If you didn't, just install Java 17. That's the default. +Don't forget to add their `bin` directory to `PATH`! + > *Note: You don't have to configure this if you've set up the IDE.* +4. Do `gradlew build`. + > OS-specific: + > * Windows CMD: `gradlew.bat build` + > * Windows Powershell: `.\gradlew.bat build` + > * Bash: `./gradlew build` +5. Grab plugin in `patcher-loader/build/libs`. \ No newline at end of file From 3aab855b3addf7e12a021450f0c60c738af1372b Mon Sep 17 00:00:00 2001 From: jdh5968 Date: Tue, 2 Aug 2022 23:47:49 +0900 Subject: [PATCH 09/12] Add one more string on README gradlew build == gradlew jar --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 951caf0..e9902ff 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ You can manage the build distributions with some uncommenting (removing `//`) an If you didn't, just install Java 17. That's the default. Don't forget to add their `bin` directory to `PATH`! > *Note: You don't have to configure this if you've set up the IDE.* -4. Do `gradlew build`. +4. Do `gradlew build`. Note that you can also use `gradlew jar`. > OS-specific: > * Windows CMD: `gradlew.bat build` > * Windows Powershell: `.\gradlew.bat build` From 5f042efdf9c3df0f357ceeaab8bb1eaddf7fd461 Mon Sep 17 00:00:00 2001 From: Dohyeon Jeon Date: Wed, 3 Aug 2022 00:32:00 +0900 Subject: [PATCH 10/12] Remove prebuilt instructions from README --- README.md | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/README.md b/README.md index e9902ff..b5b6896 100644 --- a/README.md +++ b/README.md @@ -4,14 +4,6 @@ You'll have to code it yourself, with looking through Arclight API & Spigot API, if you want to patch other plugins not properly working on Arclight. -### Get Pre-built Binaries - -Head to Releases, and grab some. -You should make your own build if you're using customized server. -(for example, your server is at 1.15.2) - -Please note that this binary would support you **only when you're on Java 17**. - ### Update Instructions **WARN**: If you don't remove `{server-root}/.arclight/patcher` directory, the new patch won't apply! @@ -44,4 +36,4 @@ Don't forget to add their `bin` directory to `PATH`! > * Windows CMD: `gradlew.bat build` > * Windows Powershell: `.\gradlew.bat build` > * Bash: `./gradlew build` -5. Grab plugin in `patcher-loader/build/libs`. \ No newline at end of file +5. Grab plugin in `patcher-loader/build/libs`. From efe97000841f8a13977cee67604ec8127e83d3e9 Mon Sep 17 00:00:00 2001 From: Dohyeon Jeon Date: Wed, 3 Aug 2022 00:41:59 +0900 Subject: [PATCH 11/12] No "download", but "git clone" only -to successfully build it --- README.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b5b6896..3ba781f 100644 --- a/README.md +++ b/README.md @@ -16,12 +16,9 @@ if you want to patch other plugins not properly working on Arclight. ### Build -The build uses Spigot-API, so you don't have to build it with buildtools. -However, if an error arises, try building it again with done with buidtools. -If you're using prebuilt spigot binary on your PC, -add `mavenLocal()` to the repositories in `patcher-loader/build.gradle`. +The build uses Spigot-API, so you don't have to build it with buildtools. -1. You'll want to make your clone _(you can download the source code too)_ of this repo. +1. You'll want to make your clone _(don't just download- the build will fail if you just download it)_ of this repo. I'll recommend creating your own fork before cloning, and work on that fork. 2. If you want to customize it, you'll want to head up to two `build.gradle`, one at the root and the other in `patcher-loader`. You can manage the build distributions with some uncommenting (removing `//`) and commenting (adding `//` at the very first of the very line). From f0ea038e0bd7647a766691ef864ae4af705d4389 Mon Sep 17 00:00:00 2001 From: Dohyeon Jeon Date: Wed, 3 Aug 2022 01:10:01 +0900 Subject: [PATCH 12/12] bump api version to 1.3.+ Since 1.19.1 is added on 1.3.0 --- patcher-definition/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patcher-definition/build.gradle b/patcher-definition/build.gradle index b3146e0..836eac1 100644 --- a/patcher-definition/build.gradle +++ b/patcher-definition/build.gradle @@ -8,7 +8,7 @@ repositories { } dependencies { - implementation 'io.izzel.arclight:arclight-api:1.2.+' + implementation 'io.izzel.arclight:arclight-api:1.3.+' implementation 'org.ow2.asm:asm:9.2' implementation 'org.ow2.asm:asm-tree:9.2' implementation 'org.ow2.asm:asm-commons:9.2' @@ -25,4 +25,4 @@ def getGitHash = { -> jar { manifest.attributes 'Implementation-Version': getGitHash() -} \ No newline at end of file +}