From 052ca64fa6cea41554983c52c2807ee9c8d581bc Mon Sep 17 00:00:00 2001 From: Waffles Date: Thu, 12 Feb 2026 12:13:41 -0500 Subject: [PATCH 1/6] code cleanup --- .../waffles/additional/util/HypixelAPIUtils.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/me/waffles/additional/util/HypixelAPIUtils.java b/src/main/java/me/waffles/additional/util/HypixelAPIUtils.java index fb4f688..4431f9c 100644 --- a/src/main/java/me/waffles/additional/util/HypixelAPIUtils.java +++ b/src/main/java/me/waffles/additional/util/HypixelAPIUtils.java @@ -91,14 +91,14 @@ public static PlayerProfile parsePlayerProfilePlayerData(String json, String gui : null; if(tag != null) { - if(tag.contains("✧")) tag = tag.replaceAll("✧", "✧"); - if(tag.contains("Î")) tag = tag.replaceAll("Î", "Θ"); - if(tag.contains("✌")) tag = tag.replaceAll("✌", "✌"); - if(tag.contains("â?¤")) tag = tag.replaceAll("â?¤", "❤"); - if(tag.contains("✿")) tag = tag.replaceAll("✿", "✿"); - if(tag.contains("✪")) tag = tag.replaceAll("✪", "✪"); - if(tag.contains("➊")) tag = tag.replaceAll("➊", "➊"); - if(tag.contains("✖")) tag = tag.replaceAll("✖", "✖"); + tag = tag.replaceAll("✧", "✧") + .replaceAll("Î", "Θ") + .replaceAll("✌", "✌") + .replaceAll("â?¤", "❤") + .replaceAll("✿", "✿") + .replaceAll("✪", "✪") + .replaceAll("➊", "➊") + .replaceAll("✖", "✖"); } String tagColor = guildObject.has("tagColor") From 545acc5838d1f0e4ef136d04b7127513e0bc907d Mon Sep 17 00:00:00 2001 From: Waffles3438 <96705793+Waffles3438@users.noreply.github.com> Date: Sat, 7 Mar 2026 13:30:29 -0500 Subject: [PATCH 2/6] test --- src/main/java/me/waffles/additional/Additional.java | 6 +++--- .../me/waffles/additional/command/BedwarsStatsCommand.java | 4 ++-- .../me/waffles/additional/command/DuelsStatsCommand.java | 4 ++-- .../me/waffles/additional/{util => playerData}/Bedwars.java | 2 +- .../me/waffles/additional/{util => playerData}/Duels.java | 2 +- .../additional/{util => playerData}/PlayerProfile.java | 2 +- .../java/me/waffles/additional/util/HypixelAPIUtils.java | 3 +++ 7 files changed, 13 insertions(+), 10 deletions(-) rename src/main/java/me/waffles/additional/{util => playerData}/Bedwars.java (96%) rename src/main/java/me/waffles/additional/{util => playerData}/Duels.java (96%) rename src/main/java/me/waffles/additional/{util => playerData}/PlayerProfile.java (91%) diff --git a/src/main/java/me/waffles/additional/Additional.java b/src/main/java/me/waffles/additional/Additional.java index 77a5607..64355c8 100644 --- a/src/main/java/me/waffles/additional/Additional.java +++ b/src/main/java/me/waffles/additional/Additional.java @@ -11,10 +11,10 @@ import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import me.waffles.additional.mixin.EntityLivingBaseAccessor; -import me.waffles.additional.util.Bedwars; -import me.waffles.additional.util.Duels; +import me.waffles.additional.playerData.Bedwars; +import me.waffles.additional.playerData.Duels; import me.waffles.additional.util.EldestRemovalMap; -import me.waffles.additional.util.PlayerProfile; +import me.waffles.additional.playerData.PlayerProfile; @Mod(modid = Additional.MODID, name = Additional.NAME, version = Additional.VERSION) public class Additional { diff --git a/src/main/java/me/waffles/additional/command/BedwarsStatsCommand.java b/src/main/java/me/waffles/additional/command/BedwarsStatsCommand.java index 30a0176..77a1804 100644 --- a/src/main/java/me/waffles/additional/command/BedwarsStatsCommand.java +++ b/src/main/java/me/waffles/additional/command/BedwarsStatsCommand.java @@ -6,9 +6,9 @@ import cc.polyfrost.oneconfig.utils.commands.annotations.Main; import com.mojang.authlib.GameProfile; import me.waffles.additional.Additional; -import me.waffles.additional.util.Bedwars; +import me.waffles.additional.playerData.Bedwars; import me.waffles.additional.util.HypixelAPIUtils; -import me.waffles.additional.util.PlayerProfile; +import me.waffles.additional.playerData.PlayerProfile; import net.minecraft.client.Minecraft; import java.io.IOException; diff --git a/src/main/java/me/waffles/additional/command/DuelsStatsCommand.java b/src/main/java/me/waffles/additional/command/DuelsStatsCommand.java index fd054c3..1a463fd 100644 --- a/src/main/java/me/waffles/additional/command/DuelsStatsCommand.java +++ b/src/main/java/me/waffles/additional/command/DuelsStatsCommand.java @@ -7,8 +7,8 @@ import com.mojang.authlib.GameProfile; import me.waffles.additional.Additional; import me.waffles.additional.util.HypixelAPIUtils; -import me.waffles.additional.util.Duels; -import me.waffles.additional.util.PlayerProfile; +import me.waffles.additional.playerData.Duels; +import me.waffles.additional.playerData.PlayerProfile; import net.minecraft.client.Minecraft; import java.util.NavigableMap; diff --git a/src/main/java/me/waffles/additional/util/Bedwars.java b/src/main/java/me/waffles/additional/playerData/Bedwars.java similarity index 96% rename from src/main/java/me/waffles/additional/util/Bedwars.java rename to src/main/java/me/waffles/additional/playerData/Bedwars.java index af35eda..e4d0011 100644 --- a/src/main/java/me/waffles/additional/util/Bedwars.java +++ b/src/main/java/me/waffles/additional/playerData/Bedwars.java @@ -1,4 +1,4 @@ -package me.waffles.additional.util; +package me.waffles.additional.playerData; public class Bedwars { private final int Bedwarsstar; diff --git a/src/main/java/me/waffles/additional/util/Duels.java b/src/main/java/me/waffles/additional/playerData/Duels.java similarity index 96% rename from src/main/java/me/waffles/additional/util/Duels.java rename to src/main/java/me/waffles/additional/playerData/Duels.java index c1b0373..9eac399 100644 --- a/src/main/java/me/waffles/additional/util/Duels.java +++ b/src/main/java/me/waffles/additional/playerData/Duels.java @@ -1,4 +1,4 @@ -package me.waffles.additional.util; +package me.waffles.additional.playerData; public class Duels { private final int Duelswins; diff --git a/src/main/java/me/waffles/additional/util/PlayerProfile.java b/src/main/java/me/waffles/additional/playerData/PlayerProfile.java similarity index 91% rename from src/main/java/me/waffles/additional/util/PlayerProfile.java rename to src/main/java/me/waffles/additional/playerData/PlayerProfile.java index dcf642e..8909152 100644 --- a/src/main/java/me/waffles/additional/util/PlayerProfile.java +++ b/src/main/java/me/waffles/additional/playerData/PlayerProfile.java @@ -1,4 +1,4 @@ -package me.waffles.additional.util; +package me.waffles.additional.playerData; public class PlayerProfile { private final String displayName, rank, guildTag; diff --git a/src/main/java/me/waffles/additional/util/HypixelAPIUtils.java b/src/main/java/me/waffles/additional/util/HypixelAPIUtils.java index 4431f9c..cbe9fc0 100644 --- a/src/main/java/me/waffles/additional/util/HypixelAPIUtils.java +++ b/src/main/java/me/waffles/additional/util/HypixelAPIUtils.java @@ -5,6 +5,9 @@ import com.google.gson.JsonObject; import com.google.gson.JsonParser; import me.waffles.additional.command.DuelsStatsCommand; +import me.waffles.additional.playerData.Bedwars; +import me.waffles.additional.playerData.Duels; +import me.waffles.additional.playerData.PlayerProfile; import java.io.BufferedReader; import java.io.InputStreamReader; From a802acd87f336f1e255b9392b78cfad8a7ac01d6 Mon Sep 17 00:00:00 2001 From: Waffles3438 <96705793+Waffles3438@users.noreply.github.com> Date: Sat, 7 Mar 2026 13:31:10 -0500 Subject: [PATCH 3/6] revert --- build.gradle.kts | 197 ++++++++++++++++-- gradle.properties | 15 +- gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew | 2 +- root.gradle.kts | 11 + settings.gradle.kts | 38 ++-- .../me/waffles/additional/Additional.java | 7 +- src/main/resources/mcmod.info | 17 +- src/main/resources/mixins.additional.json | 2 +- versions/mainProject | 1 + 10 files changed, 241 insertions(+), 51 deletions(-) create mode 100644 root.gradle.kts create mode 100644 versions/mainProject diff --git a/build.gradle.kts b/build.gradle.kts index d914df1..0b5413d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,35 +1,192 @@ -import dev.deftu.gradle.utils.GameSide +@file:Suppress("UnstableApiUsage", "PropertyName") +import org.polyfrost.gradle.util.noServerRunConfigs +import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar + +// Adds support for kotlin, and adds the Polyfrost Gradle Toolkit +// which we use to prepare the environment. plugins { - id("java") - id("dev.deftu.gradle.tools") version("2.69.+") - id("dev.deftu.gradle.tools.resources") version("2.69.+") - id("dev.deftu.gradle.tools.bloom") version("2.69.+") - id("dev.deftu.gradle.tools.shadow") version("2.69.+") - id("dev.deftu.gradle.tools.minecraft.loom") version("2.69.+") + kotlin("jvm") + id("org.polyfrost.multi-version") + id("org.polyfrost.defaults.repo") + id("org.polyfrost.defaults.java") + id("org.polyfrost.defaults.loom") + id("com.github.johnrengelman.shadow") + id("net.kyori.blossom") version "1.3.2" + id("signing") + java +} + +// Gets the mod name, version and id from the `gradle.properties` file. +val mod_name: String by project +val mod_version: String by project +val mod_id: String by project +val mod_archives_name: String by project + +// Replaces the variables in `ExampleMod.java` to the ones specified in `gradle.properties`. +blossom { + replaceToken("@VER@", mod_version) + replaceToken("@NAME@", mod_name) + replaceToken("@ID@", mod_id) +} + +// Sets the mod version to the one specified in `gradle.properties`. Make sure to change this following semver! +version = mod_version +// Sets the group, make sure to change this to your own. It can be a website you own backwards or your GitHub username. +// e.g. com.github. or com. +group = "org.polyfrost" + +// Sets the name of the output jar (the one you put in your mods folder and send to other people) +// It outputs all versions of the mod into the `versions/{mcVersion}/build` directory. +base { + archivesName.set("$mod_archives_name-$platform") +} + +// Configures Polyfrost Loom, our plugin fork to easily set up the programming environment. +loom { + // Removes the server configs from IntelliJ IDEA, leaving only client runs. + noServerRunConfigs() + + // Adds the tweak class if we are building legacy version of forge as per the documentation (https://docs.polyfrost.org) + if (project.platform.isLegacyForge) { + runConfigs { + "client" { + programArgs("--tweakClass", "cc.polyfrost.oneconfig.loader.stage0.LaunchWrapperTweaker") + property("mixin.debug.export", "true") // Outputs all mixin changes to `versions/{mcVersion}/run/.mixin.out/class` + } + } + } + // Configures the mixins if we are building for forge + if (project.platform.isForge) { + forge { + mixinConfig("mixins.${mod_id}.json") + } + } + // Configures the name of the mixin "refmap" + mixin.defaultRefmapName.set("mixins.${mod_id}.refmap.json") } +// Creates the shade/shadow configuration, so we can include libraries inside our mod, rather than having to add them separately. +val shade: Configuration by configurations.creating { + configurations.implementation.get().extendsFrom(this) +} +val modShade: Configuration by configurations.creating { + configurations.modImplementation.get().extendsFrom(this) +} + +// Configures the output directory for when building from the `src/resources` directory. +sourceSets { + main { + output.setResourcesDir(java.classesDirectory) + } +} + +// Adds the Polyfrost maven repository so that we can get the libraries necessary to develop the mod. repositories { maven("https://repo.polyfrost.org/releases") - maven("https://repo.polyfrost.org/snapshots") } +// Configures the libraries/dependencies for your mod. dependencies { - compileOnly("cc.polyfrost:oneconfig-1.8.9-forge:0.2.2-alpha+") + // Adds the OneConfig library, so we can develop with it. + modCompileOnly("cc.polyfrost:oneconfig-$platform:0.2.2-alpha+") - shade("cc.polyfrost:oneconfig-wrapper-launchwrapper:1.0.0-beta+") - implementation("cc.polyfrost:oneconfig-wrapper-launchwrapper:1.0.0-beta+") + // Adds DevAuth, which we can use to log in to Minecraft in development. + modRuntimeOnly("me.djtheredstoner:DevAuth-${if (platform.isFabric) "fabric" else if (platform.isLegacyForge) "forge-legacy" else "forge-latest"}:1.2.0") - compileOnly("org.spongepowered:mixin:0.7.11-SNAPSHOT") + // If we are building for legacy forge, includes the launch wrapper with `shade` as we configured earlier, as well as mixin 0.7.11 + if (platform.isLegacyForge) { + compileOnly("org.spongepowered:mixin:0.7.11-SNAPSHOT") + shade("cc.polyfrost:oneconfig-wrapper-launchwrapper:1.0.0-beta17") + } } -toolkitLoomHelper { - useMixinRefMap(modData.id) - useForgeMixin(modData.id) +tasks { + // Processes the `src/resources/mcmod.info`, `fabric.mod.json`, or `mixins.${mod_id}.json` and replaces + // the mod id, name and version with the ones in `gradle.properties` + processResources { + inputs.property("id", mod_id) + inputs.property("name", mod_name) + val java = if (project.platform.mcMinor >= 18) { + 17 // If we are playing on version 1.18, set the java version to 17 + } else { + // Else if we are playing on version 1.17, use java 16. + if (project.platform.mcMinor == 17) + 16 + else + 8 // For all previous versions, we **need** java 8 (for Forge support). + } + val compatLevel = "JAVA_${java}" + inputs.property("java", java) + inputs.property("java_level", compatLevel) + inputs.property("version", mod_version) + inputs.property("mcVersionStr", project.platform.mcVersionStr) + filesMatching(listOf("mcmod.info", "mixins.${mod_id}.json", "mods.toml")) { + expand( + mapOf( + "id" to mod_id, + "name" to mod_name, + "java" to java, + "java_level" to compatLevel, + "version" to mod_version, + "mcVersionStr" to project.platform.mcVersionStr + ) + ) + } + filesMatching("fabric.mod.json") { + expand( + mapOf( + "id" to mod_id, + "name" to mod_name, + "java" to java, + "java_level" to compatLevel, + "version" to mod_version, + "mcVersionStr" to project.platform.mcVersionStr.substringBeforeLast(".") + ".x" + ) + ) + } + } + + // Configures the resources to include if we are building for forge or fabric. + withType(Jar::class.java) { + if (project.platform.isFabric) { + exclude("mcmod.info", "mods.toml") + } else { + exclude("fabric.mod.json") + if (project.platform.isLegacyForge) { + exclude("mods.toml") + } else { + exclude("mcmod.info") + } + } + } - useTweaker("cc.polyfrost.oneconfig.loader.stage0.LaunchWrapperTweaker") + // Configures our shadow/shade configuration, so we can + // include some dependencies within our mod jar file. + named("shadowJar") { + archiveClassifier.set("dev") + configurations = listOf(shade, modShade) + duplicatesStrategy = DuplicatesStrategy.EXCLUDE + } - useDevAuth("+") - useProperty("mixin.debug.export", "true", GameSide.CLIENT) - disableRunConfigs(GameSide.SERVER) -} \ No newline at end of file + remapJar { + inputFile.set(shadowJar.get().archiveFile) + archiveClassifier.set("") + } + + jar { + // Sets the jar manifest attributes. + if (platform.isLegacyForge) { + manifest.attributes += mapOf( + "ModSide" to "CLIENT", // We aren't developing a server-side mod + "ForceLoadAsMod" to true, // We want to load this jar as a mod, so we force Forge to do so. + "TweakOrder" to "0", // Makes sure that the OneConfig launch wrapper is loaded as soon as possible. + "MixinConfigs" to "mixins.${mod_id}.json", // We want to use our mixin configuration, so we specify it here. + "TweakClass" to "cc.polyfrost.oneconfig.loader.stage0.LaunchWrapperTweaker" // Loads the OneConfig launch wrapper. + ) + } + dependsOn(shadowJar) + archiveClassifier.set("") + enabled = false + } +} diff --git a/gradle.properties b/gradle.properties index ba0cadb..781b19d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,10 +1,19 @@ +<<<<<<< HEAD mod.name=Additional mod.id=additional mod.version=3.0.3 +======= +# gradle.properties file -- CHANGE THE VALUES STARTING WITH `mod_*` AND REMOVE THIS COMMENT. +>>>>>>> parent of e0f4bdf (remove preprocessor and use dgt) -minecraft.version=1.8.9 -loom.platform=forge -java.version=8 +# Sets the name of your mod. +mod_name=Additional +# Sets the id of your mod that mod loaders use to recognize it. +mod_id=additional +# Sets the version of your mod. Make sure to update this when you make changes according to semver. +mod_version=3.0.2 +# Sets the name of the jar file that you put in your 'mods' folder. +mod_archives_name=Additional # Gradle Configuration -- DO NOT TOUCH THESE VALUES. polyfrost.defaults.loom=3 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index aaaabb3..a441313 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index b740cf1..1aa94a4 100755 --- a/gradlew +++ b/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. diff --git a/root.gradle.kts b/root.gradle.kts new file mode 100644 index 0000000..acd0973 --- /dev/null +++ b/root.gradle.kts @@ -0,0 +1,11 @@ +plugins { + kotlin("jvm") version "1.9.10" apply false + id("org.polyfrost.multi-version.root") + id("com.github.johnrengelman.shadow") version "8.1.1" apply false +} + +preprocess { + //"1.12.2-forge"(11202, "srg") { + "1.8.9-forge"(10809, "srg") + //} +} \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts index b628b1e..9e578e6 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,25 +1,31 @@ @file:Suppress("PropertyName") -import groovy.lang.MissingPropertyException - pluginManagement { repositories { - maven("https://maven.deftu.dev/releases") - maven("https://maven.fabricmc.net") - maven("https://maven.architectury.dev/") - maven("https://maven.minecraftforge.net") - maven("https://repo.essential.gg/repository/maven-public") - maven("https://server.bbkr.space/artifactory/libs-release/") - maven("https://jitpack.io/") - - maven("https://maven.deftu.dev/snapshots") - mavenLocal() - gradlePluginPortal() mavenCentral() + maven("https://repo.polyfrost.org/releases") // Adds the Polyfrost maven repository to get Polyfrost Gradle Toolkit + } + plugins { + val pgtVersion = "0.6.5" // Sets the default versions for Polyfrost Gradle Toolkit + id("org.polyfrost.multi-version.root") version pgtVersion } } -val projectName: String = extra["mod.name"]?.toString() ?: throw MissingPropertyException("mod.name has not been set.") -rootProject.name = projectName -rootProject.buildFileName = "build.gradle.kts" \ No newline at end of file +val mod_name: String by settings + +// Configures the root project Gradle name based on the value in `gradle.properties` +rootProject.name = mod_name +rootProject.buildFileName = "root.gradle.kts" + +// Adds all of our build target versions to the classpath if we need to add version-specific code. +listOf( + "1.8.9-forge", // Update this if you want to remove/add a version, along with `build.gradle.kts` and `root.gradle.kts`. + //"1.12.2-forge" // uncomment if you want 1.12.2 support in your mod +).forEach { version -> + include(":$version") + project(":$version").apply { + projectDir = file("versions/$version") + buildFileName = "../../build.gradle.kts" + } +} diff --git a/src/main/java/me/waffles/additional/Additional.java b/src/main/java/me/waffles/additional/Additional.java index 64355c8..c344447 100644 --- a/src/main/java/me/waffles/additional/Additional.java +++ b/src/main/java/me/waffles/additional/Additional.java @@ -19,10 +19,9 @@ @Mod(modid = Additional.MODID, name = Additional.NAME, version = Additional.VERSION) public class Additional { - public static final String MODID = "@MOD_ID@"; - public static final String NAME = "@MOD_NAME@"; - public static final String VERSION = "@MOD_VERSION@"; - + public static final String MODID = "@ID@"; + public static final String NAME = "@NAME@"; + public static final String VERSION = "@VER@"; public static ModConfig config; public static EldestRemovalMap duelsStatsList; public static EldestRemovalMap bedwarsStatsList; diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index d3c8586..c379eaa 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -1,11 +1,18 @@ [ { - "modid": "${mod_id}", - "name": "${mod_name}", - "version": "${mod_version}", - "mcversion": "${mc_version}", + "modid": "${id}", + "name": "${name}", + "description": "", + "version": "${version}", + "mcversion": "${mcVersionStr}", + "url": "", + "updateUrl": "", "authorList": [ "iAT3" - ] + ], + "credits": "", + "logoFile": "", + "screenshots": [], + "dependencies": [] } ] \ No newline at end of file diff --git a/src/main/resources/mixins.additional.json b/src/main/resources/mixins.additional.json index ce73b9f..ab9c0b1 100644 --- a/src/main/resources/mixins.additional.json +++ b/src/main/resources/mixins.additional.json @@ -2,7 +2,7 @@ "compatibilityLevel": "JAVA_8", "minVersion": "0.7", "package": "me.waffles.additional.mixin", - "refmap": "mixins.${mod_id}.refmap.json", + "refmap": "mixins.${id}.refmap.json", "injectors": { "maxShiftBy": 5 }, diff --git a/versions/mainProject b/versions/mainProject new file mode 100644 index 0000000..dd1433e --- /dev/null +++ b/versions/mainProject @@ -0,0 +1 @@ +1.8.9-forge \ No newline at end of file From 9a92ab5dcbf5efe1633ccf9e755929c0ce2af6f3 Mon Sep 17 00:00:00 2001 From: Waffles3438 <96705793+Waffles3438@users.noreply.github.com> Date: Sat, 7 Mar 2026 13:32:16 -0500 Subject: [PATCH 4/6] Revert "revert" This reverts commit a802acd87f336f1e255b9392b78cfad8a7ac01d6. --- build.gradle.kts | 197 ++---------------- gradle.properties | 15 +- gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew | 2 +- root.gradle.kts | 11 - settings.gradle.kts | 38 ++-- .../me/waffles/additional/Additional.java | 7 +- src/main/resources/mcmod.info | 17 +- src/main/resources/mixins.additional.json | 2 +- versions/mainProject | 1 - 10 files changed, 51 insertions(+), 241 deletions(-) delete mode 100644 root.gradle.kts delete mode 100644 versions/mainProject diff --git a/build.gradle.kts b/build.gradle.kts index 0b5413d..d914df1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,192 +1,35 @@ -@file:Suppress("UnstableApiUsage", "PropertyName") +import dev.deftu.gradle.utils.GameSide -import org.polyfrost.gradle.util.noServerRunConfigs -import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar - -// Adds support for kotlin, and adds the Polyfrost Gradle Toolkit -// which we use to prepare the environment. plugins { - kotlin("jvm") - id("org.polyfrost.multi-version") - id("org.polyfrost.defaults.repo") - id("org.polyfrost.defaults.java") - id("org.polyfrost.defaults.loom") - id("com.github.johnrengelman.shadow") - id("net.kyori.blossom") version "1.3.2" - id("signing") - java -} - -// Gets the mod name, version and id from the `gradle.properties` file. -val mod_name: String by project -val mod_version: String by project -val mod_id: String by project -val mod_archives_name: String by project - -// Replaces the variables in `ExampleMod.java` to the ones specified in `gradle.properties`. -blossom { - replaceToken("@VER@", mod_version) - replaceToken("@NAME@", mod_name) - replaceToken("@ID@", mod_id) -} - -// Sets the mod version to the one specified in `gradle.properties`. Make sure to change this following semver! -version = mod_version -// Sets the group, make sure to change this to your own. It can be a website you own backwards or your GitHub username. -// e.g. com.github. or com. -group = "org.polyfrost" - -// Sets the name of the output jar (the one you put in your mods folder and send to other people) -// It outputs all versions of the mod into the `versions/{mcVersion}/build` directory. -base { - archivesName.set("$mod_archives_name-$platform") -} - -// Configures Polyfrost Loom, our plugin fork to easily set up the programming environment. -loom { - // Removes the server configs from IntelliJ IDEA, leaving only client runs. - noServerRunConfigs() - - // Adds the tweak class if we are building legacy version of forge as per the documentation (https://docs.polyfrost.org) - if (project.platform.isLegacyForge) { - runConfigs { - "client" { - programArgs("--tweakClass", "cc.polyfrost.oneconfig.loader.stage0.LaunchWrapperTweaker") - property("mixin.debug.export", "true") // Outputs all mixin changes to `versions/{mcVersion}/run/.mixin.out/class` - } - } - } - // Configures the mixins if we are building for forge - if (project.platform.isForge) { - forge { - mixinConfig("mixins.${mod_id}.json") - } - } - // Configures the name of the mixin "refmap" - mixin.defaultRefmapName.set("mixins.${mod_id}.refmap.json") + id("java") + id("dev.deftu.gradle.tools") version("2.69.+") + id("dev.deftu.gradle.tools.resources") version("2.69.+") + id("dev.deftu.gradle.tools.bloom") version("2.69.+") + id("dev.deftu.gradle.tools.shadow") version("2.69.+") + id("dev.deftu.gradle.tools.minecraft.loom") version("2.69.+") } -// Creates the shade/shadow configuration, so we can include libraries inside our mod, rather than having to add them separately. -val shade: Configuration by configurations.creating { - configurations.implementation.get().extendsFrom(this) -} -val modShade: Configuration by configurations.creating { - configurations.modImplementation.get().extendsFrom(this) -} - -// Configures the output directory for when building from the `src/resources` directory. -sourceSets { - main { - output.setResourcesDir(java.classesDirectory) - } -} - -// Adds the Polyfrost maven repository so that we can get the libraries necessary to develop the mod. repositories { maven("https://repo.polyfrost.org/releases") + maven("https://repo.polyfrost.org/snapshots") } -// Configures the libraries/dependencies for your mod. dependencies { - // Adds the OneConfig library, so we can develop with it. - modCompileOnly("cc.polyfrost:oneconfig-$platform:0.2.2-alpha+") + compileOnly("cc.polyfrost:oneconfig-1.8.9-forge:0.2.2-alpha+") - // Adds DevAuth, which we can use to log in to Minecraft in development. - modRuntimeOnly("me.djtheredstoner:DevAuth-${if (platform.isFabric) "fabric" else if (platform.isLegacyForge) "forge-legacy" else "forge-latest"}:1.2.0") + shade("cc.polyfrost:oneconfig-wrapper-launchwrapper:1.0.0-beta+") + implementation("cc.polyfrost:oneconfig-wrapper-launchwrapper:1.0.0-beta+") - // If we are building for legacy forge, includes the launch wrapper with `shade` as we configured earlier, as well as mixin 0.7.11 - if (platform.isLegacyForge) { - compileOnly("org.spongepowered:mixin:0.7.11-SNAPSHOT") - shade("cc.polyfrost:oneconfig-wrapper-launchwrapper:1.0.0-beta17") - } + compileOnly("org.spongepowered:mixin:0.7.11-SNAPSHOT") } -tasks { - // Processes the `src/resources/mcmod.info`, `fabric.mod.json`, or `mixins.${mod_id}.json` and replaces - // the mod id, name and version with the ones in `gradle.properties` - processResources { - inputs.property("id", mod_id) - inputs.property("name", mod_name) - val java = if (project.platform.mcMinor >= 18) { - 17 // If we are playing on version 1.18, set the java version to 17 - } else { - // Else if we are playing on version 1.17, use java 16. - if (project.platform.mcMinor == 17) - 16 - else - 8 // For all previous versions, we **need** java 8 (for Forge support). - } - val compatLevel = "JAVA_${java}" - inputs.property("java", java) - inputs.property("java_level", compatLevel) - inputs.property("version", mod_version) - inputs.property("mcVersionStr", project.platform.mcVersionStr) - filesMatching(listOf("mcmod.info", "mixins.${mod_id}.json", "mods.toml")) { - expand( - mapOf( - "id" to mod_id, - "name" to mod_name, - "java" to java, - "java_level" to compatLevel, - "version" to mod_version, - "mcVersionStr" to project.platform.mcVersionStr - ) - ) - } - filesMatching("fabric.mod.json") { - expand( - mapOf( - "id" to mod_id, - "name" to mod_name, - "java" to java, - "java_level" to compatLevel, - "version" to mod_version, - "mcVersionStr" to project.platform.mcVersionStr.substringBeforeLast(".") + ".x" - ) - ) - } - } - - // Configures the resources to include if we are building for forge or fabric. - withType(Jar::class.java) { - if (project.platform.isFabric) { - exclude("mcmod.info", "mods.toml") - } else { - exclude("fabric.mod.json") - if (project.platform.isLegacyForge) { - exclude("mods.toml") - } else { - exclude("mcmod.info") - } - } - } +toolkitLoomHelper { + useMixinRefMap(modData.id) + useForgeMixin(modData.id) - // Configures our shadow/shade configuration, so we can - // include some dependencies within our mod jar file. - named("shadowJar") { - archiveClassifier.set("dev") - configurations = listOf(shade, modShade) - duplicatesStrategy = DuplicatesStrategy.EXCLUDE - } + useTweaker("cc.polyfrost.oneconfig.loader.stage0.LaunchWrapperTweaker") - remapJar { - inputFile.set(shadowJar.get().archiveFile) - archiveClassifier.set("") - } - - jar { - // Sets the jar manifest attributes. - if (platform.isLegacyForge) { - manifest.attributes += mapOf( - "ModSide" to "CLIENT", // We aren't developing a server-side mod - "ForceLoadAsMod" to true, // We want to load this jar as a mod, so we force Forge to do so. - "TweakOrder" to "0", // Makes sure that the OneConfig launch wrapper is loaded as soon as possible. - "MixinConfigs" to "mixins.${mod_id}.json", // We want to use our mixin configuration, so we specify it here. - "TweakClass" to "cc.polyfrost.oneconfig.loader.stage0.LaunchWrapperTweaker" // Loads the OneConfig launch wrapper. - ) - } - dependsOn(shadowJar) - archiveClassifier.set("") - enabled = false - } -} + useDevAuth("+") + useProperty("mixin.debug.export", "true", GameSide.CLIENT) + disableRunConfigs(GameSide.SERVER) +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 781b19d..ba0cadb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,19 +1,10 @@ -<<<<<<< HEAD mod.name=Additional mod.id=additional mod.version=3.0.3 -======= -# gradle.properties file -- CHANGE THE VALUES STARTING WITH `mod_*` AND REMOVE THIS COMMENT. ->>>>>>> parent of e0f4bdf (remove preprocessor and use dgt) -# Sets the name of your mod. -mod_name=Additional -# Sets the id of your mod that mod loaders use to recognize it. -mod_id=additional -# Sets the version of your mod. Make sure to update this when you make changes according to semver. -mod_version=3.0.2 -# Sets the name of the jar file that you put in your 'mods' folder. -mod_archives_name=Additional +minecraft.version=1.8.9 +loom.platform=forge +java.version=8 # Gradle Configuration -- DO NOT TOUCH THESE VALUES. polyfrost.defaults.loom=3 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a441313..aaaabb3 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.4-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 1aa94a4..b740cf1 100755 --- a/gradlew +++ b/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. diff --git a/root.gradle.kts b/root.gradle.kts deleted file mode 100644 index acd0973..0000000 --- a/root.gradle.kts +++ /dev/null @@ -1,11 +0,0 @@ -plugins { - kotlin("jvm") version "1.9.10" apply false - id("org.polyfrost.multi-version.root") - id("com.github.johnrengelman.shadow") version "8.1.1" apply false -} - -preprocess { - //"1.12.2-forge"(11202, "srg") { - "1.8.9-forge"(10809, "srg") - //} -} \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts index 9e578e6..b628b1e 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,31 +1,25 @@ @file:Suppress("PropertyName") +import groovy.lang.MissingPropertyException + pluginManagement { repositories { + maven("https://maven.deftu.dev/releases") + maven("https://maven.fabricmc.net") + maven("https://maven.architectury.dev/") + maven("https://maven.minecraftforge.net") + maven("https://repo.essential.gg/repository/maven-public") + maven("https://server.bbkr.space/artifactory/libs-release/") + maven("https://jitpack.io/") + + maven("https://maven.deftu.dev/snapshots") + mavenLocal() + gradlePluginPortal() mavenCentral() - maven("https://repo.polyfrost.org/releases") // Adds the Polyfrost maven repository to get Polyfrost Gradle Toolkit - } - plugins { - val pgtVersion = "0.6.5" // Sets the default versions for Polyfrost Gradle Toolkit - id("org.polyfrost.multi-version.root") version pgtVersion } } -val mod_name: String by settings - -// Configures the root project Gradle name based on the value in `gradle.properties` -rootProject.name = mod_name -rootProject.buildFileName = "root.gradle.kts" - -// Adds all of our build target versions to the classpath if we need to add version-specific code. -listOf( - "1.8.9-forge", // Update this if you want to remove/add a version, along with `build.gradle.kts` and `root.gradle.kts`. - //"1.12.2-forge" // uncomment if you want 1.12.2 support in your mod -).forEach { version -> - include(":$version") - project(":$version").apply { - projectDir = file("versions/$version") - buildFileName = "../../build.gradle.kts" - } -} +val projectName: String = extra["mod.name"]?.toString() ?: throw MissingPropertyException("mod.name has not been set.") +rootProject.name = projectName +rootProject.buildFileName = "build.gradle.kts" \ No newline at end of file diff --git a/src/main/java/me/waffles/additional/Additional.java b/src/main/java/me/waffles/additional/Additional.java index c344447..64355c8 100644 --- a/src/main/java/me/waffles/additional/Additional.java +++ b/src/main/java/me/waffles/additional/Additional.java @@ -19,9 +19,10 @@ @Mod(modid = Additional.MODID, name = Additional.NAME, version = Additional.VERSION) public class Additional { - public static final String MODID = "@ID@"; - public static final String NAME = "@NAME@"; - public static final String VERSION = "@VER@"; + public static final String MODID = "@MOD_ID@"; + public static final String NAME = "@MOD_NAME@"; + public static final String VERSION = "@MOD_VERSION@"; + public static ModConfig config; public static EldestRemovalMap duelsStatsList; public static EldestRemovalMap bedwarsStatsList; diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index c379eaa..d3c8586 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -1,18 +1,11 @@ [ { - "modid": "${id}", - "name": "${name}", - "description": "", - "version": "${version}", - "mcversion": "${mcVersionStr}", - "url": "", - "updateUrl": "", + "modid": "${mod_id}", + "name": "${mod_name}", + "version": "${mod_version}", + "mcversion": "${mc_version}", "authorList": [ "iAT3" - ], - "credits": "", - "logoFile": "", - "screenshots": [], - "dependencies": [] + ] } ] \ No newline at end of file diff --git a/src/main/resources/mixins.additional.json b/src/main/resources/mixins.additional.json index ab9c0b1..ce73b9f 100644 --- a/src/main/resources/mixins.additional.json +++ b/src/main/resources/mixins.additional.json @@ -2,7 +2,7 @@ "compatibilityLevel": "JAVA_8", "minVersion": "0.7", "package": "me.waffles.additional.mixin", - "refmap": "mixins.${id}.refmap.json", + "refmap": "mixins.${mod_id}.refmap.json", "injectors": { "maxShiftBy": 5 }, diff --git a/versions/mainProject b/versions/mainProject deleted file mode 100644 index dd1433e..0000000 --- a/versions/mainProject +++ /dev/null @@ -1 +0,0 @@ -1.8.9-forge \ No newline at end of file From 690d825990845ed31dce33125d5480cab859e9c4 Mon Sep 17 00:00:00 2001 From: Waffles3438 <96705793+Waffles3438@users.noreply.github.com> Date: Sat, 7 Mar 2026 13:38:53 -0500 Subject: [PATCH 5/6] fixed guild tags finally --- src/main/java/me/waffles/additional/util/HypixelAPIUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/me/waffles/additional/util/HypixelAPIUtils.java b/src/main/java/me/waffles/additional/util/HypixelAPIUtils.java index cbe9fc0..7622ca4 100644 --- a/src/main/java/me/waffles/additional/util/HypixelAPIUtils.java +++ b/src/main/java/me/waffles/additional/util/HypixelAPIUtils.java @@ -95,7 +95,7 @@ public static PlayerProfile parsePlayerProfilePlayerData(String json, String gui if(tag != null) { tag = tag.replaceAll("✧", "✧") - .replaceAll("Î", "Θ") + .replaceAll("Θ", "Θ") .replaceAll("✌", "✌") .replaceAll("â?¤", "❤") .replaceAll("✿", "✿") From 1ecf6347df8ded61e75500c6586039bc4c451b95 Mon Sep 17 00:00:00 2001 From: Waffles3438 <96705793+Waffles3438@users.noreply.github.com> Date: Sat, 7 Mar 2026 13:39:36 -0500 Subject: [PATCH 6/6] Update gradle.properties --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index ba0cadb..0826efc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ mod.name=Additional mod.id=additional -mod.version=3.0.3 +mod.version=3.0.4 minecraft.version=1.8.9 loom.platform=forge