mirror of
https://github.com/TeamMidnightDust/CullLeaves.git
synced 2025-12-16 14:15:10 +01:00
Port to Architectury
Still need to figure out how to register built-in resource packs on forge
This commit is contained in:
89
forge/build.gradle
Normal file
89
forge/build.gradle
Normal file
@@ -0,0 +1,89 @@
|
||||
plugins {
|
||||
id "com.github.johnrengelman.shadow" version "7.1.2"
|
||||
}
|
||||
|
||||
architectury {
|
||||
injectInjectables = false
|
||||
platformSetupLoomIde()
|
||||
forge()
|
||||
}
|
||||
|
||||
loom {
|
||||
forge {
|
||||
mixinConfig "cullleaves.mixins.json"
|
||||
}
|
||||
}
|
||||
repositories {
|
||||
maven { url "https://api.modrinth.com/maven" }
|
||||
}
|
||||
|
||||
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
|
||||
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}"
|
||||
modImplementation "maven.modrinth:midnightlib:${rootProject.midnightlib_version}-forge"
|
||||
include "maven.modrinth:midnightlib:${rootProject.midnightlib_version}-forge"
|
||||
|
||||
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
forge/gradle.properties
Normal file
1
forge/gradle.properties
Normal file
@@ -0,0 +1 @@
|
||||
loom.platform=forge
|
||||
@@ -0,0 +1,16 @@
|
||||
package eu.midnightdust.cullleaves.forge;
|
||||
|
||||
import eu.midnightdust.cullleaves.CullLeavesClient;
|
||||
import eu.midnightdust.lib.config.MidnightConfig;
|
||||
import net.minecraftforge.client.ConfigScreenHandler;
|
||||
import net.minecraftforge.fml.ModLoadingContext;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
|
||||
@Mod("cullleaves")
|
||||
public class CullLeavesClientForge {
|
||||
public CullLeavesClientForge() {
|
||||
CullLeavesClient.onInitializeClient();
|
||||
ModLoadingContext.get().registerExtensionPoint(ConfigScreenHandler.ConfigScreenFactory.class, () ->
|
||||
new ConfigScreenHandler.ConfigScreenFactory((client, parent) -> MidnightConfig.getScreen(parent, "cullleaves")));
|
||||
}
|
||||
}
|
||||
35
forge/src/main/resources/META-INF/mods.toml
Normal file
35
forge/src/main/resources/META-INF/mods.toml
Normal file
@@ -0,0 +1,35 @@
|
||||
modLoader = "javafml"
|
||||
loaderVersion = "[43,)"
|
||||
#issueTrackerURL = ""
|
||||
license = "MIT"
|
||||
|
||||
[[mods]]
|
||||
modId = "cullleaves"
|
||||
version = "${version}"
|
||||
displayName = "CullLeaves"
|
||||
authors = "Motschen, TeamMidnightDust"
|
||||
description = '''
|
||||
Adds culling to leaf blocks, providing a huge performance boost over vanilla.
|
||||
'''
|
||||
logoFile = "icon.png"
|
||||
|
||||
[[dependencies.cullleaves]]
|
||||
modId = "forge"
|
||||
mandatory = true
|
||||
versionRange = "[43,)"
|
||||
ordering = "NONE"
|
||||
side = "CLIENT"
|
||||
|
||||
[[dependencies.cullleaves]]
|
||||
modId = "minecraft"
|
||||
mandatory = true
|
||||
versionRange = "[1.19.2,)"
|
||||
ordering = "NONE"
|
||||
side = "CLIENT"
|
||||
|
||||
[[dependencies.cullleaves]]
|
||||
modId = "midnightlib"
|
||||
mandatory = true
|
||||
versionRange = "[1.0.0,)"
|
||||
ordering = "NONE"
|
||||
side = "CLIENT"
|
||||
BIN
forge/src/main/resources/icon.png
Executable file
BIN
forge/src/main/resources/icon.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
6
forge/src/main/resources/pack.mcmeta
Normal file
6
forge/src/main/resources/pack.mcmeta
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"pack": {
|
||||
"description": "CullLeaves",
|
||||
"pack_format": 9
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user