[DEV] Fix up porting patches and configs
This commit is contained in:
@@ -1,15 +1,12 @@
|
||||
--- a/.jenkins/Jenkinsfile.deploy
|
||||
+++ b/.jenkins/Jenkinsfile.deploy
|
||||
@@ -1,7 +1,7 @@
|
||||
@@ -1,4 +1,4 @@
|
||||
-def JDK = "21"
|
||||
+def JDK = "17"
|
||||
|
||||
pipeline {
|
||||
agent {
|
||||
docker {
|
||||
- image "registry.firstdark.dev/java21:latest"
|
||||
+ image "registry.firstdark.dev/java17:latest"
|
||||
alwaysPull true
|
||||
args '-v gradle-cache:/home/gradle/.gradle'
|
||||
}
|
||||
@@ -15,7 +15,7 @@
|
||||
@@ -17,7 +17,7 @@
|
||||
stage("Notify Discord") {
|
||||
steps {
|
||||
discordSend webhookURL: env.FDD_WH_ADMIN,
|
||||
@@ -18,12 +15,3 @@
|
||||
link: env.BUILD_URL,
|
||||
result: 'SUCCESS',
|
||||
description: "Build: [${BUILD_NUMBER}](${env.BUILD_URL})"
|
||||
@@ -44,7 +44,7 @@
|
||||
deleteDir()
|
||||
|
||||
discordSend webhookURL: env.FDD_WH_ADMIN,
|
||||
- title: "CraterLib Port Deploy #${BUILD_NUMBER}",
|
||||
+ title: "CraterLib 1.20/1 Deploy #${BUILD_NUMBER}",
|
||||
link: env.BUILD_URL,
|
||||
result: currentBuild.currentResult,
|
||||
description: "Build: [${BUILD_NUMBER}](${env.BUILD_URL})\nStatus: ${currentBuild.currentResult}"
|
||||
|
@@ -1,52 +1,18 @@
|
||||
--- a/.jenkins/Jenkinsfile.snapshot
|
||||
+++ b/.jenkins/Jenkinsfile.snapshot
|
||||
@@ -1,10 +1,11 @@
|
||||
@@ -1,10 +1,10 @@
|
||||
def projectName = "CraterLib";
|
||||
def projectIcon = "https://cdn.modrinth.com/data/Nn8Wasaq/a172c634683a11a2e9ae593e56eba7885743bb44.png";
|
||||
+def relType = "snapshot"
|
||||
-def JDK = "21";
|
||||
-def majorMc = "Port";
|
||||
-def modLoaders = "neoforge|fabric|quilt";
|
||||
-def supportedMc = "1.21";
|
||||
-def reltype = "port";
|
||||
+def JDK = "17";
|
||||
+def majorMc = "1.20/1";
|
||||
+def modLoaders = "forge|fabric|quilt";
|
||||
+def supportedMc = "1.20|1.20.1";
|
||||
+def reltype = "snapshot";
|
||||
|
||||
pipeline {
|
||||
agent {
|
||||
docker {
|
||||
- image "registry.firstdark.dev/java21:latest"
|
||||
+ image "registry.firstdark.dev/java17:latest"
|
||||
alwaysPull true
|
||||
args '-v gradle-cache:/home/gradle/.gradle'
|
||||
}
|
||||
@@ -18,7 +19,7 @@
|
||||
stage("Notify Discord") {
|
||||
steps {
|
||||
discordSend webhookURL: env.SSS_WEBHOOK,
|
||||
- title: "Deploy Started: ${projectName} Port Deploy #${BUILD_NUMBER}",
|
||||
+ title: "Deploy Started: ${projectName} 1.20/1 Deploy #${BUILD_NUMBER}",
|
||||
link: env.BUILD_URL,
|
||||
result: 'SUCCESS',
|
||||
description: "Build: [${BUILD_NUMBER}](${env.BUILD_URL})"
|
||||
@@ -34,14 +35,14 @@
|
||||
|
||||
stage("Build") {
|
||||
steps {
|
||||
- sh "./gradlew build -PreleaseType=port"
|
||||
+ sh "./gradlew build -PreleaseType=${relType}"
|
||||
}
|
||||
}
|
||||
|
||||
stage("Publish to Maven") {
|
||||
steps {
|
||||
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
|
||||
- sh "./gradlew publish -PreleaseType=port"
|
||||
+ sh "./gradlew publish -PreleaseType=${relType}"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -56,8 +57,8 @@
|
||||
projectSlug: "craterlib",
|
||||
projectName: "${projectName}",
|
||||
projectIcon: "${projectIcon}",
|
||||
- modLoaders: "neoforge|fabric|quilt",
|
||||
- minecraftVersions: "1.21",
|
||||
+ modLoaders: "forge|fabric|quilt",
|
||||
+ minecraftVersions: "1.20|1.20.1",
|
||||
failWebhook: env.SSS_WEBHOOK,
|
||||
publishWebhooks: "${env.SSS_WEBHOOK}|${env.FDD_WH}"
|
||||
|
||||
|
@@ -1,37 +1,29 @@
|
||||
--- a/Common/src/main/java/com/hypherionmc/craterlib/utils/ChatUtils.java
|
||||
+++ b/Common/src/main/java/com/hypherionmc/craterlib/utils/ChatUtils.java
|
||||
@@ -5,22 +5,29 @@
|
||||
import me.hypherionmc.mcdiscordformatter.minecraft.MinecraftSerializer;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
|
||||
+import net.kyori.adventure.text.serializer.json.JSONOptions;
|
||||
+import net.kyori.option.OptionState;
|
||||
@@ -9,12 +9,9 @@
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.SharedConstants;
|
||||
import net.minecraft.Util;
|
||||
-import net.minecraft.core.RegistryAccess;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.Style;
|
||||
|
||||
-import java.util.function.Consumer;
|
||||
-
|
||||
public class ChatUtils {
|
||||
|
||||
+ private static final GsonComponentSerializer adventureSerializer = GsonComponentSerializer.builder().options(
|
||||
+ OptionState.optionState()
|
||||
+ .value(JSONOptions.EMIT_HOVER_SHOW_ENTITY_ID_AS_INT_ARRAY, false)
|
||||
+ .value(JSONOptions.EMIT_HOVER_EVENT_TYPE, JSONOptions.HoverEventValueMode.MODERN_ONLY).build()
|
||||
+ ).build();
|
||||
+
|
||||
private static final GsonComponentSerializer adventureSerializer = GsonComponentSerializer.builder().options(
|
||||
@@ -23,11 +20,11 @@
|
||||
|
||||
public static Component adventureToMojang(net.kyori.adventure.text.Component inComponent) {
|
||||
- final String serialised = GsonComponentSerializer.gson().serialize(inComponent);
|
||||
final String serialised = adventureSerializer.serialize(inComponent);
|
||||
- return Component.Serializer.fromJson(serialised, RegistryAccess.EMPTY);
|
||||
+ final String serialised = adventureSerializer.serialize(inComponent);
|
||||
+ return Component.Serializer.fromJson(serialised);
|
||||
}
|
||||
|
||||
public static net.kyori.adventure.text.Component mojangToAdventure(Component inComponent) {
|
||||
- final String serialised = Component.Serializer.toJson(inComponent, RegistryAccess.EMPTY);
|
||||
- return GsonComponentSerializer.gson().deserialize(serialised);
|
||||
+ final String serialised = Component.Serializer.toJson(inComponent);
|
||||
+ return adventureSerializer.deserialize(serialised);
|
||||
return adventureSerializer.deserialize(serialised);
|
||||
}
|
||||
|
||||
// Some text components contain duplicate text, resulting in duplicate messages
|
||||
|
@@ -1,6 +1,17 @@
|
||||
--- a/Fabric/src/main/java/com/hypherionmc/craterlib/mixin/ServerGamePacketListenerImplMixin.java
|
||||
+++ b/Fabric/src/main/java/com/hypherionmc/craterlib/mixin/ServerGamePacketListenerImplMixin.java
|
||||
@@ -15,6 +15,8 @@
|
||||
@@ -4,10 +4,8 @@
|
||||
import com.hypherionmc.craterlib.core.event.CraterEventBus;
|
||||
import com.hypherionmc.craterlib.nojang.world.entity.player.BridgedPlayer;
|
||||
import com.hypherionmc.craterlib.utils.ChatUtils;
|
||||
-import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.PlayerChatMessage;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
-import net.minecraft.server.network.FilteredText;
|
||||
import net.minecraft.server.network.ServerGamePacketListenerImpl;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
@@ -15,6 +13,8 @@
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@@ -9,7 +20,7 @@
|
||||
@Mixin(value = ServerGamePacketListenerImpl.class, priority = Integer.MIN_VALUE)
|
||||
public class ServerGamePacketListenerImplMixin {
|
||||
|
||||
@@ -22,11 +24,11 @@
|
||||
@@ -22,11 +22,11 @@
|
||||
public ServerPlayer player;
|
||||
|
||||
@Inject(
|
||||
|
@@ -1,6 +1,6 @@
|
||||
--- a/Fabric/src/main/java/com/hypherionmc/craterlib/network/CraterFabricNetworkHandler.java
|
||||
+++ b/Fabric/src/main/java/com/hypherionmc/craterlib/network/CraterFabricNetworkHandler.java
|
||||
@@ -1,46 +1,57 @@
|
||||
@@ -1,46 +1,55 @@
|
||||
package com.hypherionmc.craterlib.network;
|
||||
|
||||
-import com.hypherionmc.craterlib.api.networking.CommonPacketWrapper;
|
||||
@@ -17,8 +17,6 @@
|
||||
+import net.fabricmc.fabric.api.networking.v1.PacketByteBufs;
|
||||
import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking;
|
||||
+import net.minecraft.network.FriendlyByteBuf;
|
||||
+import net.minecraft.resources.ResourceLocation;
|
||||
+import net.minecraft.server.level.ServerPlayer;
|
||||
+
|
||||
+import java.util.HashMap;
|
||||
+import java.util.Map;
|
||||
@@ -81,7 +79,7 @@
|
||||
}
|
||||
|
||||
public <T> void sendToServer(T packet) {
|
||||
@@ -48,21 +59,25 @@
|
||||
@@ -48,21 +57,25 @@
|
||||
}
|
||||
|
||||
public <T> void sendToServer(T packet, boolean ignoreCheck) {
|
||||
|
@@ -1,13 +1,13 @@
|
||||
--- a/Forge/src/main/java/com/hypherionmc/craterlib/CraterLib.java
|
||||
+++ b/Forge/src/main/java/com/hypherionmc/craterlib/CraterLib.java
|
||||
@@ -3,6 +3,7 @@
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
import com.hypherionmc.craterlib.api.events.client.LateInitEvent;
|
||||
import com.hypherionmc.craterlib.common.ForgeServerEvents;
|
||||
import com.hypherionmc.craterlib.core.event.CraterEventBus;
|
||||
+import com.hypherionmc.craterlib.compat.Vanish;
|
||||
import com.hypherionmc.craterlib.core.event.CraterEventBus;
|
||||
import com.hypherionmc.craterlib.core.networking.CraterPacketNetwork;
|
||||
import com.hypherionmc.craterlib.core.networking.data.PacketSide;
|
||||
import com.hypherionmc.craterlib.core.platform.ModloaderEnvironment;
|
||||
@@ -32,5 +33,9 @@
|
||||
LateInitEvent event = new LateInitEvent(new BridgedMinecraft(), BridgedOptions.of(Minecraft.getInstance().options));
|
||||
CraterEventBus.INSTANCE.postEvent(event);
|
||||
|
@@ -1,12 +1,11 @@
|
||||
--- /dev/null
|
||||
+++ b/Forge/src/main/java/com/hypherionmc/craterlib/compat/Vanish.java
|
||||
@@ -1,0 +1,25 @@
|
||||
@@ -1,0 +1,24 @@
|
||||
+package com.hypherionmc.craterlib.compat;
|
||||
+
|
||||
+import com.hypherionmc.craterlib.api.events.server.CraterPlayerEvent;
|
||||
+import com.hypherionmc.craterlib.core.event.CraterEventBus;
|
||||
+import com.hypherionmc.craterlib.nojang.world.entity.player.BridgedPlayer;
|
||||
+import net.minecraft.world.entity.player.Player;
|
||||
+import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
+import redstonedubstep.mods.vanishmod.api.PlayerVanishEvent;
|
||||
+
|
||||
|
@@ -1,6 +1,17 @@
|
||||
--- a/Forge/src/main/java/com/hypherionmc/craterlib/mixin/ServerGamePacketListenerImplMixin.java
|
||||
+++ b/Forge/src/main/java/com/hypherionmc/craterlib/mixin/ServerGamePacketListenerImplMixin.java
|
||||
@@ -15,6 +15,8 @@
|
||||
@@ -4,10 +4,8 @@
|
||||
import com.hypherionmc.craterlib.core.event.CraterEventBus;
|
||||
import com.hypherionmc.craterlib.nojang.world.entity.player.BridgedPlayer;
|
||||
import com.hypherionmc.craterlib.utils.ChatUtils;
|
||||
-import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.PlayerChatMessage;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
-import net.minecraft.server.network.FilteredText;
|
||||
import net.minecraft.server.network.ServerGamePacketListenerImpl;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
@@ -15,6 +13,8 @@
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@@ -9,7 +20,7 @@
|
||||
@Mixin(value = ServerGamePacketListenerImpl.class, priority = Integer.MIN_VALUE)
|
||||
public class ServerGamePacketListenerImplMixin {
|
||||
|
||||
@@ -22,11 +24,11 @@
|
||||
@@ -22,11 +22,11 @@
|
||||
public ServerPlayer player;
|
||||
|
||||
@Inject(
|
||||
|
@@ -1,10 +1,11 @@
|
||||
--- a/README.md
|
||||
+++ b/README.md
|
||||
@@ -15,7 +15,7 @@
|
||||
@@ -15,8 +15,7 @@
|
||||
| < 1.18.2 | ❌ |
|
||||
| 1.18.2-1.20.2 | ✳️ |
|
||||
| 1.20.4 | ✳️ |
|
||||
-| 1.20.6 | 🚧 |
|
||||
-| 1.20.6 | ❌ |
|
||||
-| 1.21 | ✳️ |
|
||||
+| 1.21 | 🚧 |
|
||||
|
||||
- ❌ - Not Supported; no bug fixes or new features.
|
||||
|
31
patches/1.20/build.gradle.patch
Normal file
31
patches/1.20/build.gradle.patch
Normal file
@@ -0,0 +1,31 @@
|
||||
--- a/build.gradle
|
||||
+++ b/build.gradle
|
||||
@@ -11,8 +11,6 @@
|
||||
multiProject = true
|
||||
enableMirrorMaven = true
|
||||
enableReleasesMaven = true
|
||||
- enableSnapshotsMaven = true
|
||||
-
|
||||
dopplerToken = System.getenv("DOPPLER_KEY")
|
||||
|
||||
versioning {
|
||||
@@ -30,8 +28,8 @@
|
||||
apply plugin: 'com.github.johnrengelman.shadow'
|
||||
apply plugin: 'com.hypherionmc.modutils.modpublisher'
|
||||
|
||||
- sourceCompatibility = JavaVersion.VERSION_21
|
||||
- targetCompatibility = JavaVersion.VERSION_21
|
||||
+ sourceCompatibility = JavaVersion.VERSION_17
|
||||
+ targetCompatibility = JavaVersion.VERSION_17
|
||||
|
||||
group = rootProject.group
|
||||
|
||||
@@ -59,7 +57,7 @@
|
||||
shade "me.hypherionmc.moon-config:core:${moon_config}"
|
||||
shade "me.hypherionmc.moon-config:toml:${moon_config}"
|
||||
shade "com.hypherionmc:rpcsdk:${rpc_sdk}"
|
||||
- shade "me.hypherionmc.sdlink:mcdiscordformatter-1.20.3:${discord_formatter}"
|
||||
+ shade "me.hypherionmc.sdlink:mcdiscordformatter-1.19.1:${discord_formatter}"
|
||||
shade "net.kyori:adventure-api:${adventure}"
|
||||
shade "net.kyori:adventure-text-serializer-gson:${adventure}"
|
||||
|
@@ -1,7 +0,0 @@
|
||||
--- a/orbit.json
|
||||
+++ /dev/null
|
||||
@@ -1,4 +1,0 @@
|
||||
-{
|
||||
- "action": "port",
|
||||
- "devBranch": "porting"
|
||||
-}
|
@@ -1,8 +1,10 @@
|
||||
--- a/settings.gradle
|
||||
+++ b/settings.gradle
|
||||
@@ -11,4 +11,4 @@
|
||||
@@ -10,5 +10,5 @@
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.name = 'CraterLib'
|
||||
-rootProject.name = 'CraterLib'
|
||||
-include("Common", "Fabric", "NeoForge")
|
||||
+rootProject.name = 'CraterLib-1.20'
|
||||
+include("Common", "Fabric", "Forge")
|
||||
|
Reference in New Issue
Block a user