mirror of
https://github.com/TeamMidnightDust/CullLeaves.git
synced 2025-12-15 14:15:08 +01:00
Port to Architectury
Still need to figure out how to register built-in resource packs on forge
This commit is contained in:
32
.gitignore
vendored
Executable file → Normal file
32
.gitignore
vendored
Executable file → Normal file
@@ -1,25 +1,19 @@
|
|||||||
# gradle
|
|
||||||
|
|
||||||
.gradle/
|
|
||||||
out/
|
|
||||||
classes/
|
|
||||||
build/
|
build/
|
||||||
|
|
||||||
# idea
|
|
||||||
|
|
||||||
.idea/
|
|
||||||
*.iml
|
|
||||||
*.ipr
|
*.ipr
|
||||||
|
run/
|
||||||
*.iws
|
*.iws
|
||||||
|
out/
|
||||||
# vscode
|
*.iml
|
||||||
|
.gradle/
|
||||||
.settings/
|
output/
|
||||||
.vscode/
|
|
||||||
bin/
|
bin/
|
||||||
|
libs/
|
||||||
|
|
||||||
.classpath
|
.classpath
|
||||||
.project
|
.project
|
||||||
|
.idea/
|
||||||
# fabric
|
classes/
|
||||||
|
.metadata
|
||||||
run/
|
.vscode
|
||||||
|
.settings
|
||||||
|
*.launch
|
||||||
116
build.gradle
Executable file → Normal file
116
build.gradle
Executable file → Normal file
@@ -1,84 +1,58 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id 'fabric-loom' version '0.12-SNAPSHOT'
|
id "architectury-plugin" version "3.4-SNAPSHOT"
|
||||||
id 'maven-publish'
|
id "dev.architectury.loom" version "1.0-SNAPSHOT" apply false
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceCompatibility = JavaVersion.VERSION_17
|
architectury {
|
||||||
targetCompatibility = JavaVersion.VERSION_17
|
injectInjectables = false
|
||||||
|
minecraft = rootProject.minecraft_version
|
||||||
archivesBaseName = project.archives_base_name
|
}
|
||||||
version = project.mod_version
|
|
||||||
group = project.maven_group
|
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
maven {
|
maven {
|
||||||
url = "https://api.modrinth.com/maven"
|
url = "https://api.modrinth.com/maven"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
subprojects {
|
||||||
//to change the versions see the gradle.properties file
|
apply plugin: "dev.architectury.loom"
|
||||||
minecraft "com.mojang:minecraft:${project.minecraft_version}"
|
|
||||||
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
|
|
||||||
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
|
|
||||||
|
|
||||||
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
|
loom {
|
||||||
|
silentMojangMappingsLicense()
|
||||||
|
}
|
||||||
|
|
||||||
modImplementation "maven.modrinth:midnightlib:${project.midnightlib_version}"
|
dependencies {
|
||||||
include "maven.modrinth:midnightlib:${project.midnightlib_version}"
|
minecraft "com.mojang:minecraft:${rootProject.minecraft_version}"
|
||||||
|
// The following line declares the mojmap mappings, you may use other mappings as well
|
||||||
|
//mappings loom.officialMojangMappings()
|
||||||
|
// The following line declares the yarn mappings you may select this one as well.
|
||||||
|
mappings "net.fabricmc:yarn:1.19.2+build.3:v2"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
processResources {
|
allprojects {
|
||||||
inputs.property "version", project.version
|
apply plugin: "java"
|
||||||
|
apply plugin: "architectury-plugin"
|
||||||
|
apply plugin: "maven-publish"
|
||||||
|
|
||||||
filesMatching("fabric.mod.json") {
|
archivesBaseName = rootProject.archives_base_name
|
||||||
expand "version": project.version
|
version = rootProject.mod_version
|
||||||
}
|
group = rootProject.maven_group
|
||||||
}
|
|
||||||
|
repositories {
|
||||||
tasks.withType(JavaCompile).configureEach {
|
// Add repositories to retrieve artifacts from in here.
|
||||||
// ensure that the encoding is set to UTF-8, no matter what the system default is
|
// You should only use this when depending on other mods because
|
||||||
// this fixes some edge cases with special characters not displaying correctly
|
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
|
||||||
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
|
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
|
||||||
// If Javadoc is generated, this must be specified in that task too.
|
// for more information about repositories.
|
||||||
it.options.encoding = "UTF-8"
|
}
|
||||||
|
|
||||||
// Minecraft 1.17 (21w19a) upwards uses Java 16.
|
tasks.withType(JavaCompile) {
|
||||||
it.options.release = 17
|
options.encoding = "UTF-8"
|
||||||
}
|
options.release = 17
|
||||||
|
}
|
||||||
java {
|
|
||||||
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
|
java {
|
||||||
// if it is present.
|
withSourcesJar()
|
||||||
// If you remove this line, sources will not be generated.
|
}
|
||||||
withSourcesJar()
|
|
||||||
}
|
|
||||||
|
|
||||||
jar {
|
|
||||||
from("LICENSE") {
|
|
||||||
rename { "${it}_${project.archivesBaseName}"}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// configure the maven publication
|
|
||||||
publishing {
|
|
||||||
publications {
|
|
||||||
mavenJava(MavenPublication) {
|
|
||||||
// add all the jars that should be included when publishing to maven
|
|
||||||
artifact(remapJar) {
|
|
||||||
builtBy remapJar
|
|
||||||
}
|
|
||||||
artifact(sourcesJar) {
|
|
||||||
builtBy remapSourcesJar
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 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.
|
|
||||||
// Notice: This block does NOT have the same function as the block in the top level.
|
|
||||||
// The repositories here will be used for publishing your artifact, not for
|
|
||||||
// retrieving dependencies.
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
34
common/build.gradle
Normal file
34
common/build.gradle
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
architectury {
|
||||||
|
injectInjectables = false
|
||||||
|
common(rootProject.enabled_platforms.split(","))
|
||||||
|
}
|
||||||
|
|
||||||
|
loom {
|
||||||
|
}
|
||||||
|
repositories {
|
||||||
|
maven { url "https://api.modrinth.com/maven" }
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
// We depend on fabric loader here to use the fabric @Environment annotations and get the mixin dependencies
|
||||||
|
// Do NOT use other classes from fabric loader
|
||||||
|
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
|
||||||
|
modCompileOnlyApi "maven.modrinth:midnightlib:${rootProject.midnightlib_version}-fabric"
|
||||||
|
|
||||||
|
// Remove the next line if you don't want to depend on the API
|
||||||
|
modApi "dev.architectury:architectury:${rootProject.architectury_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.
|
||||||
|
}
|
||||||
|
}
|
||||||
10
common/src/main/java/eu/midnightdust/cullleaves/CullLeavesClient.java
Executable file
10
common/src/main/java/eu/midnightdust/cullleaves/CullLeavesClient.java
Executable file
@@ -0,0 +1,10 @@
|
|||||||
|
package eu.midnightdust.cullleaves;
|
||||||
|
|
||||||
|
import eu.midnightdust.cullleaves.config.CullLeavesConfig;
|
||||||
|
|
||||||
|
public class CullLeavesClient {
|
||||||
|
|
||||||
|
public static void onInitializeClient() {
|
||||||
|
CullLeavesConfig.init("cullleaves", CullLeavesConfig.class);
|
||||||
|
}
|
||||||
|
}
|
||||||
2
common/src/main/resources/architectury.common.json
Normal file
2
common/src/main/resources/architectury.common.json
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
{
|
||||||
|
}
|
||||||
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
22
src/main/resources/cullleaves.mixins.json → common/src/main/resources/cullleaves.mixins.json
Executable file → Normal file
22
src/main/resources/cullleaves.mixins.json → common/src/main/resources/cullleaves.mixins.json
Executable file → Normal file
@@ -1,11 +1,13 @@
|
|||||||
{
|
{
|
||||||
"required": true,
|
"required": true,
|
||||||
"package": "eu.midnightdust.cullleaves.mixin",
|
"package": "eu.midnightdust.cullleaves.mixin",
|
||||||
"compatibilityLevel": "JAVA_8",
|
"compatibilityLevel": "JAVA_17",
|
||||||
"client": [
|
"client": [
|
||||||
"MixinLeavesBlock"
|
"MixinLeavesBlock"
|
||||||
],
|
],
|
||||||
"injectors": {
|
"mixins": [
|
||||||
"defaultRequire": 1
|
],
|
||||||
}
|
"injectors": {
|
||||||
|
"defaultRequire": 1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 8.3 KiB |
16
fabric-like/build.gradle
Normal file
16
fabric-like/build.gradle
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
architectury {
|
||||||
|
injectInjectables = false
|
||||||
|
common(rootProject.enabled_platforms.split(","))
|
||||||
|
}
|
||||||
|
|
||||||
|
loom {
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
|
||||||
|
modApi "net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_api_version}"
|
||||||
|
// Remove the next line if you don't want to depend on the API
|
||||||
|
modApi "dev.architectury:architectury-fabric:${rootProject.architectury_version}"
|
||||||
|
|
||||||
|
compileClasspath(project(path: ":common", configuration: "namedElements")) { transitive false }
|
||||||
|
}
|
||||||
88
fabric/build.gradle
Normal file
88
fabric/build.gradle
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
plugins {
|
||||||
|
id "com.github.johnrengelman.shadow" version "7.1.2"
|
||||||
|
}
|
||||||
|
|
||||||
|
architectury {
|
||||||
|
injectInjectables = false
|
||||||
|
platformSetupLoomIde()
|
||||||
|
fabric()
|
||||||
|
}
|
||||||
|
|
||||||
|
loom {
|
||||||
|
}
|
||||||
|
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
|
||||||
|
developmentFabric.extendsFrom common
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
|
||||||
|
modApi "net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_api_version}"
|
||||||
|
// Remove the next line if you don't want to depend on the API
|
||||||
|
//modApi "dev.architectury:architectury-fabric:${rootProject.architectury_version}"
|
||||||
|
modImplementation "maven.modrinth:midnightlib:${rootProject.midnightlib_version}-fabric"
|
||||||
|
include "maven.modrinth:midnightlib:${rootProject.midnightlib_version}-fabric"
|
||||||
|
|
||||||
|
common(project(path: ":common", configuration: "namedElements")) { transitive false }
|
||||||
|
shadowCommon(project(path: ":common", configuration: "transformProductionFabric")) { transitive false }
|
||||||
|
common(project(path: ":fabric-like", configuration: "namedElements")) { transitive false }
|
||||||
|
shadowCommon(project(path: ":fabric-like", configuration: "transformProductionFabric")) { transitive false }
|
||||||
|
}
|
||||||
|
|
||||||
|
processResources {
|
||||||
|
inputs.property "version", project.version
|
||||||
|
|
||||||
|
filesMatching("fabric.mod.json") {
|
||||||
|
expand "version": project.version
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
shadowJar {
|
||||||
|
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 {
|
||||||
|
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.
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,20 +1,18 @@
|
|||||||
package eu.midnightdust.cullleaves;
|
package eu.midnightdust.cullleaves.fabric;
|
||||||
|
|
||||||
import eu.midnightdust.cullleaves.config.CullLeavesConfig;
|
import eu.midnightdust.cullleaves.CullLeavesClient;
|
||||||
import net.fabricmc.api.ClientModInitializer;
|
import net.fabricmc.api.ClientModInitializer;
|
||||||
import net.fabricmc.fabric.api.resource.ResourceManagerHelper;
|
import net.fabricmc.fabric.api.resource.ResourceManagerHelper;
|
||||||
import net.fabricmc.fabric.api.resource.ResourcePackActivationType;
|
import net.fabricmc.fabric.api.resource.ResourcePackActivationType;
|
||||||
import net.fabricmc.loader.ModContainer;
|
import net.fabricmc.loader.api.FabricLoader;
|
||||||
import net.fabricmc.loader.api.FabricLoader;
|
import net.minecraft.util.Identifier;
|
||||||
import net.minecraft.util.Identifier;
|
|
||||||
|
public class CullLeavesClientFabric implements ClientModInitializer {
|
||||||
public class CullLeavesClient implements ClientModInitializer {
|
@Override
|
||||||
|
public void onInitializeClient() {
|
||||||
public void onInitializeClient() {
|
CullLeavesClient.onInitializeClient();
|
||||||
CullLeavesConfig.init("cullleaves", CullLeavesConfig.class);
|
FabricLoader.getInstance().getModContainer("cullleaves").ifPresent(modContainer -> {
|
||||||
|
ResourceManagerHelper.registerBuiltinResourcePack(new Identifier("cullleaves:smartleaves"), modContainer, ResourcePackActivationType.NORMAL);
|
||||||
FabricLoader.getInstance().getModContainer("cullleaves").ifPresent(modContainer -> {
|
});
|
||||||
ResourceManagerHelper.registerBuiltinResourcePack(new Identifier("cullleaves:smartleaves"), modContainer, ResourcePackActivationType.NORMAL);
|
}
|
||||||
});
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
4
src/main/resources/fabric.mod.json → fabric/src/main/resources/fabric.mod.json
Executable file → Normal file
4
src/main/resources/fabric.mod.json → fabric/src/main/resources/fabric.mod.json
Executable file → Normal file
@@ -21,7 +21,7 @@
|
|||||||
"environment": "client",
|
"environment": "client",
|
||||||
"entrypoints": {
|
"entrypoints": {
|
||||||
"client": [
|
"client": [
|
||||||
"eu.midnightdust.cullleaves.CullLeavesClient"
|
"eu.midnightdust.cullleaves.fabric.CullLeavesClientFabric"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -33,4 +33,4 @@
|
|||||||
"mixins": [
|
"mixins": [
|
||||||
"cullleaves.mixins.json"
|
"cullleaves.mixins.json"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
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
|
||||||
|
}
|
||||||
|
}
|
||||||
31
gradle.properties
Executable file → Normal file
31
gradle.properties
Executable file → Normal file
@@ -1,18 +1,19 @@
|
|||||||
# Done to increase the memory available to gradle.
|
org.gradle.jvmargs=-Xmx4096M
|
||||||
org.gradle.jvmargs=-Xmx1G
|
|
||||||
|
|
||||||
# Fabric Properties
|
minecraft_version=1.19.2
|
||||||
# check these on https://fabricmc.net/use
|
enabled_platforms=quilt,fabric,forge
|
||||||
minecraft_version=1.19-rc2
|
|
||||||
yarn_mappings=1.19-rc2+build.1
|
|
||||||
loader_version=0.14.6
|
|
||||||
|
|
||||||
# Mod Properties
|
archives_base_name=cullleaves
|
||||||
mod_version = 2.3.4
|
mod_version=3.0.0
|
||||||
maven_group = eu.midnightdust
|
maven_group=eu.midnightdust
|
||||||
archives_base_name = cullleaves
|
|
||||||
|
|
||||||
# Dependencies
|
architectury_version=6.2.43
|
||||||
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
|
midnightlib_version=1.0.0
|
||||||
fabric_version=0.55.1+1.19
|
|
||||||
midnightlib_version=0.5.2
|
fabric_loader_version=0.14.9
|
||||||
|
fabric_api_version=0.59.0+1.19.2
|
||||||
|
|
||||||
|
forge_version=1.19.2-43.0.8
|
||||||
|
|
||||||
|
quilt_loader_version=0.17.2-beta.3
|
||||||
|
quilt_fabric_api_version=4.0.0-beta.7+0.59.0-1.19.2
|
||||||
|
|||||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,5 +1,5 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|||||||
6
gradlew
vendored
6
gradlew
vendored
@@ -205,6 +205,12 @@ set -- \
|
|||||||
org.gradle.wrapper.GradleWrapperMain \
|
org.gradle.wrapper.GradleWrapperMain \
|
||||||
"$@"
|
"$@"
|
||||||
|
|
||||||
|
# Stop when "xargs" is not available.
|
||||||
|
if ! command -v xargs >/dev/null 2>&1
|
||||||
|
then
|
||||||
|
die "xargs is not available"
|
||||||
|
fi
|
||||||
|
|
||||||
# Use "xargs" to parse quoted args.
|
# Use "xargs" to parse quoted args.
|
||||||
#
|
#
|
||||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||||
|
|||||||
180
gradlew.bat
vendored
180
gradlew.bat
vendored
@@ -1,89 +1,91 @@
|
|||||||
@rem
|
@rem
|
||||||
@rem Copyright 2015 the original author or authors.
|
@rem Copyright 2015 the original author or authors.
|
||||||
@rem
|
@rem
|
||||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@rem you may not use this file except in compliance with the License.
|
@rem you may not use this file except in compliance with the License.
|
||||||
@rem You may obtain a copy of the License at
|
@rem You may obtain a copy of the License at
|
||||||
@rem
|
@rem
|
||||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||||
@rem
|
@rem
|
||||||
@rem Unless required by applicable law or agreed to in writing, software
|
@rem Unless required by applicable law or agreed to in writing, software
|
||||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
@rem See the License for the specific language governing permissions and
|
@rem See the License for the specific language governing permissions and
|
||||||
@rem limitations under the License.
|
@rem limitations under the License.
|
||||||
@rem
|
@rem
|
||||||
|
|
||||||
@if "%DEBUG%" == "" @echo off
|
@if "%DEBUG%"=="" @echo off
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
@rem
|
@rem
|
||||||
@rem Gradle startup script for Windows
|
@rem Gradle startup script for Windows
|
||||||
@rem
|
@rem
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
|
|
||||||
@rem Set local scope for the variables with windows NT shell
|
@rem Set local scope for the variables with windows NT shell
|
||||||
if "%OS%"=="Windows_NT" setlocal
|
if "%OS%"=="Windows_NT" setlocal
|
||||||
|
|
||||||
set DIRNAME=%~dp0
|
set DIRNAME=%~dp0
|
||||||
if "%DIRNAME%" == "" set DIRNAME=.
|
if "%DIRNAME%"=="" set DIRNAME=.
|
||||||
set APP_BASE_NAME=%~n0
|
set APP_BASE_NAME=%~n0
|
||||||
set APP_HOME=%DIRNAME%
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||||
|
|
||||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||||
|
|
||||||
@rem Find java.exe
|
@rem Find java.exe
|
||||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||||
|
|
||||||
set JAVA_EXE=java.exe
|
set JAVA_EXE=java.exe
|
||||||
%JAVA_EXE% -version >NUL 2>&1
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
if "%ERRORLEVEL%" == "0" goto execute
|
if %ERRORLEVEL% equ 0 goto execute
|
||||||
|
|
||||||
echo.
|
echo.
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
echo.
|
echo.
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
echo location of your Java installation.
|
echo location of your Java installation.
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
:findJavaFromJavaHome
|
:findJavaFromJavaHome
|
||||||
set JAVA_HOME=%JAVA_HOME:"=%
|
set JAVA_HOME=%JAVA_HOME:"=%
|
||||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||||
|
|
||||||
if exist "%JAVA_EXE%" goto execute
|
if exist "%JAVA_EXE%" goto execute
|
||||||
|
|
||||||
echo.
|
echo.
|
||||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||||
echo.
|
echo.
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
echo location of your Java installation.
|
echo location of your Java installation.
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
:execute
|
:execute
|
||||||
@rem Setup the command line
|
@rem Setup the command line
|
||||||
|
|
||||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||||
|
|
||||||
|
|
||||||
@rem Execute Gradle
|
@rem Execute Gradle
|
||||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||||
|
|
||||||
:end
|
:end
|
||||||
@rem End local scope for the variables with windows NT shell
|
@rem End local scope for the variables with windows NT shell
|
||||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||||
|
|
||||||
:fail
|
:fail
|
||||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||||
rem the _cmd.exe /c_ return code!
|
rem the _cmd.exe /c_ return code!
|
||||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
set EXIT_CODE=%ERRORLEVEL%
|
||||||
exit /b 1
|
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||||
|
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||||
:mainEnd
|
exit /b %EXIT_CODE%
|
||||||
if "%OS%"=="Windows_NT" endlocal
|
|
||||||
|
:mainEnd
|
||||||
:omega
|
if "%OS%"=="Windows_NT" endlocal
|
||||||
|
|
||||||
|
:omega
|
||||||
|
|||||||
96
quilt/build.gradle
Normal file
96
quilt/build.gradle
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
plugins {
|
||||||
|
id "com.github.johnrengelman.shadow" version "7.1.2"
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
maven { url "https://maven.quiltmc.org/repository/release/" }
|
||||||
|
maven { url "https://api.modrinth.com/maven" }
|
||||||
|
}
|
||||||
|
|
||||||
|
architectury {
|
||||||
|
injectInjectables = false
|
||||||
|
platformSetupLoomIde()
|
||||||
|
loader("quilt")
|
||||||
|
}
|
||||||
|
|
||||||
|
loom {
|
||||||
|
}
|
||||||
|
|
||||||
|
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
|
||||||
|
developmentQuilt.extendsFrom common
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
modImplementation "org.quiltmc:quilt-loader:${rootProject.quilt_loader_version}"
|
||||||
|
modApi "org.quiltmc.quilted-fabric-api:quilted-fabric-api:${rootProject.quilt_fabric_api_version}"
|
||||||
|
// Remove the next few lines if you don't want to depend on the API
|
||||||
|
//modApi("dev.architectury:architectury-fabric:${rootProject.architectury_version}") {
|
||||||
|
// // We must not pull Fabric Loader from Architectury Fabric
|
||||||
|
// exclude group: "net.fabricmc"
|
||||||
|
// exclude group: "net.fabricmc.fabric-api"
|
||||||
|
//}
|
||||||
|
modImplementation "maven.modrinth:midnightlib:${rootProject.midnightlib_version}-quilt"
|
||||||
|
include "maven.modrinth:midnightlib:${rootProject.midnightlib_version}-quilt"
|
||||||
|
|
||||||
|
common(project(path: ":common", configuration: "namedElements")) { transitive false }
|
||||||
|
shadowCommon(project(path: ":common", configuration: "transformProductionQuilt")) { transitive false }
|
||||||
|
common(project(path: ":fabric-like", configuration: "namedElements")) { transitive false }
|
||||||
|
shadowCommon(project(path: ":fabric-like", configuration: "transformProductionQuilt")) { transitive false }
|
||||||
|
}
|
||||||
|
|
||||||
|
processResources {
|
||||||
|
inputs.property "group", rootProject.maven_group
|
||||||
|
inputs.property "version", project.version
|
||||||
|
|
||||||
|
filesMatching("quilt.mod.json") {
|
||||||
|
expand "group": rootProject.maven_group,
|
||||||
|
"version": project.version
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
shadowJar {
|
||||||
|
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 {
|
||||||
|
mavenQuilt(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
quilt/gradle.properties
Normal file
1
quilt/gradle.properties
Normal file
@@ -0,0 +1 @@
|
|||||||
|
loom.platform=quilt
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package eu.midnightdust.cullleaves.quilt;
|
||||||
|
|
||||||
|
import eu.midnightdust.cullleaves.CullLeavesClient;
|
||||||
|
import net.minecraft.util.Identifier;
|
||||||
|
import org.quiltmc.loader.api.ModContainer;
|
||||||
|
import org.quiltmc.qsl.base.api.entrypoint.client.ClientModInitializer;
|
||||||
|
import org.quiltmc.qsl.resource.loader.api.ResourceLoader;
|
||||||
|
import org.quiltmc.qsl.resource.loader.api.ResourcePackActivationType;
|
||||||
|
|
||||||
|
public class CullLeavesClientQuilt implements ClientModInitializer {
|
||||||
|
@Override
|
||||||
|
public void onInitializeClient(ModContainer mod) {
|
||||||
|
CullLeavesClient.onInitializeClient();
|
||||||
|
ResourceLoader.registerBuiltinResourcePack(new Identifier("cullleaves:smartleaves"), mod, ResourcePackActivationType.NORMAL);
|
||||||
|
}
|
||||||
|
}
|
||||||
59
quilt/src/main/resources/quilt.mod.json
Normal file
59
quilt/src/main/resources/quilt.mod.json
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
{
|
||||||
|
"schema_version": 1,
|
||||||
|
"quilt_loader": {
|
||||||
|
"group": "${group}",
|
||||||
|
"id": "cullleaves",
|
||||||
|
"version": "${version}",
|
||||||
|
"name": "Cull Leaves",
|
||||||
|
"description": "Adds culling to leaf blocks, providing a huge performance boost over vanilla.",
|
||||||
|
"authors": [
|
||||||
|
"Motschen",
|
||||||
|
"TeamMidnightDust"
|
||||||
|
],
|
||||||
|
"contact": {
|
||||||
|
"homepage": "https://www.midnightdust.eu/",
|
||||||
|
"sources": "https://github.com/TeamMidnightDust/MidnightLib",
|
||||||
|
"issues": "https://github.com/TeamMidnightDust/MidnightLib/issues"
|
||||||
|
},
|
||||||
|
"license": "MIT",
|
||||||
|
"icon": "assets/cullleaves/icon.png",
|
||||||
|
"intermediate_mappings": "net.fabricmc:intermediary",
|
||||||
|
"environment": "*",
|
||||||
|
"entrypoints": {
|
||||||
|
"client_init": [
|
||||||
|
"eu.midnightdust.cullleaves.quilt.CullLeavesClientQuilt"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"depends": [
|
||||||
|
{
|
||||||
|
"id": "quilt_loader",
|
||||||
|
"version": "*"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "quilt_base",
|
||||||
|
"version": "*"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "midnightlib",
|
||||||
|
"version": "*"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"name": "Cull Leaves (Quilt)",
|
||||||
|
"contributors": {
|
||||||
|
"Motschen": "Author",
|
||||||
|
"TeamMidnightDust": "Mascot"
|
||||||
|
},
|
||||||
|
"contact": {
|
||||||
|
"email": "mail@midnightdust.eu",
|
||||||
|
"homepage": "https://modrinth.com/mod/cullleaves",
|
||||||
|
"issues": "https://github.com/TeamMidnightDust/CullLeaves/issues",
|
||||||
|
"sources": "https://github.com/TeamMidnightDust/CullLeaves"
|
||||||
|
},
|
||||||
|
"icon": "assets/cullleaves/icon.png"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"mixin": [
|
||||||
|
"cullleaves.mixins.json"
|
||||||
|
]
|
||||||
|
}
|
||||||
16
settings.gradle
Executable file → Normal file
16
settings.gradle
Executable file → Normal file
@@ -1,10 +1,16 @@
|
|||||||
pluginManagement {
|
pluginManagement {
|
||||||
repositories {
|
repositories {
|
||||||
jcenter()
|
maven { url "https://maven.fabricmc.net/" }
|
||||||
maven {
|
maven { url "https://maven.architectury.dev/" }
|
||||||
name = 'Fabric'
|
maven { url "https://maven.minecraftforge.net/" }
|
||||||
url = 'https://maven.fabricmc.net/'
|
|
||||||
}
|
|
||||||
gradlePluginPortal()
|
gradlePluginPortal()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
include("common")
|
||||||
|
include("fabric-like")
|
||||||
|
include("fabric")
|
||||||
|
include("quilt")
|
||||||
|
include("forge")
|
||||||
|
|
||||||
|
rootProject.name = "cullleaves"
|
||||||
|
|||||||
Reference in New Issue
Block a user