-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
275 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
plugins { | ||
id "com.github.johnrengelman.shadow" version "7.0.0" | ||
id "me.shedaniel.unified-publishing" | ||
id "maven-publish" | ||
} | ||
|
||
configurations { | ||
shadowCommon | ||
dev | ||
} | ||
|
||
artifacts { | ||
dev(jar) | ||
} | ||
|
||
architectury { | ||
platformSetupLoomIde() | ||
neoForge() | ||
} | ||
|
||
configurations { | ||
common | ||
shadowCommon // Don't use shadow from the shadow plugin because we don't want IDEA to index this. | ||
compileClasspath.extendsFrom common | ||
runtimeClasspath.extendsFrom common | ||
developmentNeoForge.extendsFrom common | ||
} | ||
|
||
dependencies { | ||
minecraft "com.mojang:minecraft:${rootProject.architectury.minecraft}" | ||
mappings loom.officialMojangMappings() | ||
|
||
neoForge "net.neoforged:neoforge:${rootProject.neoforge_version}" | ||
|
||
modLocalRuntime("me.shedaniel.cloth:basic-math:0.6.1") | ||
forgeRuntimeLibrary(shadowCommon("me.shedaniel.cloth:basic-math:0.6.1")) | ||
|
||
implementation("blue.endless:jankson:${rootProject.jankson_version}") | ||
implementation("com.moandjiezana.toml:toml4j:${rootProject.toml4j_version}") | ||
implementation("org.yaml:snakeyaml:${rootProject.snakeyaml_version}") | ||
forgeRuntimeLibrary(shadowCommon("blue.endless:jankson:${rootProject.jankson_version}")) | ||
forgeRuntimeLibrary(shadowCommon("com.moandjiezana.toml:toml4j:${rootProject.toml4j_version}") { | ||
exclude(module: "gson") | ||
}) | ||
forgeRuntimeLibrary(shadowCommon("org.yaml:snakeyaml:${rootProject.snakeyaml_version}")) | ||
|
||
common(project(path: ":common", configuration: "namedElements")) { transitive false } | ||
shadowCommon(project(path: ":common", configuration: "transformProductionNeoForge")) { transitive false } | ||
} | ||
|
||
processResources { | ||
filesMatching("META-INF/mods.toml") { | ||
expand "version": project.version | ||
} | ||
inputs.property "META-INF/mods.toml", project.version | ||
} | ||
|
||
shadowJar { | ||
exclude "fabric.mod.json" | ||
exclude "cloth-config.accessWidener" | ||
relocate "blue.endless.jankson", "${rootProject.maven_group}.clothconfig.shadowed.blue.endless.jankson" | ||
relocate "com.moandjiezana.toml", "${rootProject.maven_group}.clothconfig.shadowed.com.moandjiezana.toml" | ||
relocate "org.yaml.snakeyaml", "${rootProject.maven_group}.clothconfig.shadowed.org.yaml.snakeyaml" | ||
|
||
configurations = [project.configurations.shadowCommon] | ||
archiveClassifier = "shadow" | ||
} | ||
|
||
remapJar { | ||
input.set(shadowJar.archiveFile) | ||
dependsOn(shadowJar) | ||
archiveClassifier = "neoforge" | ||
|
||
from rootProject.file("LICENSE.md") | ||
} | ||
|
||
publishing { | ||
publications { | ||
mavenNeoForge(MavenPublication) { | ||
artifactId = rootProject.archives_base_name + "-neoforge" | ||
from components.java | ||
} | ||
} | ||
|
||
repositories { | ||
if (System.getenv("MAVEN_PASS") != null) { | ||
maven { | ||
url = "https://deploy.shedaniel.me/" | ||
credentials { | ||
username = "shedaniel" | ||
password = System.getenv("MAVEN_PASS") | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
unifiedPublishing { | ||
project { | ||
displayName = "[NeoForge $rootProject.supported_version] v$project.version" | ||
releaseType = "release" | ||
gameVersions = ["1.20.2"] | ||
gameLoaders = ["neoforge"] | ||
|
||
mainPublication remapJar | ||
|
||
if (project.hasProperty("curse_api_key") || System.getenv("curse_api_key") != null) { | ||
curseforge { | ||
token = project.hasProperty("curse_api_key") ? project.property("curse_api_key") : System.getenv("curse_api_key") | ||
id = project.curseforge_id | ||
gameVersions.addAll "Java 17" | ||
} | ||
} | ||
|
||
if (project.hasProperty("modrinth_key") || System.getenv("modrinth_key") != null) { | ||
modrinth { | ||
token = project.hasProperty("modrinth_key") ? project.property("modrinth_key") : System.getenv("modrinth_key") | ||
id = project.modrinth_id | ||
version = "$project.version+$project.name" | ||
} | ||
} | ||
} | ||
} | ||
|
||
rootProject.tasks.getByName("modPublish").dependsOn tasks.getByName("publishUnified") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
loom.platform=neoforge |
30 changes: 30 additions & 0 deletions
30
neoforge/src/main/java/me/shedaniel/autoconfig/util/forge/UtilsImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* This file is part of Cloth Config. | ||
* Copyright (C) 2020 - 2021 shedaniel | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 3 of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
*/ | ||
|
||
package me.shedaniel.autoconfig.util.forge; | ||
|
||
import net.neoforged.fml.loading.FMLPaths; | ||
|
||
import java.nio.file.Path; | ||
|
||
public class UtilsImpl { | ||
public static Path getConfigFolder() { | ||
return FMLPaths.CONFIGDIR.get(); | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
neoforge/src/main/java/me/shedaniel/clothconfig/ClothConfigForge.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* This file is part of Cloth Config. | ||
* Copyright (C) 2020 - 2021 shedaniel | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 3 of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
*/ | ||
|
||
package me.shedaniel.clothconfig; | ||
|
||
import me.shedaniel.clothconfig2.ClothConfigInitializer; | ||
import net.neoforged.api.distmarker.Dist; | ||
import net.neoforged.fml.DistExecutor; | ||
import net.neoforged.fml.IExtensionPoint; | ||
import net.neoforged.fml.ModLoadingContext; | ||
import net.neoforged.fml.common.Mod; | ||
|
||
@Mod(ClothConfigInitializer.MOD_ID) | ||
public class ClothConfigForge { | ||
public ClothConfigForge() { | ||
ModLoadingContext.get().registerExtensionPoint(IExtensionPoint.DisplayTest.class, () -> new IExtensionPoint.DisplayTest(() -> IExtensionPoint.DisplayTest.IGNORESERVERONLY, (a, b) -> true)); | ||
DistExecutor.safeRunWhenOn(Dist.CLIENT, () -> ClothConfigForgeDemo::registerModsPage); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
neoforge/src/main/java/me/shedaniel/clothconfig/ClothConfigForgeDemo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* This file is part of Cloth Config. | ||
* Copyright (C) 2020 - 2021 shedaniel | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 3 of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
*/ | ||
|
||
package me.shedaniel.clothconfig; | ||
|
||
import me.shedaniel.clothconfig2.ClothConfigDemo; | ||
import net.neoforged.fml.ModLoadingContext; | ||
import net.neoforged.neoforge.client.ConfigScreenHandler; | ||
|
||
public class ClothConfigForgeDemo { | ||
public static void registerModsPage() { | ||
ModLoadingContext.get().registerExtensionPoint(ConfigScreenHandler.ConfigScreenFactory.class, () -> new ConfigScreenHandler.ConfigScreenFactory((client, parent) -> { | ||
return ClothConfigDemo.getConfigBuilderWithDemo().setParentScreen(parent).build(); | ||
})); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Font.renderText | ||
public net.minecraft.client.gui.Font renderText(Ljava/lang/String;FFIZLorg/joml/Matrix4f;Lnet/minecraft/client/renderer/MultiBufferSource;Lnet/minecraft/client/gui/Font$DisplayMode;II)F # renderText | ||
# Button.onPress | ||
public-f net.minecraft.client.gui.components.Button onPress # onPress | ||
# KeyMapping.key | ||
public net.minecraft.client.KeyMapping key # key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
modLoader = "javafml" | ||
loaderVersion = "[1,)" | ||
issueTrackerURL = "https://github.com/architectury/ClothConfig/issues/" | ||
displayURL = "https://www.curseforge.com/minecraft/mc-mods/cloth-config-forge/" | ||
logoFile = "icon.png" | ||
authors = "shedaniel" | ||
license = "GNU LGPLv3" | ||
|
||
[[mods]] | ||
modId = "cloth_config" | ||
version = "${version}" | ||
displayName = "Cloth Config v12 API" | ||
description = ''' | ||
An API for config screens. | ||
''' | ||
|
||
[[dependencies.cloth_config]] | ||
modId = "neoforge" | ||
mandatory = true | ||
versionRange = "[20.2,)" | ||
ordering = "NONE" | ||
side = "BOTH" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"pack": { | ||
"description": "Mod resources", | ||
"pack_format": 4 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters