Skip to content

Commit

Permalink
Groovy to GradleDLS
Browse files Browse the repository at this point in the history
  • Loading branch information
TonimatasDEV committed Aug 20, 2023
1 parent b4a8883 commit f8e6703
Show file tree
Hide file tree
Showing 21 changed files with 197 additions and 201 deletions.
5 changes: 0 additions & 5 deletions build.gradle

This file was deleted.

15 changes: 15 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
plugins {
java
}

val modVersion: String by extra
val minecraftVersion: String by extra

subprojects {
apply(plugin = "java")

version = "$modVersion-$minecraftVersion"
group = "net.tonimatasdev"

base.archivesName.set("PacketFixer-" + project.name)
}
51 changes: 0 additions & 51 deletions fabric/build.gradle

This file was deleted.

44 changes: 44 additions & 0 deletions fabric/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
@file:Suppress("UnstableApiUsage")

plugins {
id("fabric-loom") version "1.3-SNAPSHOT"
}

val loaderVersion: String by extra
val yarnMappings: String by extra
val modVersion: String by extra
val minecraftVersion: String by extra

dependencies {
minecraft("com.mojang:minecraft:$minecraftVersion")
mappings("net.fabricmc:yarn:$yarnMappings:v2")
modImplementation("net.fabricmc:fabric-loader:$loaderVersion")

}

tasks.withType<ProcessResources> {
val replaceProperties = mapOf("version" to modVersion, "minecraftVersion" to minecraftVersion)

inputs.properties(replaceProperties)

filesMatching("fabric.mod.json") {
expand(replaceProperties)
}
}

tasks.withType<JavaCompile> {
options.release.set(17)
}

java {
withSourcesJar()

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

tasks.jar {
from("LICENSE") {
rename { "${it}_${project.base.archivesName.get()}"}
}
}
2 changes: 1 addition & 1 deletion fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
],
"depends": {
"fabricloader": ">=0.12.12",
"minecraft": "${minecraft_version}"
"minecraft": "${minecraftVersion}"
}
}
107 changes: 0 additions & 107 deletions forge/build.gradle

This file was deleted.

105 changes: 105 additions & 0 deletions forge/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
plugins {
id("net.minecraftforge.gradle") version "[6.0,6.2)"
id("org.spongepowered.mixin") version "0.7-SNAPSHOT"
id("idea")
id("eclipse")
}

val modVersion: String by extra
val minecraftVersion: String by extra
val forgeVersion: String by extra
val forgeVersionRange: String by extra

group = "net.tonimatasdev"
version = "$modVersion-$minecraftVersion"

java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
withSourcesJar()
}

minecraft {
mappings("official", minecraftVersion)

copyIdeResources.set(true)

runs {
configureEach {
workingDirectory(project.file("run"))
property("forge.logging.markers", "REGISTRIES")
property("forge.logging.console.level", "debug")

mods {
create("packetfixer") {
source(sourceSets.main.get())
}
}
}

create("client") {
property("forge.enabledGameTestNamespaces", "packetfixer")
}

create("server") {
property("forge.enabledGameTestNamespaces", "packetfixer")
args("--nogui")
}

create("gameTestServer") {
property("forge.enabledGameTestNamespaces", "packetfixer")
}

create("data") {
workingDirectory(project.file("run-data"))
args("--mod", "packetfixer", "--all", "--output", file("src/generated/resources/"), "--existing", file("src/main/resources/"))
}
}
}

mixin {
add(sourceSets.main.get(), "packetfixer.refmap.json")
config("packetfixer.mixins.json")
}

sourceSets.main.get().resources { srcDir("src/generated/resources") }

repositories {

}

dependencies {
minecraft("net.minecraftforge:forge:$minecraftVersion-$forgeVersion")
annotationProcessor("org.spongepowered:mixin:0.8.5:processor")
}



tasks.withType<ProcessResources> {
val replaceProperties = mapOf("forgeVersionRange" to forgeVersionRange, "version" to modVersion, "minecraftVersion" to minecraftVersion)

inputs.properties(replaceProperties)

filesMatching(listOf("META-INF/mods.toml", "pack.mcmeta")) {
expand(replaceProperties)
}
}


tasks.jar {
manifest {
attributes(
"Specification-Title" to "PacketFixerForge",
"Specification-Vendor" to "TonimatasDEV",
"Specification-Version" to modVersion,
"Implementation-Title" to "PacketFixerForge",
"Implementation-Version" to modVersion,
"Implementation-Vendor" to "TonimatasDEV"
)
}

finalizedBy("reobfJar")
}

tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.tonimatasdev.packetsizedoubler;
package net.tonimatasdev.packetfixerforge;

import com.mojang.logging.LogUtils;
import net.minecraftforge.fml.common.Mod;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.tonimatasdev.packetsizedoubler.mixin;
package net.tonimatasdev.packetfixerforge.mixin;


import net.minecraft.network.protocol.game.ClientboundCustomPayloadPacket;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.tonimatasdev.packetsizedoubler.mixin;
package net.tonimatasdev.packetfixerforge.mixin;

import net.minecraft.network.protocol.login.ClientboundCustomQueryPacket;
import org.spongepowered.asm.mixin.Mixin;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.tonimatasdev.packetsizedoubler.mixin;
package net.tonimatasdev.packetfixerforge.mixin;

import net.minecraft.network.CompressionDecoder;
import org.spongepowered.asm.mixin.Mixin;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.tonimatasdev.packetsizedoubler.mixin;
package net.tonimatasdev.packetfixerforge.mixin;

import com.mojang.logging.LogUtils;
import io.netty.buffer.ByteBuf;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.tonimatasdev.packetsizedoubler.mixin;
package net.tonimatasdev.packetfixerforge.mixin;

import net.minecraft.nbt.NbtAccounter;
import org.objectweb.asm.Opcodes;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.tonimatasdev.packetsizedoubler.mixin;
package net.tonimatasdev.packetfixerforge.mixin;

import net.minecraft.network.PacketEncoder;
import org.spongepowered.asm.mixin.Mixin;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.tonimatasdev.packetsizedoubler.mixin;
package net.tonimatasdev.packetfixerforge.mixin;

import net.minecraft.network.protocol.game.ServerboundCustomPayloadPacket;
import org.spongepowered.asm.mixin.Mixin;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.tonimatasdev.packetsizedoubler.mixin;
package net.tonimatasdev.packetfixerforge.mixin;

import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.network.protocol.login.ServerboundCustomQueryPacket;
Expand Down
Loading

0 comments on commit f8e6703

Please sign in to comment.