mirror of
https://github.com/TeamMidnightDust/CullLeaves.git
synced 2025-12-15 14:15:08 +01:00
Port to 1.20.4 & Migrate to NeoForge
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id "architectury-plugin" version "3.4-SNAPSHOT"
|
id "architectury-plugin" version "3.4-SNAPSHOT"
|
||||||
id "dev.architectury.loom" version "1.1-SNAPSHOT" apply false
|
id "dev.architectury.loom" version "1.5-SNAPSHOT" apply false
|
||||||
}
|
}
|
||||||
|
|
||||||
architectury {
|
architectury {
|
||||||
@@ -18,7 +18,6 @@ subprojects {
|
|||||||
apply plugin: "dev.architectury.loom"
|
apply plugin: "dev.architectury.loom"
|
||||||
|
|
||||||
loom {
|
loom {
|
||||||
silentMojangMappingsLicense()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|||||||
@@ -3,8 +3,6 @@ architectury {
|
|||||||
common(rootProject.enabled_platforms.split(","))
|
common(rootProject.enabled_platforms.split(","))
|
||||||
}
|
}
|
||||||
|
|
||||||
loom {
|
|
||||||
}
|
|
||||||
repositories {
|
repositories {
|
||||||
maven { url "https://api.modrinth.com/maven" }
|
maven { url "https://api.modrinth.com/maven" }
|
||||||
}
|
}
|
||||||
@@ -19,17 +17,3 @@ dependencies {
|
|||||||
// Remove the next line if you don't want to depend on the API
|
// Remove the next line if you don't want to depend on the API
|
||||||
//modApi "dev.architectury:architectury:${rootProject.architectury_version}"
|
//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.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"pack": {
|
"pack": {
|
||||||
"pack_format": 15,
|
"pack_format": 15,
|
||||||
|
"supported_formats": [15, 99],
|
||||||
"description": "§2Makes leaves look identical to OptiFine's smart leaves"
|
"description": "§2Makes leaves look identical to OptiFine's smart leaves"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,5 +12,5 @@ dependencies {
|
|||||||
// Remove the next line if you don't want to depend on the API
|
// Remove the next line if you don't want to depend on the API
|
||||||
//modApi "dev.architectury:architectury-fabric:${rootProject.architectury_version}"
|
//modApi "dev.architectury:architectury-fabric:${rootProject.architectury_version}"
|
||||||
|
|
||||||
compileClasspath(project(path: ":common", configuration: "namedElements")) { transitive false }
|
compileOnly(project(path: ":common", configuration: "namedElements")) { transitive false }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,21 +46,18 @@ processResources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
shadowJar {
|
shadowJar {
|
||||||
exclude "architectury.common.json"
|
exclude "architectury.common.json"
|
||||||
|
|
||||||
configurations = [project.configurations.shadowCommon]
|
configurations = [project.configurations.shadowCommon]
|
||||||
classifier "dev-shadow"
|
archiveClassifier = "dev-shadow"
|
||||||
}
|
}
|
||||||
|
|
||||||
remapJar {
|
remapJar {
|
||||||
|
injectAccessWidener = true
|
||||||
input.set shadowJar.archiveFile
|
input.set shadowJar.archiveFile
|
||||||
dependsOn shadowJar
|
dependsOn shadowJar
|
||||||
classifier null
|
|
||||||
}
|
|
||||||
|
|
||||||
jar {
|
|
||||||
classifier "dev"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sourcesJar {
|
sourcesJar {
|
||||||
@@ -78,7 +75,7 @@ components.java {
|
|||||||
publishing {
|
publishing {
|
||||||
publications {
|
publications {
|
||||||
mavenFabric(MavenPublication) {
|
mavenFabric(MavenPublication) {
|
||||||
artifactId = rootProject.archives_base_name + "-" + project.name
|
artifactId = archives_base_name + "-" + project.name
|
||||||
from components.java
|
from components.java
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -87,4 +84,4 @@ publishing {
|
|||||||
repositories {
|
repositories {
|
||||||
// Add repositories to publish to here.
|
// Add repositories to publish to here.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1 +0,0 @@
|
|||||||
loom.platform=forge
|
|
||||||
@@ -1,21 +1,20 @@
|
|||||||
org.gradle.jvmargs=-Xmx4096M
|
org.gradle.jvmargs=-Xmx4096M
|
||||||
|
|
||||||
minecraft_version=1.20.1
|
minecraft_version=1.20.4
|
||||||
yarn_mappings=1.20.1+build.9
|
yarn_mappings=1.20.4+build.3
|
||||||
enabled_platforms=quilt,fabric,forge
|
enabled_platforms=fabric,neoforge
|
||||||
|
|
||||||
archives_base_name=cullleaves
|
archives_base_name=cullleaves
|
||||||
mod_version=3.2.0
|
mod_version=3.3.0
|
||||||
maven_group=eu.midnightdust
|
maven_group=eu.midnightdust
|
||||||
|
|
||||||
architectury_version=6.2.43
|
midnightlib_version=1.5.3
|
||||||
midnightlib_version=1.4.1
|
sodium_version=mc1.20.4-0.5.8
|
||||||
sodium_version=mc1.20.1-0.5.2
|
|
||||||
|
|
||||||
fabric_loader_version=0.14.21
|
fabric_loader_version=0.15.7
|
||||||
fabric_api_version=0.85.0+1.20.1
|
fabric_api_version=0.96.3+1.20.4
|
||||||
|
|
||||||
forge_version=1.20.1-47.1.0
|
neoforge_version=20.4.170
|
||||||
|
|
||||||
quilt_loader_version=0.18.9
|
quilt_loader_version=0.18.9
|
||||||
quilt_fabric_api_version=7.0.6+0.85.0-1.20.1
|
quilt_fabric_api_version=7.0.6+0.85.0-1.20.1
|
||||||
|
|||||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|||||||
@@ -5,16 +5,13 @@ plugins {
|
|||||||
architectury {
|
architectury {
|
||||||
injectInjectables = false
|
injectInjectables = false
|
||||||
platformSetupLoomIde()
|
platformSetupLoomIde()
|
||||||
forge()
|
neoForge()
|
||||||
}
|
}
|
||||||
|
|
||||||
loom {
|
loom {}
|
||||||
forge {
|
|
||||||
mixinConfig "cullleaves.mixins.json"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
repositories {
|
repositories {
|
||||||
maven { url "https://api.modrinth.com/maven" }
|
maven { url "https://api.modrinth.com/maven" }
|
||||||
|
maven {url "https://maven.neoforged.net/releases"}
|
||||||
}
|
}
|
||||||
|
|
||||||
configurations {
|
configurations {
|
||||||
@@ -23,18 +20,18 @@ configurations {
|
|||||||
compileClasspath.extendsFrom common
|
compileClasspath.extendsFrom common
|
||||||
runtimeClasspath.extendsFrom common
|
runtimeClasspath.extendsFrom common
|
||||||
developmentForge.extendsFrom common
|
developmentForge.extendsFrom common
|
||||||
archivesBaseName = rootProject.archives_base_name + "-forge"
|
archivesBaseName = rootProject.archives_base_name + "-neoforge"
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
forge "net.minecraftforge:forge:${rootProject.forge_version}"
|
neoForge "net.neoforged:neoforge:${rootProject.neoforge_version}"
|
||||||
// Remove the next line if you don't want to depend on the API
|
// Remove the next line if you don't want to depend on the API
|
||||||
//modApi "dev.architectury:architectury-forge:${rootProject.architectury_version}"
|
//modApi "dev.architectury:architectury-forge:${rootProject.architectury_version}"
|
||||||
modImplementation "maven.modrinth:midnightlib:${rootProject.midnightlib_version}-forge"
|
modImplementation "maven.modrinth:midnightlib:1.5.2-neoforge"
|
||||||
//include "maven.modrinth:midnightlib:${rootProject.midnightlib_version}-forge"
|
//include "maven.modrinth:midnightlib:${rootProject.midnightlib_version}-forge"
|
||||||
|
|
||||||
common(project(path: ":common", configuration: "namedElements")) { transitive false }
|
common(project(path: ":common", configuration: "namedElements")) { transitive false }
|
||||||
shadowCommon(project(path: ":common", configuration: "transformProductionForge")) { transitive = false }
|
shadowCommon(project(path: ":common", configuration: "transformProductionNeoForge")) { transitive = false }
|
||||||
}
|
}
|
||||||
|
|
||||||
processResources {
|
processResources {
|
||||||
@@ -50,17 +47,12 @@ shadowJar {
|
|||||||
exclude "architectury.common.json"
|
exclude "architectury.common.json"
|
||||||
|
|
||||||
configurations = [project.configurations.shadowCommon]
|
configurations = [project.configurations.shadowCommon]
|
||||||
classifier "dev-shadow"
|
archiveClassifier = "dev-shadow"
|
||||||
}
|
}
|
||||||
|
|
||||||
remapJar {
|
remapJar {
|
||||||
input.set shadowJar.archiveFile
|
input.set shadowJar.archiveFile
|
||||||
dependsOn shadowJar
|
dependsOn shadowJar
|
||||||
classifier null
|
|
||||||
}
|
|
||||||
|
|
||||||
jar {
|
|
||||||
classifier "dev"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sourcesJar {
|
sourcesJar {
|
||||||
@@ -77,7 +69,7 @@ components.java {
|
|||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
publications {
|
publications {
|
||||||
mavenForge(MavenPublication) {
|
mavenNeoForge(MavenPublication) {
|
||||||
artifactId = rootProject.archives_base_name + "-" + project.name
|
artifactId = rootProject.archives_base_name + "-" + project.name
|
||||||
from components.java
|
from components.java
|
||||||
}
|
}
|
||||||
@@ -87,4 +79,4 @@ publishing {
|
|||||||
repositories {
|
repositories {
|
||||||
// Add repositories to publish to here.
|
// Add repositories to publish to here.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
1
neoforge/gradle.properties
Normal file
1
neoforge/gradle.properties
Normal file
@@ -0,0 +1 @@
|
|||||||
|
loom.platform=neoforge
|
||||||
@@ -1,15 +1,17 @@
|
|||||||
package eu.midnightdust.cullleaves.forge;
|
package eu.midnightdust.cullleaves.neoforge;
|
||||||
|
|
||||||
import net.minecraft.resource.*;
|
import net.minecraft.resource.DirectoryResourcePack;
|
||||||
|
import net.minecraft.resource.ResourcePackProfile;
|
||||||
|
import net.minecraft.resource.ResourcePackSource;
|
||||||
|
import net.minecraft.resource.ResourceType;
|
||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.util.Identifier;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.neoforged.api.distmarker.Dist;
|
||||||
import net.minecraftforge.event.AddPackFindersEvent;
|
import net.neoforged.bus.api.SubscribeEvent;
|
||||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
import net.neoforged.fml.ModList;
|
||||||
import net.minecraftforge.fml.ModList;
|
import net.neoforged.fml.common.Mod;
|
||||||
import net.minecraftforge.fml.common.Mod;
|
import net.neoforged.neoforge.event.AddPackFindersEvent;
|
||||||
import net.minecraftforge.forgespi.locating.IModFile;
|
import net.neoforged.neoforgespi.locating.IModFile;
|
||||||
import net.minecraftforge.resource.PathPackResources;
|
|
||||||
|
|
||||||
@Mod.EventBusSubscriber(modid = "cullleaves", bus = Mod.EventBusSubscriber.Bus.MOD, value = Dist.CLIENT)
|
@Mod.EventBusSubscriber(modid = "cullleaves", bus = Mod.EventBusSubscriber.Bus.MOD, value = Dist.CLIENT)
|
||||||
public class CullLeavesClientEvents {
|
public class CullLeavesClientEvents {
|
||||||
@@ -22,9 +24,10 @@ public class CullLeavesClientEvents {
|
|||||||
private static void registerResourcePack(AddPackFindersEvent event, Identifier id, boolean alwaysEnabled) {
|
private static void registerResourcePack(AddPackFindersEvent event, Identifier id, boolean alwaysEnabled) {
|
||||||
event.addRepositorySource((profileAdder -> {
|
event.addRepositorySource((profileAdder -> {
|
||||||
IModFile file = ModList.get().getModFileById(id.getNamespace()).getFile();
|
IModFile file = ModList.get().getModFileById(id.getNamespace()).getFile();
|
||||||
try (PathPackResources pack = new PathPackResources(id.toString(), true, file.findResource("resourcepacks/"+id.getPath()))) {
|
try {
|
||||||
profileAdder.accept(ResourcePackProfile.create(id.toString(), Text.of(id.getNamespace()+"/"+id.getPath()), alwaysEnabled, a -> pack, ResourceType.CLIENT_RESOURCES, ResourcePackProfile.InsertionPosition.TOP, ResourcePackSource.BUILTIN));
|
ResourcePackProfile.PackFactory pack = new DirectoryResourcePack.DirectoryBackedFactory(file.findResource("resourcepacks/" + id.getPath()), true);
|
||||||
} catch (NullPointerException e) {e.printStackTrace();}
|
profileAdder.accept(ResourcePackProfile.create(id.toString(), Text.of(id.getNamespace()+"/"+id.getPath()), alwaysEnabled, pack, ResourceType.CLIENT_RESOURCES, ResourcePackProfile.InsertionPosition.TOP, ResourcePackSource.BUILTIN));
|
||||||
|
} catch (NullPointerException e) {e.fillInStackTrace();}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,21 +1,20 @@
|
|||||||
package eu.midnightdust.cullleaves.forge;
|
package eu.midnightdust.cullleaves.neoforge;
|
||||||
|
|
||||||
import eu.midnightdust.cullleaves.config.CullLeavesConfig;
|
import eu.midnightdust.cullleaves.config.CullLeavesConfig;
|
||||||
import eu.midnightdust.lib.config.MidnightConfig;
|
import eu.midnightdust.lib.config.MidnightConfig;
|
||||||
import net.minecraftforge.client.ConfigScreenHandler;
|
import net.neoforged.fml.IExtensionPoint;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.neoforged.fml.ModLoadingContext;
|
||||||
import net.minecraftforge.fml.IExtensionPoint;
|
import net.neoforged.fml.common.Mod;
|
||||||
import net.minecraftforge.fml.ModLoadingContext;
|
import net.neoforged.neoforge.client.ConfigScreenHandler;
|
||||||
import net.minecraftforge.fml.common.Mod;
|
|
||||||
import net.minecraftforge.network.NetworkConstants;
|
import static net.neoforged.fml.IExtensionPoint.DisplayTest.IGNORESERVERONLY;
|
||||||
|
|
||||||
@Mod("cullleaves")
|
@Mod("cullleaves")
|
||||||
public class CullLeavesClientForge {
|
public class CullLeavesClientForge {
|
||||||
public CullLeavesClientForge() {
|
public CullLeavesClientForge() {
|
||||||
MidnightConfig.init("cullleaves", CullLeavesConfig.class);
|
MidnightConfig.init("cullleaves", CullLeavesConfig.class);
|
||||||
ModLoadingContext.get().registerExtensionPoint(IExtensionPoint.DisplayTest.class, () -> new IExtensionPoint.DisplayTest(() -> NetworkConstants.IGNORESERVERONLY, (remote, server) -> true));
|
ModLoadingContext.get().registerExtensionPoint(IExtensionPoint.DisplayTest.class, () -> new IExtensionPoint.DisplayTest(() -> IGNORESERVERONLY, (remote, server) -> true));
|
||||||
ModLoadingContext.get().registerExtensionPoint(ConfigScreenHandler.ConfigScreenFactory.class, () ->
|
ModLoadingContext.get().registerExtensionPoint(ConfigScreenHandler.ConfigScreenFactory.class, () ->
|
||||||
new ConfigScreenHandler.ConfigScreenFactory((client, parent) -> MidnightConfig.getScreen(parent, "cullleaves")));
|
new ConfigScreenHandler.ConfigScreenFactory((client, parent) -> MidnightConfig.getScreen(parent, "cullleaves")));
|
||||||
MinecraftForge.EVENT_BUS.register(new CullLeavesClientEvents());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
modLoader = "javafml"
|
modLoader = "javafml"
|
||||||
loaderVersion = "[43,)"
|
loaderVersion = "[1,)"
|
||||||
#issueTrackerURL = ""
|
#issueTrackerURL = ""
|
||||||
license = "MIT License"
|
license = "MIT License"
|
||||||
|
|
||||||
@@ -13,23 +13,26 @@ Adds culling to leaf blocks, providing a huge performance boost over vanilla.
|
|||||||
'''
|
'''
|
||||||
logoFile = "icon.png"
|
logoFile = "icon.png"
|
||||||
|
|
||||||
|
[[mixins]]
|
||||||
|
config = "cullleaves.mixins.json"
|
||||||
|
|
||||||
[[dependencies.cullleaves]]
|
[[dependencies.cullleaves]]
|
||||||
modId = "forge"
|
modId = "neoforge"
|
||||||
mandatory = true
|
required = true
|
||||||
versionRange = "[43,)"
|
versionRange = "[20.3,)"
|
||||||
ordering = "NONE"
|
ordering = "NONE"
|
||||||
side = "CLIENT"
|
side = "CLIENT"
|
||||||
|
|
||||||
[[dependencies.cullleaves]]
|
[[dependencies.cullleaves]]
|
||||||
modId = "minecraft"
|
modId = "minecraft"
|
||||||
mandatory = true
|
required = true
|
||||||
versionRange = "[1.19.2,)"
|
versionRange = "[1.20,)"
|
||||||
ordering = "NONE"
|
ordering = "NONE"
|
||||||
side = "CLIENT"
|
side = "CLIENT"
|
||||||
|
|
||||||
[[dependencies.cullleaves]]
|
[[dependencies.cullleaves]]
|
||||||
modId = "midnightlib"
|
modId = "midnightlib"
|
||||||
mandatory = true
|
required = true
|
||||||
versionRange = "[1.0.0,)"
|
versionRange = "[1.0.0,)"
|
||||||
ordering = "BEFORE"
|
ordering = "BEFORE"
|
||||||
side = "CLIENT"
|
side = "CLIENT"
|
||||||
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
@@ -2,7 +2,7 @@ pluginManagement {
|
|||||||
repositories {
|
repositories {
|
||||||
maven { url "https://maven.fabricmc.net/" }
|
maven { url "https://maven.fabricmc.net/" }
|
||||||
maven { url "https://maven.architectury.dev/" }
|
maven { url "https://maven.architectury.dev/" }
|
||||||
maven { url "https://maven.minecraftforge.net/" }
|
maven { url "https://maven.neoforged.net/releases" }
|
||||||
gradlePluginPortal()
|
gradlePluginPortal()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -10,7 +10,7 @@ pluginManagement {
|
|||||||
include("common")
|
include("common")
|
||||||
include("fabric-like")
|
include("fabric-like")
|
||||||
include("fabric")
|
include("fabric")
|
||||||
include("quilt")
|
//include("quilt")
|
||||||
include("forge")
|
include("neoforge")
|
||||||
|
|
||||||
rootProject.name = "cullleaves"
|
rootProject.name = "cullleaves"
|
||||||
|
|||||||
Reference in New Issue
Block a user