Rebuild porting patches
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
-def majorMc = "1.21.6";
|
||||
+def majorMc = "1.21.2";
|
||||
def modLoaders = "neoforge|fabric|quilt|paper";
|
||||
-def supportedMc = "25w17a";
|
||||
-def supportedMc = "25w19a";
|
||||
-def reltype = "experimental";
|
||||
+def supportedMc = "1.21.3|1.21.4";
|
||||
+def reltype = "snapshot";
|
||||
|
@@ -1,6 +1,26 @@
|
||||
--- a/Common/src/main/java/com/hypherionmc/craterlib/utils/ChatUtils.java
|
||||
+++ b/Common/src/main/java/com/hypherionmc/craterlib/utils/ChatUtils.java
|
||||
@@ -25,7 +25,7 @@
|
||||
@@ -1,11 +1,8 @@
|
||||
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;
|
||||
import me.hypherionmc.mcdiscordformatter.minecraft.MinecraftSerializer;
|
||||
@@ -22,36 +19,26 @@
|
||||
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;
|
||||
|
||||
public class ChatUtils {
|
||||
|
||||
@Getter
|
||||
private static final GsonComponentSerializer adventureSerializer = GsonComponentSerializer.builder().options(
|
||||
@@ -9,3 +29,28 @@
|
||||
).build();
|
||||
|
||||
private static final MiniMessage miniMessage = MiniMessage.miniMessage();
|
||||
|
||||
public static Component adventureToMojang(net.kyori.adventure.text.Component inComponent) {
|
||||
- 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, getRegistryLookup());
|
||||
}
|
||||
|
||||
public static net.kyori.adventure.text.Component mojangToAdventure(Component inComponent) {
|
||||
try {
|
||||
- // 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, getRegistryLookup());
|
||||
+ return adventureSerializer.deserialize(serialised);
|
||||
} catch (Exception e) {
|
||||
return net.kyori.adventure.text.Component.text(inComponent.getString());
|
||||
}
|
||||
|
@@ -0,0 +1,11 @@
|
||||
--- a/Fabric/src/main/java/com/hypherionmc/craterlib/network/CraterFabricNetworkHandler.java
|
||||
+++ b/Fabric/src/main/java/com/hypherionmc/craterlib/network/CraterFabricNetworkHandler.java
|
||||
@@ -38,7 +38,7 @@
|
||||
}
|
||||
|
||||
ServerPlayNetworking.registerGlobalReceiver(holder.getType(),
|
||||
- (ServerPlayNetworking.PlayPayloadHandler<CommonPacketWrapper<T>>) (payload, context) -> context.player().getServer().execute(() ->
|
||||
+ (ServerPlayNetworking.PlayPayloadHandler<CommonPacketWrapper<T>>) (payload, context) -> context.player().server.execute(() ->
|
||||
holder.handler().accept(
|
||||
new PacketContext<>(BridgedPlayer.of(context.player()), payload.packet(), side))));
|
||||
}
|
@@ -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,11 +1,14 @@
|
||||
--- a/Paper/build.gradle
|
||||
+++ b/Paper/build.gradle
|
||||
@@ -1,3 +1,5 @@
|
||||
@@ -1,5 +1,7 @@
|
||||
+import io.papermc.paperweight.userdev.ReobfArtifactConfiguration
|
||||
+
|
||||
plugins {
|
||||
id "io.papermc.paperweight.userdev" version "1.7.3"
|
||||
- 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"
|
||||
}
|
||||
|
||||
@@ -10,6 +12,8 @@
|
||||
excludedResources = ["pack.mcmeta", "craterlib.mixins.json"]
|
||||
}
|
||||
@@ -20,7 +23,7 @@
|
||||
compileTestJava.enabled = false
|
||||
|
||||
-tasks.assemble {
|
||||
- dependsOn(tasks.reobfJar)
|
||||
- dependsOn(tasks.shadowJar)
|
||||
-}
|
||||
-
|
||||
publisher {
|
||||
|
@@ -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,15 @@
|
||||
--- a/build.gradle
|
||||
+++ b/build.gradle
|
||||
@@ -10,15 +10,10 @@
|
||||
@@ -3,22 +3,17 @@
|
||||
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'
|
||||
}
|
||||
|
||||
var relType = project.properties["releaseType"] ?: "${release_type}"
|
||||
|
||||
|
@@ -4,13 +4,13 @@
|
||||
mod_name=CraterLib
|
||||
|
||||
# Shared
|
||||
-minecraft_version=25w17a
|
||||
-minecraft_version=1.21.6
|
||||
+minecraft_version=1.21.3
|
||||
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.16.7
|
||||
+fabric_api=0.107.3+1.21.3
|
||||
|
||||
|
9
patches/1.21.2/gradle/wrapper/gradle-wrapper.properties.patch
vendored
Normal file
9
patches/1.21.2/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
|
@@ -1,11 +1,7 @@
|
||||
--- a/settings.gradle
|
||||
+++ b/settings.gradle
|
||||
@@ -14,6 +14,5 @@
|
||||
}
|
||||
|
||||
@@ -16,4 +16,3 @@
|
||||
rootProject.name = 'CraterLib'
|
||||
-include("Common", "Fabric"/*, "NeoForge"*/)
|
||||
-//include 'Paper'
|
||||
include("Common", "Fabric", "NeoForge")
|
||||
include 'Paper'
|
||||
-
|
||||
+include("Common", "Fabric", "NeoForge")
|
||||
+include 'Paper'
|
||||
|
Reference in New Issue
Block a user