mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-15 17:45:08 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1728809a8a | ||
|
|
0edabd4a9d | ||
|
|
b5752a8338 | ||
|
|
29b0d711f7 | ||
|
|
e41827fb69 | ||
|
|
628af062ba | ||
|
|
09661218a3 | ||
|
|
e9f9412cab |
No files matched your search
+276
-24
@@ -1,4 +1,4 @@
|
||||
//version: 1674943145
|
||||
//version: 1676031737
|
||||
/*
|
||||
DO NOT CHANGE THIS FILE!
|
||||
Also, you may replace this file at any time if there is an update available.
|
||||
@@ -9,11 +9,15 @@
|
||||
import com.diffplug.blowdryer.Blowdryer
|
||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation
|
||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||
import com.gtnewhorizons.retrofuturagradle.ObfuscationAttribute
|
||||
import com.gtnewhorizons.retrofuturagradle.mcp.ReobfuscatedJar
|
||||
import com.gtnewhorizons.retrofuturagradle.minecraft.RunMinecraftTask
|
||||
import com.matthewprenger.cursegradle.CurseArtifact
|
||||
import com.matthewprenger.cursegradle.CurseRelation
|
||||
import com.modrinth.minotaur.dependencies.ModDependency
|
||||
import com.modrinth.minotaur.dependencies.VersionDependency
|
||||
import cpw.mods.fml.relauncher.Side
|
||||
import org.gradle.api.tasks.options.Option;
|
||||
import org.gradle.internal.logging.text.StyledTextOutput.Style
|
||||
import org.gradle.internal.logging.text.StyledTextOutputFactory
|
||||
import org.jetbrains.gradle.ext.*
|
||||
@@ -23,6 +27,7 @@ import java.nio.file.Paths
|
||||
import java.util.concurrent.TimeUnit
|
||||
import java.util.zip.ZipEntry
|
||||
import java.util.zip.ZipOutputStream
|
||||
import javax.inject.Inject
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
@@ -55,9 +60,9 @@ plugins {
|
||||
id 'eclipse'
|
||||
id 'scala'
|
||||
id 'maven-publish'
|
||||
id 'org.jetbrains.kotlin.jvm' version '1.5.30' apply false
|
||||
id 'org.jetbrains.kotlin.kapt' version '1.5.30' apply false
|
||||
id 'com.google.devtools.ksp' version '1.5.30-1.0.0' apply false
|
||||
id 'org.jetbrains.kotlin.jvm' version '1.8.0' apply false
|
||||
id 'org.jetbrains.kotlin.kapt' version '1.8.0' apply false
|
||||
id 'com.google.devtools.ksp' version '1.8.0-1.0.9' apply false
|
||||
id 'org.ajoberstar.grgit' version '4.1.1' // 4.1.1 is the last jvm8 supporting version ,unused, available for addon.gradle
|
||||
id 'com.github.johnrengelman.shadow' version '7.1.2' apply false
|
||||
id 'com.palantir.git-version' version '0.13.0' apply false // 0.13.0 is the last jvm8 supporting version
|
||||
@@ -66,7 +71,7 @@ plugins {
|
||||
id 'com.diffplug.spotless' version '6.7.2' apply false
|
||||
id 'com.modrinth.minotaur' version '2.+' apply false
|
||||
id 'com.matthewprenger.cursegradle' version '1.4.0' apply false
|
||||
id 'com.gtnewhorizons.retrofuturagradle' version '1.0.16'
|
||||
id 'com.gtnewhorizons.retrofuturagradle' version '1.1.6'
|
||||
}
|
||||
boolean settingsupdated = verifySettingsGradle()
|
||||
settingsupdated = verifyGitAttributes() || settingsupdated
|
||||
@@ -113,6 +118,7 @@ propertyDefaultIfUnset("modrinthRelations", "")
|
||||
propertyDefaultIfUnset("curseForgeProjectId", "")
|
||||
propertyDefaultIfUnset("curseForgeRelations", "")
|
||||
propertyDefaultIfUnset("minimizeShadowedDependencies", true)
|
||||
propertyDefaultIfUnset("relocateShadowedDependencies", true)
|
||||
// Deprecated properties (kept for backwards compat)
|
||||
propertyDefaultIfUnset("gradleTokenModId", "")
|
||||
propertyDefaultIfUnset("gradleTokenModName", "")
|
||||
@@ -149,6 +155,33 @@ java {
|
||||
}
|
||||
}
|
||||
|
||||
pluginManager.withPlugin('org.jetbrains.kotlin.jvm') {
|
||||
// If Kotlin is enabled in the project
|
||||
kotlin {
|
||||
jvmToolchain(8)
|
||||
}
|
||||
// Kotlin hacks our source sets, so we hack Kotlin's tasks
|
||||
def disabledKotlinTaskList = [
|
||||
"kaptGenerateStubsMcLauncherKotlin",
|
||||
"kaptGenerateStubsPatchedMcKotlin",
|
||||
"kaptGenerateStubsInjectedTagsKotlin",
|
||||
"compileMcLauncherKotlin",
|
||||
"compilePatchedMcKotlin",
|
||||
"compileInjectedTagsKotlin",
|
||||
"kaptMcLauncherKotlin",
|
||||
"kaptPatchedMcKotlin",
|
||||
"kaptInjectedTagsKotlin",
|
||||
"kspMcLauncherKotlin",
|
||||
"kspPatchedMcKotlin",
|
||||
"kspInjectedTagsKotlin",
|
||||
]
|
||||
tasks.configureEach { task ->
|
||||
if (task.name in disabledKotlinTaskList) {
|
||||
task.enabled = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
configurations {
|
||||
create("runtimeOnlyNonPublishable") {
|
||||
description = "Runtime only dependencies that are not published alongside the jar"
|
||||
@@ -158,11 +191,21 @@ configurations {
|
||||
}
|
||||
|
||||
if (enableModernJavaSyntax.toBoolean()) {
|
||||
repositories {
|
||||
mavenCentral {
|
||||
mavenContent {
|
||||
includeGroup("me.eigenraven.java8unsupported")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
annotationProcessor 'com.github.bsideup.jabel:jabel-javac-plugin:1.0.0'
|
||||
compileOnly('com.github.bsideup.jabel:jabel-javac-plugin:1.0.0') {
|
||||
transitive = false // We only care about the 1 annotation class
|
||||
}
|
||||
// Allow using jdk.unsupported classes like sun.misc.Unsafe in the compiled code, working around JDK-8206937.
|
||||
patchedMinecraft('me.eigenraven.java8unsupported:java-8-unsupported-shim:1.0.0')
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile).configureEach {
|
||||
@@ -212,6 +255,25 @@ if (accessTransformersFile) {
|
||||
}
|
||||
tasks.deobfuscateMergedJarToSrg.accessTransformerFiles.from(targetFile)
|
||||
tasks.srgifyBinpatchedJar.accessTransformerFiles.from(targetFile)
|
||||
} else {
|
||||
boolean atsFound = false
|
||||
for (File at : sourceSets.getByName("main").resources.files) {
|
||||
if (at.name.toLowerCase().endsWith("_at.cfg")) {
|
||||
atsFound = true
|
||||
tasks.deobfuscateMergedJarToSrg.accessTransformerFiles.from(at)
|
||||
tasks.srgifyBinpatchedJar.accessTransformerFiles.from(at)
|
||||
}
|
||||
}
|
||||
for (File at : sourceSets.getByName("api").resources.files) {
|
||||
if (at.name.toLowerCase().endsWith("_at.cfg")) {
|
||||
atsFound = true
|
||||
tasks.deobfuscateMergedJarToSrg.accessTransformerFiles.from(at)
|
||||
tasks.srgifyBinpatchedJar.accessTransformerFiles.from(at)
|
||||
}
|
||||
}
|
||||
if (atsFound) {
|
||||
logger.warn("Found and added access transformers in the resources folder, please configure gradle.properties to explicitly mention them by name")
|
||||
}
|
||||
}
|
||||
|
||||
if (usesMixins.toBoolean()) {
|
||||
@@ -290,7 +352,7 @@ if (identifiedVersion == versionOverride) {
|
||||
out.style(Style.Failure).text('Override version to ').style(Style.Identifier).text(modVersion).style(Style.Failure).println('!\7')
|
||||
}
|
||||
|
||||
group = modGroup
|
||||
group = "com.github.GTNewHorizons"
|
||||
if (project.hasProperty("customArchiveBaseName") && customArchiveBaseName) {
|
||||
archivesBaseName = customArchiveBaseName
|
||||
} else {
|
||||
@@ -354,6 +416,26 @@ configurations.configureEach {
|
||||
}
|
||||
}
|
||||
}
|
||||
def obfuscationAttr = it.attributes.getAttribute(ObfuscationAttribute.OBFUSCATION_ATTRIBUTE)
|
||||
if (obfuscationAttr != null && obfuscationAttr.name == ObfuscationAttribute.SRG) {
|
||||
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
|
||||
// Remap CoFH core cursemaven dev jar to the obfuscated version for runObfClient/Server
|
||||
if (details.requested.group == 'curse.maven' && details.requested.name.endsWith('-69162') && details.requested.version == '2388751') {
|
||||
details.useVersion '2388750'
|
||||
details.because 'Pick obfuscated jar'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure tests have access to minecraft classes
|
||||
sourceSets {
|
||||
test {
|
||||
java {
|
||||
compileClasspath += sourceSets.patchedMc.output + sourceSets.mcLauncher.output
|
||||
runtimeClasspath += sourceSets.patchedMc.output + sourceSets.mcLauncher.output
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (file('addon.gradle').exists()) {
|
||||
@@ -363,7 +445,7 @@ if (file('addon.gradle').exists()) {
|
||||
// Allow unsafe repos but warn
|
||||
repositories.configureEach { repo ->
|
||||
if (repo instanceof org.gradle.api.artifacts.repositories.UrlArtifactRepository) {
|
||||
if (repo.getUrl().getScheme() == "http" && !repo.allowInsecureProtocol) {
|
||||
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
|
||||
}
|
||||
@@ -463,13 +545,21 @@ dependencies {
|
||||
annotationProcessor('org.ow2.asm:asm-debug-all:5.0.3')
|
||||
annotationProcessor('com.google.guava:guava:24.1.1-jre')
|
||||
annotationProcessor('com.google.code.gson:gson:2.8.6')
|
||||
annotationProcessor('com.gtnewhorizon:gtnhmixins:2.1.10:processor')
|
||||
annotationProcessor('com.gtnewhorizon:gtnhmixins:2.1.12:processor')
|
||||
if (usesMixinDebug.toBoolean()) {
|
||||
runtimeOnlyNonPublishable('org.jetbrains:intellij-fernflower:1.2.1.16')
|
||||
}
|
||||
}
|
||||
if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) {
|
||||
implementation('com.gtnewhorizon:gtnhmixins:2.1.10')
|
||||
implementation('com.gtnewhorizon:gtnhmixins:2.1.12')
|
||||
}
|
||||
}
|
||||
|
||||
pluginManager.withPlugin('org.jetbrains.kotlin.kapt') {
|
||||
if (usesMixins.toBoolean()) {
|
||||
dependencies {
|
||||
kapt('com.gtnewhorizon:gtnhmixins:2.1.12:processor')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -513,9 +603,11 @@ if (usesMixins.toBoolean()) {
|
||||
tasks.named("reobfJar", ReobfuscatedJar).configure {
|
||||
extraSrgFiles.from(mixinSrg)
|
||||
}
|
||||
}
|
||||
|
||||
if (usesMixins.toBoolean()) {
|
||||
tasks.named("processResources").configure {
|
||||
dependsOn("generateAssets")
|
||||
}
|
||||
|
||||
tasks.named("compileJava", JavaCompile).configure {
|
||||
doFirst {
|
||||
new File(mixinTmpDir).mkdirs()
|
||||
@@ -529,6 +621,25 @@ if (usesMixins.toBoolean()) {
|
||||
"-XDignore.symbol.file"
|
||||
]
|
||||
}
|
||||
|
||||
pluginManager.withPlugin('org.jetbrains.kotlin.kapt') {
|
||||
kapt {
|
||||
correctErrorTypes = true
|
||||
javacOptions {
|
||||
option("-AreobfSrgFile=${tasks.reobfJar.srg.get().asFile}")
|
||||
option("-AoutSrgFile=$mixinSrg")
|
||||
option("-AoutRefMapFile=$refMap")
|
||||
}
|
||||
}
|
||||
tasks.configureEach { task ->
|
||||
if (task.name == "kaptKotlin") {
|
||||
task.doFirst {
|
||||
new File(mixinTmpDir).mkdirs()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
tasks.named("processResources", ProcessResources).configure {
|
||||
@@ -547,9 +658,142 @@ tasks.named("processResources", ProcessResources).configure {
|
||||
|
||||
if (usesMixins.toBoolean()) {
|
||||
from refMap
|
||||
dependsOn("compileJava", "compileScala")
|
||||
}
|
||||
}
|
||||
|
||||
ext.java17Toolchain = (JavaToolchainSpec spec) -> {
|
||||
spec.languageVersion.set(JavaLanguageVersion.of(17))
|
||||
spec.vendor.set(JvmVendorSpec.matching("jetbrains"))
|
||||
}
|
||||
|
||||
ext.java17DependenciesCfg = configurations.create("java17Dependencies")
|
||||
ext.java17PatchDependenciesCfg = configurations.create("java17PatchDependencies")
|
||||
|
||||
dependencies {
|
||||
def lwjgl3ifyVersion = '1.1.21'
|
||||
def asmVersion = '9.4'
|
||||
if (modId != 'lwjgl3ify') {
|
||||
java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}")
|
||||
}
|
||||
if (modId != 'hodgepodge') {
|
||||
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.0.31')
|
||||
}
|
||||
|
||||
java17PatchDependencies('net.minecraft:launchwrapper:1.15') {transitive = false}
|
||||
java17PatchDependencies("org.ow2.asm:asm:${asmVersion}")
|
||||
java17PatchDependencies("org.ow2.asm:asm-commons:${asmVersion}")
|
||||
java17PatchDependencies("org.ow2.asm:asm-tree:${asmVersion}")
|
||||
java17PatchDependencies("org.ow2.asm:asm-analysis:${asmVersion}")
|
||||
java17PatchDependencies("org.ow2.asm:asm-util:${asmVersion}")
|
||||
java17PatchDependencies('org.ow2.asm:asm-deprecated:7.1')
|
||||
java17PatchDependencies("org.apache.commons:commons-lang3:3.12.0")
|
||||
java17PatchDependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}:forgePatches")
|
||||
}
|
||||
|
||||
ext.java17JvmArgs = [
|
||||
// Java 9+ support
|
||||
"--illegal-access=warn",
|
||||
"-Dfile.encoding=UTF-8",
|
||||
"-Djava.security.manager=allow",
|
||||
"--add-opens", "java.base/jdk.internal.loader=ALL-UNNAMED",
|
||||
"--add-opens", "java.base/java.net=ALL-UNNAMED",
|
||||
"--add-opens", "java.base/java.nio=ALL-UNNAMED",
|
||||
"--add-opens", "java.base/java.io=ALL-UNNAMED",
|
||||
"--add-opens", "java.base/java.lang=ALL-UNNAMED",
|
||||
"--add-opens", "java.base/java.lang.reflect=ALL-UNNAMED",
|
||||
"--add-opens", "java.base/java.text=ALL-UNNAMED",
|
||||
"--add-opens", "java.base/java.util=ALL-UNNAMED",
|
||||
"--add-opens", "java.base/jdk.internal.reflect=ALL-UNNAMED",
|
||||
"--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED",
|
||||
"--add-opens", "java.desktop/sun.awt.image=ALL-UNNAMED",
|
||||
"--add-modules", "jdk.dynalink",
|
||||
"--add-opens", "jdk.dynalink/jdk.dynalink.beans=ALL-UNNAMED",
|
||||
"--add-modules", "java.sql.rowset",
|
||||
"--add-opens", "java.sql.rowset/javax.sql.rowset.serial=ALL-UNNAMED"
|
||||
]
|
||||
|
||||
ext.hotswapJvmArgs = [
|
||||
// DCEVM advanced hot reload
|
||||
"-XX:+AllowEnhancedClassRedefinition",
|
||||
"-XX:HotswapAgent=fatjar"
|
||||
]
|
||||
|
||||
ext.setupHotswapAgentTask = tasks.register("setupHotswapAgent") {
|
||||
group = "GTNH Buildscript"
|
||||
description = "Installs a recent version of HotSwapAgent into the Java 17 JetBrains runtime directory"
|
||||
def hsaUrl = 'https://github.com/HotswapProjects/HotswapAgent/releases/download/1.4.2-SNAPSHOT/hotswap-agent-1.4.2-SNAPSHOT.jar'
|
||||
def targetFolderProvider = javaToolchains.launcherFor(java17Toolchain).map {it.metadata.installationPath.dir("lib/hotswap")}
|
||||
def targetFilename = "hotswap-agent.jar"
|
||||
onlyIf {
|
||||
!targetFolderProvider.get().file(targetFilename).asFile.exists()
|
||||
}
|
||||
doLast {
|
||||
def targetFolder = targetFolderProvider.get()
|
||||
targetFolder.asFile.mkdirs()
|
||||
download.run {
|
||||
src hsaUrl
|
||||
dest targetFolder.file(targetFilename).asFile
|
||||
overwrite false
|
||||
tempAndMove true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class RunHotswappableMinecraftTask extends RunMinecraftTask {
|
||||
// IntelliJ doesn't seem to allow commandline arguments so we also support an env variable
|
||||
private boolean enableHotswap = Boolean.valueOf(System.getenv("HOTSWAP"));
|
||||
|
||||
@Input
|
||||
public boolean getEnableHotswap() { return enableHotswap }
|
||||
@Option(option = "hotswap", description = "Enables HotSwapAgent for enhanced class reloading under a debugger")
|
||||
public boolean setEnableHotswap(boolean enable) { enableHotswap = enable }
|
||||
|
||||
@Inject
|
||||
public RunHotswappableMinecraftTask(Side side, String superTask) {
|
||||
super(side)
|
||||
|
||||
this.lwjglVersion = 3
|
||||
this.javaLauncher = project.javaToolchains.launcherFor(project.java17Toolchain)
|
||||
this.extraJvmArgs.addAll(project.java17JvmArgs)
|
||||
this.extraJvmArgs.addAll(project.provider(() -> enableHotswap ? project.hotswapJvmArgs : []))
|
||||
|
||||
this.classpath(project.java17PatchDependenciesCfg)
|
||||
if (side == Side.CLIENT) {
|
||||
this.classpath(project.minecraftTasks.lwjgl3Configuration)
|
||||
}
|
||||
// Use a raw provider instead of map to not create a dependency on the task
|
||||
this.classpath(project.provider(() -> project.tasks.named(superTask, RunMinecraftTask).get().classpath))
|
||||
this.classpath.filter { file ->
|
||||
!file.path.contains("2.9.4-nightly-20150209") // Remove lwjgl2
|
||||
}
|
||||
this.classpath(project.java17DependenciesCfg)
|
||||
|
||||
if (!(project.usesMixins.toBoolean() || project.forceEnableMixins.toBoolean())) {
|
||||
this.extraArgs.addAll("--tweakClass", "org.spongepowered.asm.launch.MixinTweaker")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
def runClient17Task = tasks.register("runClient17", RunHotswappableMinecraftTask, Side.CLIENT, "runClient")
|
||||
runClient17Task.configure {
|
||||
setup(project)
|
||||
group = "Modded Minecraft"
|
||||
description = "Runs the modded client using Java 17, lwjgl3ify and Hodgepodge"
|
||||
dependsOn(setupHotswapAgentTask, mcpTasks.launcherSources.classesTaskName, minecraftTasks.taskDownloadVanillaAssets, mcpTasks.taskPackagePatchedMc, 'jar')
|
||||
mainClass = "GradleStart"
|
||||
}
|
||||
|
||||
def runServer17Task = tasks.register("runServer17", RunHotswappableMinecraftTask, Side.SERVER, "runServer")
|
||||
runServer17Task.configure {
|
||||
setup(project)
|
||||
group = "Modded Minecraft"
|
||||
description = "Runs the modded server using Java 17, lwjgl3ify and Hodgepodge"
|
||||
dependsOn(setupHotswapAgentTask, mcpTasks.launcherSources.classesTaskName, minecraftTasks.taskDownloadVanillaAssets, mcpTasks.taskPackagePatchedMc, 'jar')
|
||||
mainClass = "GradleStartServer"
|
||||
extraArgs.add("nogui")
|
||||
}
|
||||
|
||||
def getManifestAttributes() {
|
||||
def manifestAttributes = [:]
|
||||
if (!containsMixinsAndOrCoreModOnly.toBoolean() && (usesMixins.toBoolean() || coreModClass)) {
|
||||
@@ -584,6 +828,7 @@ if (usesShadowedDependencies.toBoolean()) {
|
||||
tasks.register('relocateShadowJar', ConfigureShadowRelocation) {
|
||||
target = tasks.shadowJar
|
||||
prefix = modGroup + ".shadow"
|
||||
enabled = minimizeShadowedDependencies.toBoolean()
|
||||
}
|
||||
tasks.named("shadowJar", ShadowJar).configure {
|
||||
manifest {
|
||||
@@ -599,7 +844,9 @@ if (usesShadowedDependencies.toBoolean()) {
|
||||
project.configurations.shadeCompile
|
||||
]
|
||||
archiveClassifier.set('dev')
|
||||
dependsOn(relocateShadowJar)
|
||||
if (minimizeShadowedDependencies.toBoolean()) {
|
||||
dependsOn(relocateShadowJar)
|
||||
}
|
||||
}
|
||||
configurations.runtimeElements.outgoing.artifacts.clear()
|
||||
configurations.apiElements.outgoing.artifacts.clear()
|
||||
@@ -616,7 +863,7 @@ if (usesShadowedDependencies.toBoolean()) {
|
||||
javaComponent.withVariantsFromConfiguration(configurations.shadowRuntimeElements) {
|
||||
skip()
|
||||
}
|
||||
for (runTask in ["runClient", "runServer"]) {
|
||||
for (runTask in ["runClient", "runServer", "runClient17", "runServer17"]) {
|
||||
tasks.named(runTask).configure {
|
||||
dependsOn("shadowJar")
|
||||
}
|
||||
@@ -625,16 +872,6 @@ if (usesShadowedDependencies.toBoolean()) {
|
||||
ext.publishableDevJar = usesShadowedDependencies.toBoolean() ? tasks.shadowJar : tasks.jar
|
||||
ext.publishableObfJar = tasks.reobfJar
|
||||
|
||||
tasks.named('extractForgeUserdev', Copy).configure { efu ->
|
||||
doLast {
|
||||
// Fix CoFH-repackaged CCL not finding mappings
|
||||
project.copy {
|
||||
from(mcpTasks.userdevDir("conf"))
|
||||
into(new File(project.buildDir, "unpacked/conf"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register('apiJar', Jar) {
|
||||
from(sourceSets.main.allSource) {
|
||||
include modGroupPath + "/" + apiPackagePath + '/**'
|
||||
@@ -664,6 +901,7 @@ idea {
|
||||
module {
|
||||
downloadJavadoc = true
|
||||
downloadSources = true
|
||||
inheritOutputDirs = true
|
||||
}
|
||||
project {
|
||||
settings {
|
||||
@@ -674,6 +912,20 @@ idea {
|
||||
"2. Run Server"(Gradle) {
|
||||
taskNames = ["runServer"]
|
||||
}
|
||||
"1a. Run Client (Java 17)"(Gradle) {
|
||||
taskNames = ["runClient17"]
|
||||
}
|
||||
"2a. Run Server (Java 17)"(Gradle) {
|
||||
taskNames = ["runServer17"]
|
||||
}
|
||||
"1b. Run Client (Java 17, Hotswap)"(Gradle) {
|
||||
taskNames = ["runClient17"]
|
||||
envs = ["HOTSWAP": "true"]
|
||||
}
|
||||
"2b. Run Server (Java 17, Hotswap)"(Gradle) {
|
||||
taskNames = ["runServer17"]
|
||||
envs = ["HOTSWAP": "true"]
|
||||
}
|
||||
"3. Run Obfuscated Client"(Gradle) {
|
||||
taskNames = ["runObfClient"]
|
||||
}
|
||||
@@ -739,7 +991,7 @@ publishing {
|
||||
artifact apiJar
|
||||
}
|
||||
|
||||
groupId = System.getenv("ARTIFACT_GROUP_ID") ?: "com.github.GTNewHorizons"
|
||||
groupId = System.getenv("ARTIFACT_GROUP_ID") ?: project.group
|
||||
artifactId = System.getenv("ARTIFACT_ID") ?: project.name
|
||||
// Using the identified version, not project.version as it has the prepended 1.7.10
|
||||
version = System.getenv("RELEASE_VERSION") ?: identifiedVersion
|
||||
|
||||
@@ -288,6 +288,10 @@ public final class Config {
|
||||
public static int maxPhotovoltaicAdvancedOutputRF = 40;
|
||||
public static int maxPhotovoltaicVibrantOutputRF = 160;
|
||||
|
||||
public static int photovoltaicCellCapacityRF = 10000;
|
||||
public static int photovoltaicAdvancedCellCapacityRF = 10000;
|
||||
public static int photovoltaicVibrantCellCapacityRF = 10000;
|
||||
|
||||
public static int zombieGeneratorRfPerTick = 80;
|
||||
public static int zombieGeneratorTicksPerBucketFuel = 12000;
|
||||
|
||||
@@ -800,6 +804,33 @@ public final class Config {
|
||||
maxPhotovoltaicAdvancedOutputRF,
|
||||
"Maximum output in RF/t of the Advanced Photovoltaic Panels.")
|
||||
.getInt(maxPhotovoltaicAdvancedOutputRF);
|
||||
maxPhotovoltaicVibrantOutputRF = config
|
||||
.get(
|
||||
sectionPower.name,
|
||||
"maxPhotovoltaicVibrantOutputRF",
|
||||
maxPhotovoltaicVibrantOutputRF,
|
||||
"Maximum output in RF/t of the Vibrant Photovoltaic Panels.")
|
||||
.getInt(maxPhotovoltaicVibrantOutputRF);
|
||||
|
||||
photovoltaicCellCapacityRF = config.get(
|
||||
sectionPower.name,
|
||||
"photovoltaicCellCapacityRF",
|
||||
photovoltaicCellCapacityRF,
|
||||
"Maximum capacity in RF/t of the Photovoltaic Panels.").getInt(photovoltaicCellCapacityRF);
|
||||
photovoltaicAdvancedCellCapacityRF = config
|
||||
.get(
|
||||
sectionPower.name,
|
||||
"photovoltaicAdvancedCellCapacityRF",
|
||||
photovoltaicAdvancedCellCapacityRF,
|
||||
"Maximum capacity in RF/t of the Advanced Photovoltaic Panels.")
|
||||
.getInt(photovoltaicAdvancedCellCapacityRF);
|
||||
photovoltaicVibrantCellCapacityRF = config
|
||||
.get(
|
||||
sectionPower.name,
|
||||
"photovoltaicVibrantCellCapacityRF",
|
||||
photovoltaicVibrantCellCapacityRF,
|
||||
"Maximum capacity in RF/t of the Vibrant Photovoltaic Panels.")
|
||||
.getInt(photovoltaicVibrantCellCapacityRF);
|
||||
|
||||
useAlternateBinderRecipe = config
|
||||
.get(
|
||||
|
||||
@@ -54,7 +54,7 @@ public class TileSliceAndSplice extends AbstractPoweredTaskEntity {
|
||||
private static final BasicCapacitor CAP_FIVE = new BasicCapacitor(
|
||||
0,
|
||||
POWER_PER_TICK_FIVE * 2,
|
||||
Capacitors.ENDER_CAPACITOR.capacitor.getMaxEnergyStored(),
|
||||
Capacitors.MELODIC_CAPACITOR.capacitor.getMaxEnergyStored(),
|
||||
POWER_PER_TICK_FIVE);
|
||||
|
||||
public static final int POWER_PER_TICK_SIX = Config.sliceAndSpliceLevelSixPowerPerTickRF;
|
||||
@@ -135,13 +135,13 @@ public class TileSliceAndSplice extends AbstractPoweredTaskEntity {
|
||||
setCapacitor(CAP_SEVEN);
|
||||
break;
|
||||
case SILVER_CAPACITOR:
|
||||
setCapacitor(CAP_ONE);
|
||||
setCapacitor(CAP_EIGHT);
|
||||
break;
|
||||
case ENDERGETIC_CAPACITOR:
|
||||
setCapacitor(CAP_TWO);
|
||||
setCapacitor(CAP_NINE);
|
||||
break;
|
||||
case ENDERGISED_CAPACITOR:
|
||||
setCapacitor(CAP_THREE);
|
||||
setCapacitor(CAP_TEN);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -10,6 +10,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
import cofh.api.energy.EnergyStorage;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import crazypants.enderio.config.Config;
|
||||
|
||||
public class SolarPanelNetwork {
|
||||
|
||||
@@ -17,6 +18,7 @@ public class SolarPanelNetwork {
|
||||
private boolean empty = true;
|
||||
|
||||
private EnergyStorage energy;
|
||||
private boolean hasAppliedMaxEnergyConfig = false;
|
||||
|
||||
public static final int ENERGY_PER = 10000;
|
||||
|
||||
@@ -25,12 +27,13 @@ public class SolarPanelNetwork {
|
||||
|
||||
public SolarPanelNetwork() {
|
||||
panels = Lists.newArrayList();
|
||||
energy = new EnergyStorage(ENERGY_PER);
|
||||
energy = new EnergyStorage(getCapacity());
|
||||
}
|
||||
|
||||
SolarPanelNetwork(TileEntitySolarPanel initial) {
|
||||
this();
|
||||
panels.add(initial);
|
||||
energy.setCapacity(getCapacity(initial, 1));
|
||||
empty = false;
|
||||
}
|
||||
|
||||
@@ -83,8 +86,49 @@ public class SolarPanelNetwork {
|
||||
destroyNetwork();
|
||||
}
|
||||
|
||||
private int getCapacity() {
|
||||
int capacity = ENERGY_PER;
|
||||
|
||||
if (panels.size() > 0) {
|
||||
TileEntitySolarPanel masterPanel = getMaster();
|
||||
capacity = getCapacity(masterPanel, panels.size());
|
||||
}
|
||||
|
||||
return capacity;
|
||||
}
|
||||
|
||||
private int getCapacity(TileEntitySolarPanel panel, int panelsCount) {
|
||||
int capacity = ENERGY_PER;
|
||||
|
||||
if (panel != null && panel.hasWorldObj()) {
|
||||
int meta = panel.getBlockMetadata();
|
||||
switch (meta) {
|
||||
case 0: // Default
|
||||
capacity = Config.photovoltaicCellCapacityRF;
|
||||
break;
|
||||
case 1: // Advanced
|
||||
capacity = Config.photovoltaicAdvancedCellCapacityRF;
|
||||
break;
|
||||
case 2: // Vibrant
|
||||
capacity = Config.photovoltaicVibrantCellCapacityRF;
|
||||
break;
|
||||
}
|
||||
hasAppliedMaxEnergyConfig = true;
|
||||
}
|
||||
|
||||
capacity = capacity * panelsCount;
|
||||
|
||||
return capacity;
|
||||
}
|
||||
|
||||
private void updateEnergyIfNeeded() {
|
||||
if (!hasAppliedMaxEnergyConfig) {
|
||||
updateEnergy();
|
||||
}
|
||||
}
|
||||
|
||||
private void updateEnergy() {
|
||||
energy.setCapacity(ENERGY_PER * panels.size());
|
||||
energy.setCapacity(getCapacity());
|
||||
energy.setMaxExtract(energy.getMaxEnergyStored());
|
||||
}
|
||||
|
||||
@@ -119,6 +163,7 @@ public class SolarPanelNetwork {
|
||||
}
|
||||
|
||||
public int setEnergyStored(int energy) {
|
||||
updateEnergyIfNeeded();
|
||||
if (isValid()) {
|
||||
this.energy.setEnergyStored(energy);
|
||||
}
|
||||
|
||||
@@ -554,8 +554,8 @@ public class TravelController {
|
||||
return null;
|
||||
}
|
||||
ItemStack equipped = ep.getCurrentEquippedItem();
|
||||
if (equipped.getItem() instanceof ItemTravelStaff) {
|
||||
if (((ItemTravelStaff) equipped.getItem()).isActive(ep, equipped)) {
|
||||
if (equipped.getItem() instanceof ItemTeleportStaff) {
|
||||
if (((ItemTeleportStaff) equipped.getItem()).isActive(ep, equipped)) {
|
||||
return TravelSource.TELEPORT_STAFF;
|
||||
}
|
||||
} else if (equipped.getItem() instanceof IItemOfTravel) {
|
||||
|
||||
@@ -301,7 +301,7 @@ public class WailaCompat implements IWailaDataProvider {
|
||||
return;
|
||||
}
|
||||
|
||||
if (itemStack.getItem() == EnderIO.itemPowerConduit) {
|
||||
if (itemStack.getItem() == EnderIO.itemPowerConduit || itemStack.getItem() == EnderIO.itemPowerConduitEndergy) {
|
||||
NBTTagCompound nbtRoot = _accessor.getNBTData();
|
||||
if (nbtRoot.hasKey("storedEnergyRF")) {
|
||||
int stored = nbtRoot.getInteger("storedEnergyRF");
|
||||
|
||||
Reference in new issue
Block a user