Skip to content

Commit

Permalink
Backport to forge-1.20
Browse files Browse the repository at this point in the history
  • Loading branch information
TBlueF committed Dec 4, 2024
1 parent 2c63d76 commit 1b6a1f0
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
15 changes: 11 additions & 4 deletions implementations/forge/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ plugins {
}

val supportedMinecraftVersions = listOf(
"1.21", "1.21.1", "1.21.2", "1.21.3"
"1.20", "1.20.1", "1.20.2", "1.20.3", "1.20.4"
)

val minecraftVersion = supportedMinecraftVersions.first()
val forgeVersion = "51.0.1"
val forgeVersion = "46.0.1"

val shadowInclude: Configuration by configurations.creating
configurations.api.get().extendsFrom(shadowInclude)
Expand All @@ -31,7 +31,7 @@ dependencies {

minecraft {
mappings( "official", minecraftVersion )
reobf = false
reobf = true
}

tasks.shadowJar {
Expand Down Expand Up @@ -97,8 +97,15 @@ val mergeShadowAndJarJar = tasks.create<Jar>("mergeShadowAndJarJar") {
archiveFileName = "${project.name}-${project.version}-merged.jar"
}

reobf {
create("mergeShadowAndJarJar") {
mappings = tasks.createMcpToSrg.map { it.output.get() }
}
}

val reobfMergeShadowAndJarJar = tasks.getByName("reobfMergeShadowAndJarJar")
tasks.getByName<CopyFileTask>("release") {
dependsOn( mergeShadowAndJarJar )
dependsOn( reobfMergeShadowAndJarJar )
inputFile = mergeShadowAndJarJar.outputs.files.singleFile
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public ForgeCommandSource(ForgeMod mod, Plugin plugin, CommandSourceStack delega

@Override
public void sendMessage(Text text) {
var component = Component.Serializer.fromJsonLenient(text.toJSONString(), delegate.registryAccess());
var component = Component.Serializer.fromJsonLenient(text.toJSONString());
if (component != null)
delegate.sendSuccess(() -> component, false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public ForgeWorld(ServerLevel delegate) {
this.delegate = new WeakReference<>(delegate);

MinecraftServer server = delegate.getServer();
this.worldFolder = delegate.getServer().getServerDirectory()
this.worldFolder = delegate.getServer().getServerDirectory().toPath()
.resolve(server.getWorldPath(LevelResource.ROOT));

ResourceLocation id = delegate.dimension().location();
Expand Down
12 changes: 6 additions & 6 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ includeBuild("api")
include(":core")
include(":common")

implementation("cli")
implementation("fabric")
//implementation("cli")
//implementation("fabric")
implementation("forge")
implementation("neoforge")
implementation("paper")
implementation("spigot")
implementation("sponge")
//implementation("neoforge")
//implementation("paper")
//implementation("spigot")
//implementation("sponge")

fun implementation(name: String) {
val project = ":$name"
Expand Down

0 comments on commit 1b6a1f0

Please sign in to comment.