Skip to content

Commit

Permalink
...huh
Browse files Browse the repository at this point in the history
  • Loading branch information
pupbrained committed Dec 29, 2023
1 parent d3e40f1 commit ab62662
Show file tree
Hide file tree
Showing 15 changed files with 148 additions and 77 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ subprojects {

dependencies {
minecraft "com.mojang:minecraft:${rootProject.minecraft_version}"
mappings loom.layered() {
it.mappings("net.fabricmc:yarn:${project.yarn_mappings}:v2")
it.mappings file("mappings/yarnpatch.tiny")
mappings loom.layered {
it.mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
it.mappings "dev.architectury:yarn-mappings-patch-forge:${project.yarn_mappings_patch}"
}
}
}
Expand Down
18 changes: 2 additions & 16 deletions common/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
architectury {
common("fabric", "neoforge")
common("fabric", "neoforge", "forge")
}

loom {
Expand All @@ -14,18 +14,4 @@ dependencies {
modApi "dev.architectury:architectury:${rootProject.architectury_version}"

modCompileOnlyApi("dev.tcl:the-config-lib-common:$rootProject.tcl_version")
}

publishing {
publications {
mavenCommon(MavenPublication) {
artifactId = rootProject.archives_base_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.
}
}
}
16 changes: 1 addition & 15 deletions fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,4 @@ components.java {
withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) {
skip()
}
}

publishing {
publications {
mavenFabric(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.
}
}
}
13 changes: 0 additions & 13 deletions fabric/src/main/resources/drop_confirm.mixins.json

This file was deleted.

1 change: 0 additions & 1 deletion fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
]
},
"mixins": [
"drop_confirm.mixins.json",
"drop_confirm-common.mixins.json"
],
"depends": {
Expand Down
68 changes: 68 additions & 0 deletions forge/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
plugins {
id "com.github.johnrengelman.shadow" version "7.1.2"
}

architectury {
platformSetupLoomIde()
forge()
}

loom {
accessWidenerPath = project(":common").loom.accessWidenerPath

forge {
mixinConfig "drop_confirm-common.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}"

common(project(path: ":common", configuration: "namedElements")) { transitive false }
shadowCommon(project(path: ":common", configuration: "transformProductionForge")) { transitive = false }

modImplementation("dev.tcl:the-config-lib-forge:$rootProject.tcl_version")
}

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]
archiveClassifier = "dev-shadow"
}

remapJar {
input.set shadowJar.archiveFile
dependsOn shadowJar
}

sourcesJar {
def commonSources = project(":common").sourcesJar
dependsOn commonSources
from commonSources.archiveFile.map { zipTree(it) }
}

components.java {
withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) {
skip()
}
}
1 change: 1 addition & 0 deletions forge/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
loom.platform=forge
16 changes: 16 additions & 0 deletions forge/src/main/java/xyz/pupbrained/forge/DropConfirmForge.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package xyz.pupbrained.forge;

import net.minecraftforge.client.ConfigScreenHandler;
import net.minecraftforge.fml.ModLoadingContext;
import net.minecraftforge.fml.common.Mod;
import xyz.pupbrained.DropConfirm;
import xyz.pupbrained.config.DropConfirmConfig;

@Mod(DropConfirm.MOD_ID)
public class DropConfirmForge {
public DropConfirmForge() {
ModLoadingContext.get().registerExtensionPoint(ConfigScreenHandler.ConfigScreenFactory.class, () ->
new ConfigScreenHandler.ConfigScreenFactory((client, parent) -> DropConfirmConfig.createScreen(parent)));
DropConfirm.init();
}
}
45 changes: 45 additions & 0 deletions forge/src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
modLoader = "javafml"
loaderVersion = "[49,)"
#issueTrackerURL = ""
license = "Unlicense"

[[mods]]
modId = "drop_confirm"
version = "${version}"
displayName = "DropConfirm"
authors = "pupbrained"
description = '''
Think twice before you drop.
'''
logoFile = "icon.png"

[[dependencies.drop_confirm]]
modId = "forge"
mandatory = true
versionRange = "[49,)"
ordering = "NONE"
side = "BOTH"

[[dependencies.drop_confirm]]
modId = "minecraft"
mandatory = true
versionRange = "[1.20.4,)"
ordering = "NONE"
side = "BOTH"

[[dependencies.drop_confirm]]
modId = "architectury"
mandatory = true
versionRange = "[11.0.9,)"
ordering = "NONE"
side = "BOTH"

[[dependencies.drop_confirm]]
modId = "the_config_lib"
mandatory = true
versionRange = "[4.0.0-SNAPSHOT,)"
ordering = "NONE"
side = "BOTH"

[[mixins]]
config = "drop_confirm-common.mixins.json"
Binary file added forge/src/main/resources/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions forge/src/main/resources/pack.mcmeta
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"pack": {
"description": "DropConfirm",
"pack_format": 15
}
}
4 changes: 3 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
org.gradle.jvmargs=-Xmx2048M
minecraft_version=1.20.4
enabled_platforms=fabric,neoforge
enabled_platforms=fabric,neoforge,forge
archives_base_name=drop_confirm
mod_version=2.0.0
maven_group=xyz.pupbrained
architectury_version=11.0.9
fabric_loader_version=0.15.3
fabric_api_version=0.91.3+1.20.4
neoforge_version=20.4.55-beta
forge_version=1.20.4-49.0.3
yarn_mappings=1.20.4+build.3
yarn_mappings_patch=1.20.4+build.1
tcl_version=4.0.0-SNAPSHOT
16 changes: 1 addition & 15 deletions neoforge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,4 @@ components.java {
withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) {
skip()
}
}

publishing {
publications {
mavenNeoForge(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.
}
}
}
13 changes: 0 additions & 13 deletions neoforge/src/main/resources/drop_confirm.mixins.json

This file was deleted.

2 changes: 2 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ pluginManagement {
maven { url "https://maven.fabricmc.net/" }
maven { url "https://maven.architectury.dev/" }
maven { url "https://maven.neoforged.net/releases" }
maven { url "https://maven.minecraftforge.net/" }
gradlePluginPortal()
}
}

include("common")
include("fabric")
include("neoforge")
include("forge")

rootProject.name = "drop-confirm"

0 comments on commit ab62662

Please sign in to comment.