Rebuild porting patches
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
-def JDK = "21";
|
||||
-def majorMc = "1.21.6";
|
||||
-def modLoaders = "neoforge|fabric|quilt|paper";
|
||||
-def supportedMc = "25w17a";
|
||||
-def supportedMc = "25w19a";
|
||||
-def reltype = "experimental";
|
||||
+def JDK = "17";
|
||||
+def majorMc = "1.20.4";
|
||||
|
@@ -1,14 +1,18 @@
|
||||
--- a/Common/src/main/java/com/hypherionmc/craterlib/utils/ChatUtils.java
|
||||
+++ b/Common/src/main/java/com/hypherionmc/craterlib/utils/ChatUtils.java
|
||||
@@ -1,7 +1,5 @@
|
||||
@@ -1,11 +1,6 @@
|
||||
package com.hypherionmc.craterlib.utils;
|
||||
|
||||
-import com.google.gson.JsonElement;
|
||||
-import com.google.gson.JsonParseException;
|
||||
-import com.hypherionmc.craterlib.core.platform.CommonPlatform;
|
||||
-import com.hypherionmc.craterlib.core.platform.ModloaderEnvironment;
|
||||
import com.hypherionmc.craterlib.nojang.resources.ResourceIdentifier;
|
||||
-import com.mojang.serialization.JsonOps;
|
||||
import lombok.Getter;
|
||||
import me.hypherionmc.mcdiscordformatter.discord.DiscordSerializer;
|
||||
@@ -13,11 +11,6 @@
|
||||
import me.hypherionmc.mcdiscordformatter.minecraft.MinecraftSerializer;
|
||||
@@ -16,57 +11,30 @@
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.SharedConstants;
|
||||
import net.minecraft.Util;
|
||||
@@ -18,9 +22,11 @@
|
||||
-import net.minecraft.core.HolderLookup;
|
||||
-import net.minecraft.core.RegistryAccess;
|
||||
import net.minecraft.network.chat.Component;
|
||||
-import net.minecraft.network.chat.ComponentSerialization;
|
||||
import net.minecraft.network.chat.Style;
|
||||
-import net.minecraft.util.StrictJsonParser;
|
||||
|
||||
@@ -25,35 +18,23 @@
|
||||
public class ChatUtils {
|
||||
|
||||
@Getter
|
||||
private static final GsonComponentSerializer adventureSerializer = GsonComponentSerializer.builder().options(
|
||||
@@ -31,16 +37,26 @@
|
||||
private static final MiniMessage miniMessage = MiniMessage.miniMessage();
|
||||
|
||||
public static Component adventureToMojang(net.kyori.adventure.text.Component inComponent) {
|
||||
final String serialised = adventureSerializer.serialize(inComponent);
|
||||
- return Component.Serializer.fromJson(serialised, getRegistryLookup());
|
||||
- final JsonElement serialised = adventureSerializer.serializeToTree(inComponent);
|
||||
-
|
||||
- // FUCK YOU MOJANG. SERIOUSLY. FUCK OFF WITH THIS SHIT
|
||||
- return ComponentSerialization.CODEC
|
||||
- .parse(getRegistryLookup().createSerializationContext(JsonOps.INSTANCE), serialised)
|
||||
- .getOrThrow(JsonParseException::new);
|
||||
+ final String serialised = adventureSerializer.serialize(inComponent);
|
||||
+ return Component.Serializer.fromJson(serialised);
|
||||
}
|
||||
|
||||
public static net.kyori.adventure.text.Component mojangToAdventure(Component inComponent) {
|
||||
try {
|
||||
- final String serialised = Component.Serializer.toJson(inComponent, getRegistryLookup());
|
||||
- // FUCK YOU MOJANG. SERIOUSLY. FUCK OFF WITH THIS SHIT
|
||||
- final JsonElement serialised = ComponentSerialization.CODEC
|
||||
- .encodeStart(JsonOps.INSTANCE, inComponent)
|
||||
- .getOrThrow(JsonParseException::new);
|
||||
-
|
||||
- return adventureSerializer.deserializeFromTree(serialised);
|
||||
+ final String serialised = Component.Serializer.toJson(inComponent);
|
||||
return adventureSerializer.deserialize(serialised);
|
||||
+ return adventureSerializer.deserialize(serialised);
|
||||
} catch (Exception e) {
|
||||
return net.kyori.adventure.text.Component.text(inComponent.getString());
|
||||
}
|
||||
|
@@ -52,7 +52,7 @@
|
||||
- }
|
||||
-
|
||||
- ServerPlayNetworking.registerGlobalReceiver(holder.getType(),
|
||||
- (ServerPlayNetworking.PlayPayloadHandler<CommonPacketWrapper<T>>) (payload, context) -> context.player().server.execute(() ->
|
||||
- (ServerPlayNetworking.PlayPayloadHandler<CommonPacketWrapper<T>>) (payload, context) -> context.player().getServer().execute(() ->
|
||||
- holder.handler().accept(
|
||||
- new PacketContext<>(BridgedPlayer.of(context.player()), payload.packet(), side))));
|
||||
+ if (CHANNELS.get(holder.messageType()) == null) {
|
||||
|
@@ -1,10 +0,0 @@
|
||||
--- a/NeoForge/src/main/java/com/hypherionmc/craterlib/common/NeoForgeCompatHelper.java
|
||||
+++ b/NeoForge/src/main/java/com/hypherionmc/craterlib/common/NeoForgeCompatHelper.java
|
||||
@@ -3,6 +3,7 @@
|
||||
import com.hypherionmc.craterlib.core.platform.CompatUtils;
|
||||
import com.hypherionmc.craterlib.core.platform.ModloaderEnvironment;
|
||||
import com.hypherionmc.craterlib.nojang.world.entity.player.BridgedPlayer;
|
||||
+import net.kyori.adventure.text.Component;
|
||||
import redstonedubstep.mods.vanishmod.VanishUtil;
|
||||
import team.creative.playerrevive.api.IBleeding;
|
||||
import team.creative.playerrevive.server.PlayerReviveServer;
|
@@ -1,5 +1,21 @@
|
||||
--- a/Paper/build.gradle
|
||||
+++ b/Paper/build.gradle
|
||||
@@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
- id "io.papermc.paperweight.userdev" version "2.0.0-beta.17"
|
||||
+ id "io.papermc.paperweight.userdev" version "1.7.3"
|
||||
id "xyz.jpenilla.run-paper" version "2.3.0"
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
compileTestJava.enabled = false
|
||||
|
||||
tasks.assemble {
|
||||
- dependsOn(tasks.shadowJar)
|
||||
+ dependsOn(tasks.reobfJar)
|
||||
}
|
||||
|
||||
publisher {
|
||||
@@ -68,8 +68,8 @@
|
||||
setVersionType("alpha")
|
||||
setChangelog(rootProject.file("changelog.md"))
|
||||
|
@@ -1,10 +0,0 @@
|
||||
--- a/Paper/src/main/java/com/hypherionmc/craterlib/common/PaperCompatHelper.java
|
||||
+++ b/Paper/src/main/java/com/hypherionmc/craterlib/common/PaperCompatHelper.java
|
||||
@@ -4,6 +4,7 @@
|
||||
import com.hypherionmc.craterlib.core.platform.ModloaderEnvironment;
|
||||
import com.hypherionmc.craterlib.nojang.world.entity.player.BridgedPlayer;
|
||||
import com.hypherionmc.craterlib.utils.ChatUtils;
|
||||
+import net.kyori.adventure.text.Component;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.metadata.MetadataValue;
|
@@ -0,0 +1,11 @@
|
||||
--- a/Paper/src/main/java/com/hypherionmc/craterlib/common/PaperLoaderHelper.java
|
||||
+++ b/Paper/src/main/java/com/hypherionmc/craterlib/common/PaperLoaderHelper.java
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
@Override
|
||||
public String getGameVersion() {
|
||||
- return SharedConstants.getCurrentVersion().name();
|
||||
+ return SharedConstants.getCurrentVersion().getName();
|
||||
}
|
||||
|
||||
@Override
|
@@ -1,6 +1,13 @@
|
||||
--- a/build.gradle
|
||||
+++ b/build.gradle
|
||||
@@ -8,21 +8,15 @@
|
||||
@@ -3,26 +3,20 @@
|
||||
id 'com.github.johnrengelman.shadow' version '8.1.1' apply false
|
||||
id "xyz.wagyourtail.unimined" version "1.3.9" apply false
|
||||
id "com.hypherionmc.modutils.modpublisher" version "2.1.6"
|
||||
- id "com.hypherionmc.modutils.orion" version "1.0.28"
|
||||
- id "com.hypherionmc.modutils.orion.origami" version "1.0.28" apply false
|
||||
+ id "com.hypherionmc.modutils.orion" version "1.0.24"
|
||||
+ id "com.hypherionmc.modutils.orion.origami" version "1.0.24" apply false
|
||||
id 'maven-publish'
|
||||
}
|
||||
|
||||
|
@@ -4,13 +4,13 @@
|
||||
mod_name=CraterLib
|
||||
|
||||
# Shared
|
||||
-minecraft_version=25w17a
|
||||
-minecraft_version=1.21.6
|
||||
+minecraft_version=1.20.4
|
||||
project_group=com.hypherionmc.craterlib
|
||||
|
||||
# Fabric
|
||||
-fabric_loader=0.16.13
|
||||
-fabric_api=0.119.10+1.21.6
|
||||
-fabric_api=0.126.0+1.21.6
|
||||
+fabric_loader=0.15.11
|
||||
+fabric_api=0.97.0+1.20.4
|
||||
|
||||
|
9
patches/1.20.4/gradle/wrapper/gradle-wrapper.properties.patch
vendored
Normal file
9
patches/1.20.4/gradle/wrapper/gradle-wrapper.properties.patch
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
--- 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-8.14-bin.zip
|
||||
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
@@ -5,9 +5,8 @@
|
||||
}
|
||||
|
||||
-rootProject.name = 'CraterLib'
|
||||
-include("Common", "Fabric"/*, "NeoForge"*/)
|
||||
-//include 'Paper'
|
||||
-
|
||||
-include("Common", "Fabric", "NeoForge")
|
||||
+rootProject.name = 'CraterLib-1.20.4'
|
||||
+include("Common", "Fabric", "Forge", "NeoForge")
|
||||
+include 'Paper'
|
||||
include 'Paper'
|
||||
-
|
||||
|
Reference in New Issue
Block a user