diff --git a/EntityCulling-Fabric/build.gradle b/EntityCulling-Fabric/build.gradle deleted file mode 100644 index 070bca4..0000000 --- a/EntityCulling-Fabric/build.gradle +++ /dev/null @@ -1,101 +0,0 @@ -plugins { - id 'fabric-loom' version '0.9-SNAPSHOT' - id 'maven-publish' -} - -sourceCompatibility = JavaVersion.VERSION_16 -targetCompatibility = JavaVersion.VERSION_16 - -archivesBaseName = 'entityculling-fabric-mc' + project.minecraft_version -version = project.mod_version -group = project.maven_group - -repositories { - maven { - url "https://www.cursemaven.com" - } - maven { url 'https://jitpack.io' } //fabric asm - maven { - url "https://repo.codemc.io/repository/maven-public/" - } - //mavenLocal() // comment out for local testing -} - -configurations { - // configuration that holds jars to include in the jar - extraLibs -} - -minecraft { - refmapName = "entityculling.refmap.json" -} - -project.evaluationDependsOn(':EntityCulling-Shared') - -dependencies { - // To change the versions see the gradle.properties file - minecraft "com.mojang:minecraft:${project.minecraft_version}" - mappings loom.officialMojangMappings() - modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" - - // Fabric API. This is technically optional, but you probably want it anyway. - modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" - - implementation "com.logisticscraft:occlusionculling:${project.occlusionculling_version}" - extraLibs "com.logisticscraft:occlusionculling:${project.occlusionculling_version}" - - sourceSets.main.java.srcDirs += (project(':EntityCulling-Shared').sourceSets.main.java.srcDirs) - sourceSets.main.resources.srcDirs += (project(':EntityCulling-Shared').sourceSets.main.resources.srcDirs) -} - -processResources { - inputs.property "version", project.version - - filesMatching("fabric.mod.json") { - expand "version": project.version - } -} - -tasks.withType(JavaCompile).configureEach { - it.options.encoding = "UTF-8" - it.options.release = 16; - options.forkOptions.jvmArgs.addAll("--enable-preview") -} - -java { - // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task - // if it is present. - // If you remove this line, sources will not be generated. - withSourcesJar() - toolchain { - languageVersion = JavaLanguageVersion.of(16) - } -} - -jar { - from { - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - configurations.extraLibs.collect { it.isDirectory() ? it : zipTree(it) } - } -} - -// 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 - } - } - } - - // Select the repositories you want to publish to - // To publish to maven local, no extra repositories are necessary. Just use the task `publishToMavenLocal`. - repositories { - // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. - } -} diff --git a/EntityCulling-Fabric/gradle.properties b/EntityCulling-Fabric/gradle.properties deleted file mode 100644 index f5e68d6..0000000 --- a/EntityCulling-Fabric/gradle.properties +++ /dev/null @@ -1,2 +0,0 @@ -# Mod Properties -archives_base_name = EntityCulling-Fabric \ No newline at end of file diff --git a/EntityCulling-Fabric/src/main/java/dev/tr7zw/entityculling/EntityCullingMod.java b/EntityCulling-Fabric/src/main/java/dev/tr7zw/entityculling/EntityCullingMod.java deleted file mode 100644 index 80aa71c..0000000 --- a/EntityCulling-Fabric/src/main/java/dev/tr7zw/entityculling/EntityCullingMod.java +++ /dev/null @@ -1,26 +0,0 @@ -package dev.tr7zw.entityculling; - -import net.fabricmc.api.ClientModInitializer; -import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents; -import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper; - -public class EntityCullingMod extends EntityCullingModBase implements ClientModInitializer { - - @Override - public void onInitializeClient() { - super.onInitialize(); - } - - @Override - public void initModloader() { - ClientTickEvents.START_WORLD_TICK.register((event) -> { - this.worldTick(); - }); - ClientTickEvents.START_CLIENT_TICK.register(e -> - { - this.clientTick(); - }); - KeyBindingHelper.registerKeyBinding(keybind); - } - -} diff --git a/EntityCulling-Fabric/src/main/resources/fabric.mod.json b/EntityCulling-Fabric/src/main/resources/fabric.mod.json deleted file mode 100644 index e793bc1..0000000 --- a/EntityCulling-Fabric/src/main/resources/fabric.mod.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "schemaVersion": 1, - "id": "entityculling", - "version": "${version}", - - "name": "EntityCulling-Fabric", - "description": "This mod uses async path-tracing to hide Tiles/Entities that are not visible.", - "authors": [ - "tr7zw" - ], - "contact": { - "homepage": "https://github.com/tr7zw/EntityCulling-Fabric", - "sources": "https://github.com/tr7zw/EntityCulling-Fabric", - "issues": "https://github.com/tr7zw/EntityCulling-Fabric/issues" - }, - - "license": "MIT", - "icon": "assets/entityculling/icon.png", - - "environment": "client", - "entrypoints": { - "client": [ - "dev.tr7zw.entityculling.EntityCullingMod" - ] - }, - "mixins": [ - "entityculling.mixins.json" - ], - - "depends": { - "fabricloader": ">=0.11.3", - "fabric": "*", - "minecraft": "1.17.x" - } -} diff --git a/EntityCulling-Forge/build.gradle b/EntityCulling-Forge/build.gradle index e8be088..463a0a7 100644 --- a/EntityCulling-Forge/build.gradle +++ b/EntityCulling-Forge/build.gradle @@ -1,168 +1,544 @@ -buildscript { - repositories { - maven { url = 'https://maven.minecraftforge.net/' } - mavenCentral() - maven { - name = "Sponge" - url = "https://repo.spongepowered.org/repository/maven-public/" +// heavily cut down version of the GregTechCEu buildscript +import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar +import com.gtnewhorizons.retrofuturagradle.mcp.ReobfuscatedJar +import org.gradle.internal.logging.text.StyledTextOutputFactory + +import static org.gradle.internal.logging.text.StyledTextOutput.Style + +plugins { + id 'java' + id 'java-library' + id 'base' + id 'com.gtnewhorizons.retrofuturagradle' version '1.3.33' + id 'com.palantir.git-version' version '3.0.0' apply false + id 'com.github.johnrengelman.shadow' version '8.1.1' apply false +} + +def out = services.get(StyledTextOutputFactory).create('an-output') + + +// Project properties + +// Required properties: we don't know how to handle these being missing gracefully +checkPropertyExists("modName") +checkPropertyExists("modId") +checkPropertyExists("modGroup") +checkPropertyExists("minecraftVersion") // hard-coding this makes it harder to immediately tell what version a mod is in (even though this only really supports 1.12.2) +checkPropertyExists("apiPackage") +checkPropertyExists("accessTransformersFile") +checkPropertyExists("usesMixins") +checkPropertyExists("mixinsPackage") +checkPropertyExists("coreModClass") +checkPropertyExists("containsMixinsAndOrCoreModOnly") + +// Optional properties: we can assume some default behavior if these are missing +propertyDefaultIfUnset("modVersion", "") +propertyDefaultIfUnset("includeMCVersionJar", false) +propertyDefaultIfUnset("autoUpdateBuildScript", false) +propertyDefaultIfUnset("modArchivesBaseName", project.modId) +propertyDefaultIfUnsetWithEnvVar("developmentEnvironmentUserName", "Developer", "DEV_USERNAME") +propertyDefaultIfUnset("generateGradleTokenClass", "") +propertyDefaultIfUnset("gradleTokenModId", "") +propertyDefaultIfUnset("gradleTokenModName", "") +propertyDefaultIfUnset("gradleTokenVersion", "") +propertyDefaultIfUnset("useSrcApiPath", false) +propertyDefaultIfUnset("includeWellKnownRepositories", true) +propertyDefaultIfUnset("includeCommonDevEnvMods", true) +propertyDefaultIfUnset("noPublishedSources", false) +propertyDefaultIfUnset("forceEnableMixins", false) +propertyDefaultIfUnsetWithEnvVar("enableCoreModDebug", false, "CORE_MOD_DEBUG") +propertyDefaultIfUnset("generateMixinConfig", true) +propertyDefaultIfUnset("usesShadowedDependencies", false) +propertyDefaultIfUnset("minimizeShadowedDependencies", true) +propertyDefaultIfUnset("relocateShadowedDependencies", true) +propertyDefaultIfUnset("separateRunDirectories", false) +propertyDefaultIfUnset("versionDisplayFormat", '$MOD_NAME \u2212 $VERSION') +propertyDefaultIfUnsetWithEnvVar("modrinthProjectId", "", "MODRINTH_PROJECT_ID") +propertyDefaultIfUnset("modrinthRelations", "") +propertyDefaultIfUnsetWithEnvVar("curseForgeProjectId", "", "CURSEFORGE_PROJECT_ID") +propertyDefaultIfUnset("curseForgeRelations", "") +propertyDefaultIfUnsetWithEnvVar("releaseType", "release", "RELEASE_TYPE") +propertyDefaultIfUnset("generateDefaultChangelog", false) +propertyDefaultIfUnset("customMavenPublishUrl", "") +propertyDefaultIfUnset("mavenArtifactGroup", getDefaultArtifactGroup()) +propertyDefaultIfUnset("enableModernJavaSyntax", false) +propertyDefaultIfUnset("enableSpotless", false) +propertyDefaultIfUnset("enableJUnit", false) +propertyDefaultIfUnsetWithEnvVar("deploymentDebug", false, "DEPLOYMENT_DEBUG") + + +// Project property assertions + +final String javaSourceDir = 'src/main/java/' + +final String modGroupPath = modGroup.toString().replace('.' as char, '/' as char) +final String apiPackagePath = apiPackage.toString().replace('.' as char, '/' as char) + +String targetPackageJava = javaSourceDir + modGroupPath + +// Plugin application + +// Git version checking, also checking for if this is a submodule +if (project.file('.git/HEAD').isFile() || project.file('.git').isFile()) { + apply plugin: 'com.palantir.git-version' +} + +// Shadowing +if (usesShadowedDependencies.toBoolean()) { + apply plugin: 'com.github.johnrengelman.shadow' +} + + +// Configure Java + +java { + toolchain { + if (enableModernJavaSyntax.toBoolean()) { + languageVersion.set(JavaLanguageVersion.of(17)) + } else { + languageVersion.set(JavaLanguageVersion.of(8)) } + // Azul covers the most platforms for Java 8+ toolchains, crucially including MacOS arm64 + vendor.set(JvmVendorSpec.AZUL) } - dependencies { - classpath 'net.minecraftforge.gradle:ForgeGradle:4.+' - classpath 'org.spongepowered:mixingradle:0.7-SNAPSHOT' + if (!noPublishedSources.toBoolean()) { + withSourcesJar() } } -plugins { - id "java" - id "com.github.johnrengelman.shadow" version "2.0.4" +tasks.withType(JavaCompile).configureEach { + options.encoding = 'UTF-8' + + if (enableModernJavaSyntax.toBoolean()) { + if (it.name in ['compileMcLauncherJava', 'compilePatchedMcJava']) { + return + } + + sourceCompatibility = 17 + options.release.set(8) + + javaCompiler.set(javaToolchains.compilerFor { + languageVersion.set(JavaLanguageVersion.of(17)) + vendor.set(JvmVendorSpec.AZUL) + }) + } } -apply plugin: 'net.minecraftforge.gradle' -apply plugin: 'org.spongepowered.mixin' +tasks.withType(ScalaCompile).configureEach { + options.encoding = 'UTF-8' +} -repositories { - mavenCentral() - maven { url 'https://jitpack.io/' } - maven { url 'https://repo.spongepowered.org/repository/maven-public/' } - maven { url 'https://repo.sk1er.club/repository/maven-releases/' } - maven { url 'https://maven.minecraftforge.net/'} +// Configure Minecraft + +// Try to gather mod version from git tags if version is not manually specified +if (!modVersion) { + try { + modVersion = gitVersion() + } catch (Exception ignored) { + out.style(Style.Failure).text( + "Mod version could not be determined! Property 'modVersion' is not set, and either git is not installed or no git tags exist.\n" + + "Either specify a mod version in 'gradle.properties', or create at least one tag in git for this project." + ) + modVersion = 'NO-GIT-TAG-SET' + } } -version = project.mod_version -group = project.maven_group -archivesBaseName = 'entityculling-forge-mc' + project.minecraft_version +if (includeMCVersionJar.toBoolean()){ + version = "${minecraftVersion}-${modVersion}" +} +else { + version = modVersion +} + +group = modGroup -sourceCompatibility = targetCompatibility = 1.8 -compileJava.options.encoding = 'UTF-8' +base { + archivesName = modArchivesBaseName +} minecraft { - mappings channel: 'snapshot', version: '20171003-1.12' -// clientRunArgs += "--tweakClass" -// clientRunArgs += "org.spongepowered.asm.launch.MixinTweaker" -// clientRunArgs += "--mixin" -// clientRunArgs += "waveycapes.mixins.json" + mcVersion = minecraftVersion + username = developmentEnvironmentUserName.toString() + useDependencyAccessTransformers = true + + // Automatic token injection with RetroFuturaGradle + if (gradleTokenModId) { + injectedTags.put gradleTokenModId, modId + } + if (gradleTokenModName) { + injectedTags.put gradleTokenModName, modName + } + if (gradleTokenVersion) { + injectedTags.put gradleTokenVersion, modVersion + } + + // JVM arguments + extraRunJvmArguments.add("-ea:${modGroup}") + if (usesMixins.toBoolean()) { + extraRunJvmArguments.addAll([ + '-Dmixin.hotSwap=true', + '-Dmixin.checks.interfaces=true', + '-Dmixin.debug.export=true' + ]) + } + + if (enableCoreModDebug.toBoolean()) { + extraRunJvmArguments.addAll([ + '-Dlegacy.debugClassLoading=true', + '-Dlegacy.debugClassLoadingFiner=true', + '-Dlegacy.debugClassLoadingSave=true' + ]) + } } -configurations { - // Creates an extra configuration that implements `implementation` to be used later as the configuration that shades libraries - include - implementation.extendsFrom(include) - configurations.runtimeOnly.canBeResolved = true +if (generateGradleTokenClass) { + tasks.injectTags.outputClassName.set(generateGradleTokenClass) +} + + +// Repositories + +// Allow unsafe repos but warn +repositories.configureEach { repo -> + if (repo instanceof UrlArtifactRepository) { + if (repo.getUrl() != null && repo.getUrl().getScheme() == "http" && !repo.allowInsecureProtocol) { + logger.warn("Deprecated: Allowing insecure connections for repo '${repo.name}' - add 'allowInsecureProtocol = true'") + repo.allowInsecureProtocol = true + } + } } repositories { - jcenter() - maven { - url "https://repo.codemc.io/repository/maven-public/" + exclusiveContent { + forRepository { + //noinspection ForeignDelegate + maven { + name = 'Curse Maven' + url = 'https://www.cursemaven.com' + // url = 'https://beta.cursemaven.com' + } + } + filter { + includeGroup 'curse.maven' + } + } + exclusiveContent { + forRepository { + //noinspection ForeignDelegate + maven { + name = 'Modrinth' + url = 'https://api.modrinth.com/maven' + } + } + filter { + includeGroup 'maven.modrinth' + } + } + maven { + name 'Cleanroom Maven' + url 'https://maven.cleanroommc.com' + } + maven { + name 'BlameJared Maven' + url 'https://maven.blamejared.com' + } + maven { + name 'GTNH Maven' + url 'https://nexus.gtnewhorizons.com/repository/public/' + } + maven { + name 'GTCEu Maven' + url 'https://maven.gtceu.com' + } + maven { + url "https://repo.codemc.io/repository/maven-public/" + } + if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) { + maven { + name 'Cleanroom Maven' + url 'https://maven.cleanroommc.com' + } } - maven { - name "spongepowered" - url "https://repo.spongepowered.org/maven/" + mavenLocal() // Must be last for caching to work +} + + +// Dependencies + +// Configure dependency configurations +configurations { + embed + implementation.extendsFrom(embed) + + for (config in [compileClasspath, runtimeClasspath, testCompileClasspath, testRuntimeClasspath]) { + config.extendsFrom(shadowImplementation) + config.extendsFrom(shadowCompile) } - maven { url 'https://jitpack.io' } //fabric asm - maven { url 'https://repo.sk1er.club/repository/maven-releases/' } - maven { - url "https://repo.codemc.io/repository/maven-public/" + + create("runtimeOnlyNonPublishable") { + description = "Runtime only dependencies that are not published alongside the jar" + canBeConsumed = false + canBeResolved = false } - maven { url "https://maven.legacyfabric.net"} - maven { url 'https://maven.minecraftforge.net/'} + create("devOnlyNonPublishable") { + description = "Runtime and compiletime dependencies that are not published alongside the jar (compileOnly + runtimeOnlyNonPublishable)" + canBeConsumed = false + canBeResolved = false + } + + compileOnly.extendsFrom(devOnlyNonPublishable) + runtimeOnlyNonPublishable.extendsFrom(devOnlyNonPublishable) + runtimeClasspath.extendsFrom(runtimeOnlyNonPublishable) + testRuntimeClasspath.extendsFrom(runtimeOnlyNonPublishable) } +String mixinProviderSpec = 'zone.rong:mixinbooter:9.1' dependencies { -// annotationProcessor 'org.spongepowered:mixin:0.7.11-SNAPSHOT' - minecraft 'net.minecraftforge:forge:1.12.2-14.23.5.2860' - annotationProcessor 'org.spongepowered:mixin:0.8.5' - annotationProcessor 'com.google.code.gson:gson:2.9.0' - annotationProcessor 'com.google.guava:guava:31.1-jre' - annotationProcessor 'org.ow2.asm:asm:9.3' - annotationProcessor 'org.ow2.asm:asm-tree:9.3' - - include "com.logisticscraft:occlusionculling:${project.occlusionculling_version}" - - include 'org.spongepowered:mixin:0.8.5' - - sourceSets.main.java.srcDirs += new File(project.rootDir, "EntityCulling-Shared/src/main/java");//(project(':EntityCulling-Shared').sourceSets.main.java.srcDirs) - sourceSets.main.resources.srcDirs += new File(project.rootDir, "EntityCulling-Shared/src/main/resources");//sourceSets.main.resources.srcDirs += (project(':EntityCulling-Shared').sourceSets.main.resources.srcDirs) -} - -shadowJar { - finalizedBy('reobfJar') -// archiveClassifier.set('') - configurations = [project.configurations.include] - duplicatesStrategy DuplicatesStrategy.EXCLUDE - classifier "" //prevent creation of unshadowed jar - exclude 'pack.mcmeta' - exclude 'dummyThing' - exclude '**/module-info.class' - exclude '*.so' - exclude '*.dylib' - exclude '*.dll' - exclude '*.jnilib' - exclude 'ibxm/**' - exclude 'com/jcraft/**' - exclude 'org/lwjgl/**' - exclude 'net/java/**' - - exclude 'META-INF/proguard/**' - exclude 'META-INF/maven/**' - exclude 'META-INF/versions/**' - exclude 'META-INF/com.android.tools/**' - - exclude 'fabric.mod.json' + annotationProcessor 'org.ow2.asm:asm-debug-all:5.2' + // should use 24.1.1 but 30.0+ has a vulnerability fix + annotationProcessor 'com.google.guava:guava:30.0-jre' + // should use 2.8.6 but 2.8.9+ has a vulnerability fix + annotationProcessor 'com.google.code.gson:gson:2.8.9' + + mixinProviderSpec = modUtils.enableMixins(mixinProviderSpec, "${modId}.mixins.refmap.json") + api (mixinProviderSpec) { + transitive = false + } + + annotationProcessor(mixinProviderSpec) { + transitive = false + } + + patchedMinecraft('net.minecraft:launchwrapper:1.17.2') { + transitive = false + } + + shadowImplementation "com.logisticscraft:occlusionculling:${project.occlusionculling_version}" + } +// Resource processing and jar building + processResources { - inputs.property 'version', project.version - inputs.property 'mcversion', '1.12.2' - inputs.property 'name', 'entityculling' - inputs.property 'modid', 'entityculling' - from(sourceSets.main.resources.srcDirs) { - include 'mcmod.info' - expand ( - 'version':project.version, - 'mcversion':'1.12.2', - 'name':'EntityCulling', - 'modid': 'entityculling' + // this will ensure that this task is redone when the versions change. + inputs.property 'version', modVersion + inputs.property 'mcversion', minecraftVersion + // Blowdryer puts these files into the resource directory, so + // exclude them from builds (doesn't hurt to exclude even if not present) + exclude('spotless.importorder') + exclude('spotless.eclipseformat.xml') + + // replace stuff in mcmod.info, nothing else + filesMatching('mcmod.info') { fcd -> + fcd.expand( + 'version': modVersion, + 'mcversion': minecraftVersion, + 'modid': modId, + 'modname': modName ) } - from(sourceSets.main.resources.srcDirs) { - exclude 'mcmod.info' + + if (accessTransformersFile) { + String[] ats = accessTransformersFile.split(',') + ats.each { at -> + rename "(${at})", 'META-INF/$1' + } } } -// move resources so they can be accessed at runtime -task moveResources { +// Automatically generate a mixin json file if it does not already exist +tasks.register('generateAssets') { + group = 'GT Buildscript' + description = 'Generates a pack.mcmeta, mcmod.info, or mixins.{modid}.json if needed' doLast { - ant.move file: "${buildDir}/resources/main", - todir: "${buildDir}/classes/java" + // pack.mcmeta + def packMcmetaFile = getFile('src/main/resources/pack.mcmeta') + if (!packMcmetaFile.exists()) { + packMcmetaFile.text = """{ + "pack": { + "pack_format": 3, + "description": "${modName} Resource Pack" + } +} +""" + } + + // mcmod.info + def mcmodInfoFile = getFile('src/main/resources/mcmod.info') + if (!mcmodInfoFile.exists()) { + mcmodInfoFile.text = """[{ + "modid": "\${modid}", + "name": "\${modname}", + "description": "An example mod for Minecraft 1.12.2 with Forge", + "version": "\${version}", + "mcversion": "\${mcversion}", + "logoFile": "", + "url": "", + "authorList": [], + "credits": "", + "dependencies": [] +}] +""" + } + + // mixins.{modid}.json + if (usesMixins.toBoolean() && generateMixinConfig.toBoolean()) { + def mixinConfigFile = getFile("src/main/resources/mixins.${modId}.json") + if (!mixinConfigFile.exists()) { + def mixinConfigRefmap = "mixins.${modId}.refmap.json" + + mixinConfigFile.text = """{ + "package": "${modGroup}.${mixinsPackage}", + "refmap": "${mixinConfigRefmap}", + "target": "@env(DEFAULT)", + "minVersion": "0.8", + "compatibilityLevel": "JAVA_8", + "mixins": [], + "client": [], + "server": [] +} +""" + } + } } } -moveResources.dependsOn processResources -classes.dependsOn moveResources +tasks.named('processResources').configure { + dependsOn('generateAssets') +} + jar { - finalizedBy('shadowJar') - manifest.attributes( - "ForceLoadAsMod": true, - "ModSide": "CLIENT", - "MixinConfigs": 'entityculling.mixins.json', - "TweakClass": "org.spongepowered.asm.launch.MixinTweaker", - "TweakOrder": 0, - "Manifest-Version": 1.0 - ) + manifest { + attributes(getManifestAttributes()) + } + + // Add all embedded dependencies into the jar + from provider { + configurations.embed.collect { + it.isDirectory() ? it : zipTree(it) + } + } + +} + +// Configure shadow jar task +tasks.named('shadowJar', ShadowJar).configure { + manifest { + attributes(getManifestAttributes()) + } + configurations = [ + project.configurations.shadowImplementation, + project.configurations.shadowCompile + ] + archiveClassifier.set('dev') + if (relocateShadowedDependencies.toBoolean()) { + relocationPrefix = modGroup + '.shadow' + enableRelocation = true + } +} +configurations.runtimeElements.outgoing.artifacts.clear() +configurations.apiElements.outgoing.artifacts.clear() +configurations.runtimeElements.outgoing.artifact(tasks.named('shadowJar', ShadowJar)) +configurations.apiElements.outgoing.artifact(tasks.named('shadowJar', ShadowJar)) +tasks.named('jar', Jar) { + enabled = false + finalizedBy(tasks.shadowJar) +} +tasks.named('reobfJar', ReobfuscatedJar) { + inputJar.set(tasks.named('shadowJar', ShadowJar).flatMap({it.archiveFile})) +} +AdhocComponentWithVariants javaComponent = (AdhocComponentWithVariants) project.components.findByName('java') +javaComponent.withVariantsFromConfiguration(configurations.shadowRuntimeElements) { + skip() +} +for (runTask in ['runClient', 'runServer']) { + tasks.named(runTask).configure { + dependsOn('shadowJar') + } +} + +def getManifestAttributes() { + def attributes = [:] + if (coreModClass) { + attributes['FMLCorePlugin'] = "${modGroup}.${coreModClass}" + } + if (!containsMixinsAndOrCoreModOnly.toBoolean() && (usesMixins.toBoolean() || coreModClass)) { + // attributes['FMLCorePluginContainsFMLMod'] = true + } + if (accessTransformersFile) { + attributes['FMLAT'] = accessTransformersFile.toString() + } + + if (usesMixins.toBoolean()) { + attributes['ForceLoadAsMod'] = !containsMixinsAndOrCoreModOnly.toBoolean() + } + attributes['FMLCorePlugin'] = "dev.tr7zw.entityculling.EntityCullingEarlyLoader" + return attributes +} +def getSecondaryArtifacts() { + def secondaryArtifacts = [usesShadowedDependencies.toBoolean() ? tasks.shadowJar : tasks.jar] + if (!noPublishedSources.toBoolean()) secondaryArtifacts += [sourcesJar] + return secondaryArtifacts } -mixin { - disableRefMapWarning = true - defaultObfuscationEnv = 'searge' +def getReleaseType() { + String type = project.releaseType + if (!(type in ['release', 'beta', 'alpha'])) { + throw new Exception("Release type invalid! Found \"" + type + "\", allowed: \"release\", \"beta\", \"alpha\"") + } + return type +} + +// Helpers + +def getDefaultArtifactGroup() { + def lastIndex = project.modGroup.lastIndexOf('.') + return lastIndex < 0 ? project.modGroup : project.modGroup.substring(0, lastIndex) +} + +def getFile(String relativePath) { + return new File(projectDir, relativePath) +} + +def checkPropertyExists(String propertyName) { + if (!project.hasProperty(propertyName)) { + throw new GradleException("This project requires a property \"" + propertyName + "\"! Please add it your \"gradle.properties\". You can find all properties and their description here: https://github.com/GregTechCEu/Buildscripts/blob/main/gradle.properties") + } } -sourceSets { - main { - ext.refMap = "entityculling.refmap.json" +def propertyDefaultIfUnset(String propertyName, defaultValue) { + if (!project.hasProperty(propertyName) || project.property(propertyName) == "") { + project.ext.setProperty(propertyName, defaultValue) + } +} + +def propertyDefaultIfUnsetWithEnvVar(String propertyName, defaultValue, String envVarName) { + def envVar = providers.environmentVariable(envVarName) + if (envVar.isPresent()) { + project.ext.setProperty(propertyName, envVar.get()) + } else { + propertyDefaultIfUnset(propertyName, defaultValue) + } +} + +static runShell(command) { + def process = command.execute() + def outputStream = new StringBuffer() + def errorStream = new StringBuffer() + process.waitForProcessOutput(outputStream, errorStream) + + errorStream.toString().with { + if (it) { + throw new GradleException("Error executing ${command}:\n> ${it}") + } } + return outputStream.toString().trim() } +def getLastTag() { + def githubTag = providers.environmentVariable('GITHUB_TAG') + return runShell('git describe --abbrev=0 --tags ' + + (githubTag.isPresent() ? runShell('git rev-list --tags --skip=1 --max-count=1') : '')) +} \ No newline at end of file diff --git a/EntityCulling-Shared/src/main/java/dev/tr7zw/entityculling/Config.java b/EntityCulling-Forge/src/main/java/dev/tr7zw/entityculling/Config.java similarity index 100% rename from EntityCulling-Shared/src/main/java/dev/tr7zw/entityculling/Config.java rename to EntityCulling-Forge/src/main/java/dev/tr7zw/entityculling/Config.java diff --git a/EntityCulling-Shared/src/main/java/dev/tr7zw/entityculling/ConfigUpgrader.java b/EntityCulling-Forge/src/main/java/dev/tr7zw/entityculling/ConfigUpgrader.java similarity index 100% rename from EntityCulling-Shared/src/main/java/dev/tr7zw/entityculling/ConfigUpgrader.java rename to EntityCulling-Forge/src/main/java/dev/tr7zw/entityculling/ConfigUpgrader.java diff --git a/EntityCulling-Shared/src/main/java/dev/tr7zw/entityculling/CullTask.java b/EntityCulling-Forge/src/main/java/dev/tr7zw/entityculling/CullTask.java similarity index 99% rename from EntityCulling-Shared/src/main/java/dev/tr7zw/entityculling/CullTask.java rename to EntityCulling-Forge/src/main/java/dev/tr7zw/entityculling/CullTask.java index 8ad2a9d..42aeb24 100644 --- a/EntityCulling-Shared/src/main/java/dev/tr7zw/entityculling/CullTask.java +++ b/EntityCulling-Forge/src/main/java/dev/tr7zw/entityculling/CullTask.java @@ -65,7 +65,7 @@ public void run() { break; // We are not synced to the main thread, so NPE's/CME are allowed here and way less // overhead probably than trying to sync stuff up for no really good reason } - if(unCullable.contains(entry.getBlockType().getUnlocalizedName())) { + if(unCullable.contains(entry.getBlockType().getLocalizedName())) { continue; } Cullable cullable = (Cullable) entry; diff --git a/EntityCulling-Forge/src/main/java/dev/tr7zw/entityculling/EntityCullingEarlyLoader.java b/EntityCulling-Forge/src/main/java/dev/tr7zw/entityculling/EntityCullingEarlyLoader.java new file mode 100644 index 0000000..b3b945d --- /dev/null +++ b/EntityCulling-Forge/src/main/java/dev/tr7zw/entityculling/EntityCullingEarlyLoader.java @@ -0,0 +1,41 @@ +package dev.tr7zw.entityculling; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import zone.rong.mixinbooter.IEarlyMixinLoader; + +public class EntityCullingEarlyLoader implements net.minecraftforge.fml.relauncher.IFMLLoadingPlugin, IEarlyMixinLoader { + + @Override + public String[] getASMTransformerClass() { + return null; + } + + @Override + public String getModContainerClass() { + return null; + } + + @Override + public String getSetupClass() { + return null; + } + + @Override + public void injectData(Map data) { + + } + + @Override + public String getAccessTransformerClass() { + return null; + } + + @Override + public List getMixinConfigs() { + return Arrays.asList("entityculling.mixins.json"); + } + +} diff --git a/EntityCulling-Shared/src/main/java/dev/tr7zw/entityculling/EntityCullingMod.java b/EntityCulling-Forge/src/main/java/dev/tr7zw/entityculling/EntityCullingMod.java similarity index 93% rename from EntityCulling-Shared/src/main/java/dev/tr7zw/entityculling/EntityCullingMod.java rename to EntityCulling-Forge/src/main/java/dev/tr7zw/entityculling/EntityCullingMod.java index 853ffc7..dc35892 100644 --- a/EntityCulling-Shared/src/main/java/dev/tr7zw/entityculling/EntityCullingMod.java +++ b/EntityCulling-Forge/src/main/java/dev/tr7zw/entityculling/EntityCullingMod.java @@ -1,6 +1,9 @@ package dev.tr7zw.entityculling; +import java.util.Arrays; +import java.util.List; + import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.client.registry.ClientRegistry; import net.minecraftforge.fml.common.Mod; @@ -9,19 +12,16 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent; import net.minecraftforge.fml.common.gameevent.TickEvent.WorldTickEvent; +import zone.rong.mixinbooter.IEarlyMixinLoader; @Mod(modid = "entityculling", name = "EntityCulling", version = "@VER@", clientSideOnly = true) public class EntityCullingMod extends EntityCullingModBase { - - //Forge only - private boolean onServer = false; public EntityCullingMod() { try { Class clientClass = net.minecraft.client.Minecraft.class; }catch(Throwable ex) { System.out.println("EntityCulling Mod installed on a Server. Going to sleep."); - onServer = true; return; } onInitialize(); diff --git a/EntityCulling-Shared/src/main/java/dev/tr7zw/entityculling/EntityCullingModBase.java b/EntityCulling-Forge/src/main/java/dev/tr7zw/entityculling/EntityCullingModBase.java similarity index 100% rename from EntityCulling-Shared/src/main/java/dev/tr7zw/entityculling/EntityCullingModBase.java rename to EntityCulling-Forge/src/main/java/dev/tr7zw/entityculling/EntityCullingModBase.java diff --git a/EntityCulling-Shared/src/main/java/dev/tr7zw/entityculling/Provider.java b/EntityCulling-Forge/src/main/java/dev/tr7zw/entityculling/Provider.java similarity index 100% rename from EntityCulling-Shared/src/main/java/dev/tr7zw/entityculling/Provider.java rename to EntityCulling-Forge/src/main/java/dev/tr7zw/entityculling/Provider.java diff --git a/EntityCulling-Shared/src/main/java/dev/tr7zw/entityculling/access/Cullable.java b/EntityCulling-Forge/src/main/java/dev/tr7zw/entityculling/access/Cullable.java similarity index 100% rename from EntityCulling-Shared/src/main/java/dev/tr7zw/entityculling/access/Cullable.java rename to EntityCulling-Forge/src/main/java/dev/tr7zw/entityculling/access/Cullable.java diff --git a/EntityCulling-Shared/src/main/java/dev/tr7zw/entityculling/access/EntityRendererInter.java b/EntityCulling-Forge/src/main/java/dev/tr7zw/entityculling/access/EntityRendererInter.java similarity index 100% rename from EntityCulling-Shared/src/main/java/dev/tr7zw/entityculling/access/EntityRendererInter.java rename to EntityCulling-Forge/src/main/java/dev/tr7zw/entityculling/access/EntityRendererInter.java diff --git a/EntityCulling-Shared/src/main/java/dev/tr7zw/entityculling/mixin/BlockEntityRenderDispatcherMixin.java b/EntityCulling-Forge/src/main/java/dev/tr7zw/entityculling/mixin/BlockEntityRenderDispatcherMixin.java similarity index 100% rename from EntityCulling-Shared/src/main/java/dev/tr7zw/entityculling/mixin/BlockEntityRenderDispatcherMixin.java rename to EntityCulling-Forge/src/main/java/dev/tr7zw/entityculling/mixin/BlockEntityRenderDispatcherMixin.java diff --git a/EntityCulling-Shared/src/main/java/dev/tr7zw/entityculling/mixin/CullableMixin.java b/EntityCulling-Forge/src/main/java/dev/tr7zw/entityculling/mixin/CullableMixin.java similarity index 100% rename from EntityCulling-Shared/src/main/java/dev/tr7zw/entityculling/mixin/CullableMixin.java rename to EntityCulling-Forge/src/main/java/dev/tr7zw/entityculling/mixin/CullableMixin.java diff --git a/EntityCulling-Shared/src/main/java/dev/tr7zw/entityculling/mixin/DebugHudMixin.java b/EntityCulling-Forge/src/main/java/dev/tr7zw/entityculling/mixin/DebugHudMixin.java similarity index 100% rename from EntityCulling-Shared/src/main/java/dev/tr7zw/entityculling/mixin/DebugHudMixin.java rename to EntityCulling-Forge/src/main/java/dev/tr7zw/entityculling/mixin/DebugHudMixin.java diff --git a/EntityCulling-Shared/src/main/java/dev/tr7zw/entityculling/mixin/EntityRendererMixin.java b/EntityCulling-Forge/src/main/java/dev/tr7zw/entityculling/mixin/EntityRendererMixin.java similarity index 100% rename from EntityCulling-Shared/src/main/java/dev/tr7zw/entityculling/mixin/EntityRendererMixin.java rename to EntityCulling-Forge/src/main/java/dev/tr7zw/entityculling/mixin/EntityRendererMixin.java diff --git a/EntityCulling-Shared/src/main/java/dev/tr7zw/entityculling/mixin/WorldRendererMixin.java b/EntityCulling-Forge/src/main/java/dev/tr7zw/entityculling/mixin/WorldRendererMixin.java similarity index 100% rename from EntityCulling-Shared/src/main/java/dev/tr7zw/entityculling/mixin/WorldRendererMixin.java rename to EntityCulling-Forge/src/main/java/dev/tr7zw/entityculling/mixin/WorldRendererMixin.java diff --git a/EntityCulling-Forge/src/main/resources/META-INF/mods.toml b/EntityCulling-Forge/src/main/resources/META-INF/mods.toml index 7f1122e..e5fd5a6 100644 --- a/EntityCulling-Forge/src/main/resources/META-INF/mods.toml +++ b/EntityCulling-Forge/src/main/resources/META-INF/mods.toml @@ -1,6 +1,6 @@ modLoader="javafml" loaderVersion="[35,)" -license="MIT" +license="tr7zw Protective License" [[mods]] modId="entityculling" version="1.6.2" diff --git a/EntityCulling-Shared/src/main/resources/assets/entityculling/lang/en_us.json b/EntityCulling-Forge/src/main/resources/assets/entityculling/lang/en_us.json similarity index 100% rename from EntityCulling-Shared/src/main/resources/assets/entityculling/lang/en_us.json rename to EntityCulling-Forge/src/main/resources/assets/entityculling/lang/en_us.json diff --git a/EntityCulling-Shared/src/main/resources/entityculling.mixins.json b/EntityCulling-Forge/src/main/resources/entityculling.mixins.json similarity index 81% rename from EntityCulling-Shared/src/main/resources/entityculling.mixins.json rename to EntityCulling-Forge/src/main/resources/entityculling.mixins.json index 02762b2..d7cbb36 100644 --- a/EntityCulling-Shared/src/main/resources/entityculling.mixins.json +++ b/EntityCulling-Forge/src/main/resources/entityculling.mixins.json @@ -2,7 +2,8 @@ "required": true, "package": "dev.tr7zw.entityculling.mixin", "compatibilityLevel": "JAVA_8", - "refmap": "entityculling.refmap.json", + "minVersion": "0.8", + "refmap": "entityculling.mixins.refmap.json", "mixins": [ ], "client": [ diff --git a/EntityCulling-Shared/src/main/resources/assets/entityculling/icon.png b/EntityCulling-Forge/src/main/resources/icon.png similarity index 100% rename from EntityCulling-Shared/src/main/resources/assets/entityculling/icon.png rename to EntityCulling-Forge/src/main/resources/icon.png diff --git a/EntityCulling-Forge/src/main/resources/mcmod.info b/EntityCulling-Forge/src/main/resources/mcmod.info new file mode 100644 index 0000000..1dd1708 --- /dev/null +++ b/EntityCulling-Forge/src/main/resources/mcmod.info @@ -0,0 +1,12 @@ +[{ + "modid": "${modid}", + "name": "${modname}", + "description": "Using async raytracing to hide Tile-/Entities that are hidden behind solid blocks.", + "version": "${version}", + "mcversion": "${mcversion}", + "logoFile": "icon.png", + "url": "", + "authorList": ["tr7zw"], + "credits": "", + "dependencies": [] +}] diff --git a/EntityCulling-Shared/build.gradle b/EntityCulling-Shared/build.gradle deleted file mode 100644 index f9ab563..0000000 --- a/EntityCulling-Shared/build.gradle +++ /dev/null @@ -1,65 +0,0 @@ -plugins { - id 'fabric-loom' version '0.9-SNAPSHOT' -} - -sourceCompatibility = JavaVersion.VERSION_16 -targetCompatibility = JavaVersion.VERSION_16 - -archivesBaseName = project.archives_base_name -version = project.mod_version -group = project.maven_group - -repositories { - maven { - url "https://www.cursemaven.com" - } - maven { url 'https://jitpack.io' } //fabric asm - maven { - url "https://repo.codemc.io/repository/maven-public/" - } - //mavenLocal() // comment out for local testing -} - -configurations { - // configuration that holds jars to include in the jar - extraLibs -} - -dependencies { - // To change the versions see the gradle.properties file - minecraft "com.mojang:minecraft:${project.minecraft_version}" - mappings loom.officialMojangMappings() - modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" - - implementation "com.logisticscraft:occlusionculling:0.0.5-SNAPSHOT" - extraLibs "com.logisticscraft:occlusionculling:0.0.5-SNAPSHOT" -} - -minecraft { - remapMod = false -} - -tasks.withType(JavaCompile).configureEach { - it.options.encoding = "UTF-8" - it.options.release = 16; - options.forkOptions.jvmArgs.addAll("--enable-preview") -} - -java { - // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task - // if it is present. - // If you remove this line, sources will not be generated. - withSourcesJar() - toolchain { - languageVersion = JavaLanguageVersion.of(16) - } -} - -jar { - from("LICENSE") { - rename { "${it}_${project.archivesBaseName}"} - } - from { - configurations.extraLibs.collect { it.isDirectory() ? it : zipTree(it) } - } -} \ No newline at end of file diff --git a/EntityCulling-Shared/gradle.properties b/EntityCulling-Shared/gradle.properties deleted file mode 100644 index b1b4812..0000000 --- a/EntityCulling-Shared/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -archives_base_name = EntityCulling-Fabric \ No newline at end of file diff --git a/LICENSE b/LICENSE index 4194ff1..5ea762d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,22 @@ -MIT License +tr7zw Protective License -Copyright (c) 2021 tr7zw +Copyright (c) tr7zw, 2024 Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +of this software (in source or binary form) and associated documentation files +(the "Software"), to use, modify and compile the Software, subject to the +following conditions: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. +The Software may not be used to get a) a commercial advantage, or b) monetary +compensation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 5985f80..2678290 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,15 +1,116 @@ # Gradle org.gradle.jvmargs=-Xmx2G org.gradle.parallel=true +org.gradle.daemon=false # Build mod_version=1.6.2 -maven_group=de.tr7zw +maven_group=dev.tr7zw.entityculling # Fabric/Forge settings minecraft_version=1.12.2 -loader_version=0.11.3 -fabric_version=0.34.9+1.17 # Dependencies -occlusionculling_version=0.0.7-SNAPSHOT \ No newline at end of file +occlusionculling_version=0.0.7-SNAPSHOT + +modName = EntityCulling + +# This is a case-sensitive string to identify your mod. Convention is to use lower case. +modId = entityculling + +modGroup = dev.tr7zw.entityculling + +# Version of your mod. +# This field can be left empty if you want your mod's version to be determined by the latest git tag instead. +modVersion = 1.6.2 + +# Whether to use the old jar naming structure (modid-mcversion-version) instead of the new version (modid-version) +includeMCVersionJar = true + +# The name of your jar when you produce builds, not including any versioning info +modArchivesBaseName = entityculling + +# Will update your build.gradle automatically whenever an update is available +autoUpdateBuildScript = false + +minecraftVersion = 1.12.2 + +# Select a username for testing your mod with breakpoints. You may leave this empty for a random username each time you +# restart Minecraft in development. Choose this dependent on your mod: +# Do you need consistent player progressing (for example Thaumcraft)? -> Select a name +# Do you need to test how your custom blocks interacts with a player that is not the owner? -> leave name empty +# Alternatively this can be set with the 'DEV_USERNAME' environment variable. +developmentEnvironmentUserName = Developer + +# Generate a class with String fields for the mod id, name and version named with the fields below +generateGradleTokenClass = com.myname.mymodid.Tags +gradleTokenModId = MODID +gradleTokenModName = MODNAME +gradleTokenVersion = VERSION + +# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can +# leave this property empty. +# Example value: apiPackage = api + modGroup = com.myname.mymodid -> com.myname.mymodid.api +apiPackage = + +# If you want to keep your API code in src/api instead of src/main +useSrcApiPath = false + +# Specify the configuration file for Forge's access transformers here. It must be placed into /src/main/resources/ +# There can be multiple files in a comma-separated list. +# Example value: mymodid_at.cfg,jei_at.cfg +accessTransformersFile = + +# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled! +usesMixins = true +# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail! +mixinsPackage = dev.tr7zw.entityculling.mixins +# Automatically generates a mixin config json if enabled, with the name mixins.modid.json +generateMixinConfig = false +# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin! +# Example value: coreModClass = asm.FMLPlugin + modGroup = com.myname.mymodid -> com.myname.mymodid.asm.FMLPlugin +coreModClass = +# If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod (meaning that +# there is no class annotated with @Mod) you want this to be true. When in doubt: leave it on false! +containsMixinsAndOrCoreModOnly = false + +# Enables Mixins even if this mod doesn't use them, useful if one of the dependencies uses mixins. +forceEnableMixins = false + +# Outputs pre-transformed and post-transformed loaded classes to run/CLASSLOADER_TEMP. Can be used in combination with +# diff to see exactly what your ASM or Mixins are changing in the target file. +# Optionally can be specified with the 'CORE_MOD_DEBUG' env var. Will output a lot of files! +enableCoreModDebug = false + +# Adds CurseMaven, Modrinth Maven, BlameJared maven, and some more well-known 1.12.2 repositories +includeWellKnownRepositories = true + +# Adds JEI and TheOneProbe to your development environment. Adds them as 'implementation', meaning they will +# be available at compiletime and runtime for your mod (in-game and in-code). +# Overrides the above setting to be always true, as these repositories are needed to fetch the mods +includeCommonDevEnvMods = false + + +# If enabled, you may use 'shadowCompile' for dependencies. They will be integrated in your jar. It is your +# responsibility check the licence and request permission for distribution, if required. +usesShadowedDependencies = true +# If disabled, won't remove unused classes from shaded dependencies. Some libraries use reflection to access +# their own classes, making the minimization unreliable. +minimizeShadowedDependencies = false +# If disabled, won't rename the shadowed classes. +relocateShadowedDependencies = true + +# Separate run directories into "run/client" for runClient task, and "run/server" for runServer task. +# Useful for debugging a server and client simultaneously. If not enabled, it will be in the standard location "run/" +separateRunDirectories = false + +# The display name format of versions published to Curse and Modrinth. $MOD_NAME and $VERSION are available variables. +# Default: $MOD_NAME \u2212 $VERSION. \u2212 is the minus character which looks much better than the hyphen minus on Curse. +versionDisplayFormat = $MOD_NAME \u2212 $VERSION + +# Gradle Settings +# Effectively applies the '--stacktrace' flag by default +org.gradle.logging.stacktrace = all +# Sets default memory used for gradle commands. Can be overridden by user or command line properties. +# This is required to provide enough memory for the Minecraft decompilation process. +org.gradle.jvmargs = -Xmx3G \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index e708b1c..7454180 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index c19e35b..e411586 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/settings.gradle b/settings.gradle index 0ab9cc9..bf460b0 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,29 +1,25 @@ -/*pluginManagement { +pluginManagement { repositories { - gradlePluginPortal() - mavenCentral() - mavenLocal() maven { - name = "Forge" - url = "https://maven.minecraftforge.net/" - } - maven { - name = "Jitpack" - url = "https://jitpack.io/" - } - } - resolutionStrategy { - eachPlugin { - switch (requested.id.id) { - case 'net.minecraftforge.gradle.forge': - useModule "com.github.asbyth:ForgeGradle:${requested.version}" - break //broken? - case 'org.spongepowered.mixin': - useModule "com.github.Skytils:MixinGradle:${requested.version}" - break + // RetroFuturaGradle + name 'GTNH Maven' + url 'https://nexus.gtnewhorizons.com/repository/public/' + //noinspection GroovyAssignabilityCheck + mavenContent { + includeGroup 'com.gtnewhorizons' + includeGroup 'com.gtnewhorizons.retrofuturagradle' } } + gradlePluginPortal() + mavenCentral() + mavenLocal() } -}*/ +} + +plugins { + // Automatic toolchain provisioning + //id 'org.gradle.toolchains.foojay-resolver-convention' version '0.7.0' +} + include 'EntityCulling-Forge' \ No newline at end of file