First commit and add config options

This commit is contained in:
MrMelon54 committed 2023-06-14 00:49:07 +01:00
commit 63415c3e4b
45 files changed
+1533

No files matched your search

+91
View File
@@ -0,0 +1,91 @@
plugins {
id "com.github.johnrengelman.shadow" version "7.1.2"
}
architectury {
platformSetupLoomIde()
forge()
}
loom {
accessWidenerPath = project(":common").loom.accessWidenerPath
forge {
convertAccessWideners = true
extraAccessWideners.add loom.accessWidenerPath.get().asFile.name
mixinConfig "draggable-common.mixins.json"
mixinConfig "draggable.mixins.json"
}
}
configurations {
common
shadowCommon // Don't use shadow from the shadow plugin since it *excludes* files.
compileClasspath.extendsFrom common
runtimeClasspath.extendsFrom common
developmentForge.extendsFrom common
}
dependencies {
forge "net.minecraftforge:forge:${rootProject.forge_version}"
// Remove the next line if you don't want to depend on the API
modApi "dev.architectury:architectury-forge:${rootProject.architectury_version}"
modApi "me.shedaniel.cloth:cloth-config-forge:${rootProject.cloth_config_version}"
common(project(path: ":common", configuration: "namedElements")) { transitive false }
shadowCommon(project(path: ":common", configuration: "transformProductionForge")) { transitive = false }
}
processResources {
inputs.property "version", project.version
filesMatching("META-INF/mods.toml") {
expand "version": project.version
}
}
shadowJar {
exclude "fabric.mod.json"
exclude "architectury.common.json"
configurations = [project.configurations.shadowCommon]
classifier "dev-shadow"
}
remapJar {
input.set shadowJar.archiveFile
dependsOn shadowJar
classifier null
}
jar {
classifier "dev"
}
sourcesJar {
def commonSources = project(":common").sourcesJar
dependsOn commonSources
from commonSources.archiveFile.map { zipTree(it) }
}
components.java {
withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) {
skip()
}
}
publishing {
publications {
mavenForge(MavenPublication) {
artifactId = rootProject.archives_base_name + "-" + project.name
from components.java
}
}
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// Add repositories to publish to here.
}
}
+1
View File
@@ -0,0 +1 @@
loom.platform=forge
@@ -0,0 +1,20 @@
package com.mrmelon54.Draggable.forge;
import dev.architectury.platform.forge.EventBuses;
import com.mrmelon54.Draggable.Draggable;
import net.minecraftforge.client.ConfigScreenHandler;
import net.minecraftforge.client.ConfigScreenHandler.ConfigScreenFactory;
import net.minecraftforge.fml.ModLoadingContext;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
@Mod(Draggable.MOD_ID)
public class DraggableForge {
public DraggableForge() {
// Submit our event bus to let architectury register our content on the right time
EventBuses.registerModEventBus(Draggable.MOD_ID, FMLJavaModLoadingContext.get().getModEventBus());
ModLoadingContext.get().registerExtensionPoint(ConfigScreenFactory.class, () -> new ConfigScreenFactory((mc, screen) -> Draggable.createConfigScreen(screen).get()));
Draggable.init();
}
}
@@ -0,0 +1,15 @@
package com.mrmelon54.Draggable.forge;
import com.mrmelon54.Draggable.ExampleExpectPlatform;
import net.minecraftforge.fml.loading.FMLPaths;
import java.nio.file.Path;
public class ExampleExpectPlatformImpl {
/**
* This is our actual method to {@link ExampleExpectPlatform#getConfigDirectory()}.
*/
public static Path getConfigDirectory() {
return FMLPaths.CONFIGDIR.get();
}
}
@@ -0,0 +1,33 @@
modLoader = "javafml"
loaderVersion = "[46,)"
issueTrackerURL = "https://github.com/MrMelon54/draggable/issues"
license = "GPL-3.0-only"
[[mods]]
modId = "draggable"
version = "${version}"
displayName = "Draggable"
authors = "MrMelon54"
description = "Draggable resource packs, datapacks, servers and worlds"
logoFile = "/icon.png"
[[dependencies.draggable]]
modId = "forge"
mandatory = true
versionRange = "[46,)"
ordering = "NONE"
side = "BOTH"
[[dependencies.draggable]]
modId = "minecraft"
mandatory = true
versionRange = "[1.20,)"
ordering = "NONE"
side = "BOTH"
[[dependencies.draggable]]
modId = "architectury"
mandatory = true
versionRange = "[9.0.0,)"
ordering = "AFTER"
side = "BOTH"
@@ -0,0 +1,13 @@
{
"required": true,
"package": "com.mrmelon54.Draggable.mixin.forge",
"compatibilityLevel": "JAVA_17",
"minVersion": "0.8",
"client": [
],
"mixins": [
],
"injectors": {
"defaultRequire": 1
}
}
+6
View File
@@ -0,0 +1,6 @@
{
"pack": {
"description": "Draggable",
"pack_format": 15
}
}