Compare commits

...
12 Commits
Author SHA1 Message Date
miozune d32a8e88a3 Fix mouse wheel with lwjgl3 (#106)
* Fix mouse wheel with lwjgl3

* updateBuildScript, revert dependency change
2023-03-04 16:15:11 +01:00
Glease 447450d541 fix item conduit settings not sent to server (#103) 2023-03-02 12:08:53 +01:00
7f6a0a6a4c Fix existing item filter (#101)
* Update buildscript and dependencies

* Remove the extra conduit packet update that overrides some of the previous change packets

* spotlessApply (#102)

Co-authored-by: GitHub GTNH Actions <>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-03-01 06:32:43 +00:00
D-Cysteine 28df6fa938 Sync teleport staff config (#100) 2023-02-27 20:48:44 +01:00
Pilzinsel64 1728809a8a fix single solar cell max capacity (#99) 2023-02-17 22:00:12 +01:00
miozune 0edabd4a9d Fix energy stored in Slice'N'Splice with Melodic Capacitor (#98) 2023-02-16 16:53:10 +01:00
Pilzinsel64 b5752a8338 Fix NullReferenceException at getCapacity->getBlockMetadata (#97)
* fix NullReferenceException on getBlockMetadata

* oh no-no, please be static, it's your present! :)
2023-02-10 22:23:59 +01:00
Pilzinsel64 29b0d711f7 Solar Panels: Use config for capacity RF (#94)
* make Solar Energy configurable

* spotlessApply

* calc capacity also for single solar panels

* getCapacity(,) sanity check 'panel' against null
2023-02-08 21:01:19 +01:00
Pilzinsel64 e41827fb69 fix Waila tooltip for Endergy Energy Conduits (#95) 2023-02-08 21:01:10 +01:00
D-Cysteine 628af062ba Fix for getTravelItemTravelSource (#96)
This bug does not currently have any gameplay effect, because the return value of this method is not used to determine teleport range. But we should fix it anyway.
2023-02-08 11:42:03 +01:00
Pilzinsel64 09661218a3 Parse config val maxPhotovoltaicVibrantOutputRF (#93) 2023-02-03 20:16:34 +01:00
Raven Szewczyk e9f9412cab [ci skip] upgraded build system 2023-01-31 09:52:29 +00:00
17 changed files with 505 additions and 84 deletions

No files matched your search

-4
View File
@@ -18,9 +18,5 @@ end_of_line = crlf
[*.{dtd,json,info,mcmeta,md,sh,svg,xml,xsd,xsl,yaml,yml}]
indent_size = 2
[*.java]
indent_size = 2
ij_java_space_before_if_parentheses = false
[*.lang]
trim_trailing_whitespace = false
+384 -33
View File
@@ -1,4 +1,4 @@
//version: 1674943145
//version: 1677938302
/*
DO NOT CHANGE THIS FILE!
Also, you may replace this file at any time if there is an update available.
@@ -9,13 +9,18 @@
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.gradle.internal.xml.XmlTransformer
import org.jetbrains.gradle.ext.*
import java.nio.file.Files
@@ -23,10 +28,10 @@ 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 {
mavenLocal()
mavenCentral()
maven {
@@ -47,6 +52,8 @@ buildscript {
name 'Scala CI dependencies'
url 'https://repo1.maven.org/maven2/'
}
mavenLocal()
}
}
plugins {
@@ -55,9 +62,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 +73,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.2.2'
}
boolean settingsupdated = verifySettingsGradle()
settingsupdated = verifyGitAttributes() || settingsupdated
@@ -113,6 +120,7 @@ propertyDefaultIfUnset("modrinthRelations", "")
propertyDefaultIfUnset("curseForgeProjectId", "")
propertyDefaultIfUnset("curseForgeRelations", "")
propertyDefaultIfUnset("minimizeShadowedDependencies", true)
propertyDefaultIfUnset("relocateShadowedDependencies", true)
// Deprecated properties (kept for backwards compat)
propertyDefaultIfUnset("gradleTokenModId", "")
propertyDefaultIfUnset("gradleTokenModName", "")
@@ -121,6 +129,9 @@ propertyDefaultIfUnset("gradleTokenGroupName", "")
propertyDefaultIfUnset("enableModernJavaSyntax", false) // On by default for new projects only
propertyDefaultIfUnset("enableGenericInjection", false) // On by default for new projects only
// this is meant to be set using the user wide property file. by default we do nothing.
propertyDefaultIfUnset("ideaOverrideBuildType", "") // Can be nothing, "gradle" or "idea"
project.extensions.add(Blowdryer, "Blowdryer", Blowdryer) // Make blowdryer available in "apply from:" scripts
if (!disableSpotless) {
apply plugin: 'com.diffplug.spotless'
@@ -149,6 +160,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 +196,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 {
@@ -206,12 +254,33 @@ if (apiPackage) {
}
if (accessTransformersFile) {
String targetFile = "src/main/resources/META-INF/" + accessTransformersFile
if (!getFile(targetFile).exists()) {
throw new GradleException("Could not resolve \"accessTransformersFile\"! Could not find " + targetFile)
for (atFile in accessTransformersFile.split(",")) {
String targetFile = "src/main/resources/META-INF/" + atFile.trim()
if (!getFile(targetFile).exists()) {
throw new GradleException("Could not resolve \"accessTransformersFile\"! Could not find " + targetFile)
}
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")
}
tasks.deobfuscateMergedJarToSrg.accessTransformerFiles.from(targetFile)
tasks.srgifyBinpatchedJar.accessTransformerFiles.from(targetFile)
}
if (usesMixins.toBoolean()) {
@@ -290,7 +359,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 {
@@ -320,6 +389,10 @@ minecraft {
injectMissingGenerics.set(true)
}
username = developmentEnvironmentUserName.toString()
lwjgl3Version = "3.3.2-SNAPSHOT"
// Enable assertions in the current mod
extraRunJvmArguments.add("-ea:${modGroup}")
@@ -354,6 +427,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 +456,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
}
@@ -373,8 +466,9 @@ repositories.configureEach { repo ->
apply from: 'repositories.gradle'
configurations {
runtimeClasspath.extendsFrom(runtimeOnlyNonPublishable)
testRuntimeClasspath.extendsFrom(runtimeOnlyNonPublishable)
for (config in [compileClasspath, runtimeClasspath, testCompileClasspath, testRuntimeClasspath]) {
config.extendsFrom(runtimeOnlyNonPublishable)
if (usesShadowedDependencies.toBoolean()) {
config.extendsFrom(shadowImplementation)
// TODO: remove Compile after all uses are refactored to Implementation
@@ -427,6 +521,13 @@ repositories {
}
}
}
maven {
name 'sonatype'
url 'https://oss.sonatype.org/content/repositories/snapshots/'
content {
includeGroup "org.lwjgl"
}
}
if (includeWellKnownRepositories.toBoolean()) {
maven {
name "CurseMaven"
@@ -463,13 +564,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.13: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.13')
}
}
pluginManager.withPlugin('org.jetbrains.kotlin.kapt') {
if (usesMixins.toBoolean()) {
dependencies {
kapt('com.gtnewhorizon:gtnhmixins:2.1.13:processor')
}
}
}
@@ -513,9 +622,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 +640,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 +677,150 @@ 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") {
extendsFrom(configurations.getByName("runtimeClasspath")) // Ensure consistent transitive dependency resolution
canBeConsumed = false
}
ext.java17PatchDependenciesCfg = configurations.create("java17PatchDependencies") {
canBeConsumed = false
}
dependencies {
def lwjgl3ifyVersion = '1.1.35'
def asmVersion = '9.4'
if (modId != 'lwjgl3ify') {
java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}")
}
if (modId != 'hodgepodge') {
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.0.40')
}
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") {transitive = false}
}
ext.java17JvmArgs = [
// Java 9+ support
"--illegal-access=warn",
"-Djava.security.manager=allow",
"-Dfile.encoding=UTF-8",
"--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", "jdk.naming.dns/com.sun.jndi.dns=ALL-UNNAMED,java.naming",
"--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, org.gradle.api.invocation.Gradle gradle) {
super(side, gradle)
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"
username = minecraft.username
userUUID = minecraft.userUUID
}
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 +855,7 @@ if (usesShadowedDependencies.toBoolean()) {
tasks.register('relocateShadowJar', ConfigureShadowRelocation) {
target = tasks.shadowJar
prefix = modGroup + ".shadow"
enabled = relocateShadowedDependencies.toBoolean()
}
tasks.named("shadowJar", ShadowJar).configure {
manifest {
@@ -599,7 +871,9 @@ if (usesShadowedDependencies.toBoolean()) {
project.configurations.shadeCompile
]
archiveClassifier.set('dev')
dependsOn(relocateShadowJar)
if (relocateShadowedDependencies.toBoolean()) {
dependsOn(relocateShadowJar)
}
}
configurations.runtimeElements.outgoing.artifacts.clear()
configurations.apiElements.outgoing.artifacts.clear()
@@ -616,7 +890,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 +899,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,9 +928,23 @@ idea {
module {
downloadJavadoc = true
downloadSources = true
inheritOutputDirs = true
}
project {
settings {
if (ideaOverrideBuildType != "") {
delegateActions {
if ("gradle".equalsIgnoreCase(ideaOverrideBuildType)) {
delegateBuildRunToGradle = true
testRunner = org.jetbrains.gradle.ext.ActionDelegationConfig.TestRunner.GRADLE
} else if ("idea".equalsIgnoreCase(ideaOverrideBuildType)) {
delegateBuildRunToGradle = false
testRunner = org.jetbrains.gradle.ext.ActionDelegationConfig.TestRunner.PLATFORM
} else {
throw GradleScriptException('Accepted value for ideaOverrideBuildType is one of gradle or idea.')
}
}
}
runConfigurations {
"1. Run Client"(Gradle) {
taskNames = ["runClient"]
@@ -674,6 +952,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"]
}
@@ -691,7 +983,7 @@ idea {
}
"Run Client (IJ Native)"(Application) {
mainClass = "GradleStart"
moduleName = project.name + ".main"
moduleName = project.name + ".ideVirtualMain"
afterEvaluate {
workingDirectory = tasks.runClient.workingDir.absolutePath
programParameters = tasks.runClient.calculateArgs(project).collect { '"' + it + '"' }.join(' ')
@@ -702,7 +994,7 @@ idea {
}
"Run Server (IJ Native)"(Application) {
mainClass = "GradleStartServer"
moduleName = project.name + ".main"
moduleName = project.name + ".ideVirtualMain"
afterEvaluate {
workingDirectory = tasks.runServer.workingDir.absolutePath
programParameters = tasks.runServer.calculateArgs(project).collect { '"' + it + '"' }.join(' ')
@@ -719,6 +1011,51 @@ idea {
]
}
}
withIDEADir { File ideaDir ->
if (!ideaDir.path.contains(".idea")) {
// If an .ipr file exists, the project root directory is passed here instead of the .idea subdirectory
ideaDir = new File(ideaDir, ".idea")
}
if (ideaDir.isDirectory()) {
def miscFile = new File(ideaDir, "misc.xml")
if (miscFile.isFile()) {
boolean dirty = false
def miscTransformer = new XmlTransformer()
miscTransformer.addAction { root ->
Node rootNode = root.asNode()
def rootManager = rootNode
.component.find { it.@name == 'ProjectRootManager' }
if (!rootManager) {
rootManager = rootNode.appendNode('component', ['name': 'ProjectRootManager', 'version': '2'])
dirty = true
}
def output = rootManager.output
if (!output) {
output = rootManager.appendNode('output')
dirty = true
}
if (!output.@url) {
// Only modify the output url if it doesn't yet have one, or if the existing one is blank somehow.
// This is a sensible default for most setups
output.@url = 'file://$PROJECT_DIR$/build/ideaBuild'
dirty = true
}
}
def result = miscTransformer.transform(miscFile.text)
if (dirty) {
miscFile.write(result)
}
} else {
miscFile.text = """<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2">
<output url="file://\$PROJECT_DIR\$/out" />
</component>
</project>
"""
}
}
}
}
}
}
@@ -739,7 +1076,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
@@ -866,10 +1203,21 @@ def addCurseForgeRelation(String type, String name) {
}
// Updating
def buildscriptGradleVersion = "8.0.1"
tasks.named('wrapper', Wrapper).configure {
gradleVersion = buildscriptGradleVersion
}
tasks.register('updateBuildScript') {
group = 'GTNH Buildscript'
description = 'Updates the build script to the latest version'
if (gradle.gradleVersion != buildscriptGradleVersion && !Boolean.getBoolean('DISABLE_BUILDSCRIPT_GRADLE_UPDATE')) {
dependsOn('wrapper')
}
doLast {
if (performBuildScriptUpdate()) return
@@ -882,6 +1230,9 @@ if (!project.getGradle().startParameter.isOffline() && !Boolean.getBoolean('DISA
performBuildScriptUpdate()
} else {
out.style(Style.SuccessHeader).println("Build script update available! Run 'gradle updateBuildScript'")
if (gradle.gradleVersion != buildscriptGradleVersion) {
out.style(Style.SuccessHeader).println("updateBuildScript can update gradle from ${gradle.gradleVersion} to ${buildscriptGradleVersion}\n")
}
}
}
+9 -9
View File
@@ -1,20 +1,20 @@
// Add your dependencies here
dependencies {
compile('com.github.GTNewHorizons:EnderCore:0.2.9:dev')
compile('com.github.GTNewHorizons:ForestryMC:4.4.6:dev')
compile('com.github.GTNewHorizons:NotEnoughItems:2.3.7-GTNH:dev')
compile('com.github.GTNewHorizons:BuildCraft:7.1.27:dev')
compile('curse.maven:cofh-lib-220333:2388748') // https://www.curseforge.com/minecraft/mc-mods/cofh-lib/files/2388748
api('com.github.GTNewHorizons:EnderCore:0.2.13:dev')
implementation('com.github.GTNewHorizons:ForestryMC:4.5.8:dev')
implementation('com.github.GTNewHorizons:NotEnoughItems:2.3.35-GTNH:dev')
api('com.github.GTNewHorizons:BuildCraft:7.1.27:dev')
api('curse.maven:cofh-lib-220333:2388748') // https://www.curseforge.com/minecraft/mc-mods/cofh-lib/files/2388748
shadowImplementation('cglib:cglib-nodep:3.3.0')
compileOnly('com.github.GTNewHorizons:waila:1.5.19:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-85-GTNH:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:waila:1.5.23:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-168-GTNH:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:Baubles:1.0.1.14:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:Railcraft:9.13.6:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:StorageDrawers:1.11.13-GTNH:api') {transitive = false}
compile('com.github.GTNewHorizons:Chisel:2.10.8-GTNH:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:OpenComputers:1.7.5.25-GTNH:api') {transitive = false}
implementation('com.github.GTNewHorizons:Chisel:2.10.8-GTNH:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:OpenComputers:1.8.0.13-GTNH:api') {transitive = false}
compileOnly('curse.maven:minefactory-reloaded-66672:2366150') // https://www.curseforge.com/minecraft/mc-mods/minefactory-reloaded/files/2366150
compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
compileOnly('curse.maven:ee3-65509:2305023') // https://www.curseforge.com/minecraft/mc-mods/ee3/files/2305023
Binary file not shown.
+1 -1
View File
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Vendored
+2 -2
View File
@@ -144,7 +144,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
@@ -152,7 +152,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
-22
View File
@@ -1,26 +1,4 @@
// Add any additional repositories for your dependencies here
repositories {
maven {
name 'GTNH Maven'
url 'http://jenkins.usrv.eu:8081/nexus/content/groups/public/'
allowInsecureProtocol
}
maven {
name 'ic2'
url 'http://maven.ic2.player.to/'
metadataSources {
mavenPom()
artifact()
}
}
maven {
url 'https://cursemaven.com'
content {
includeGroup 'curse.maven'
}
}
maven {
url = 'https://jitpack.io'
}
}
@@ -206,6 +206,8 @@ public class EnderIO {
public static final Lang lang = new Lang("enderio");
public static final boolean hasLwjgl3 = Loader.isModLoaded("lwjgl3ify");
// Materials
public static ItemCapacitor itemBasicCapacitor;
public static ItemAlloy itemAlloy;
@@ -213,9 +213,11 @@ public class ItemSettings extends BaseSettingsPanel {
} else if (guiButton.id == ID_EXTRACT_CHANNEL) {
DyeColor col = DyeColor.fromIndex(extractChannelB.getColorIndex());
itemConduit.setInputColor(gui.getDir(), col);
} else {
if (insertFilterGui != null) insertFilterGui.actionPerformed(guiButton);
if (extractFilterGui != null) extractFilterGui.actionPerformed(guiButton);
return;
}
if (insertFilterGui != null) insertFilterGui.actionPerformed(guiButton);
if (extractFilterGui != null) extractFilterGui.actionPerformed(guiButton);
PacketHandler.INSTANCE.sendToServer(new PacketItemConduitFilter(itemConduit, gui.getDir()));
}
@@ -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(
@@ -22,6 +22,9 @@ public class PacketConfigSync implements IMessage, IMessageHandler<PacketConfigS
buf.writeInt(Config.travelStaffMaxDistance);
buf.writeInt(Config.travelStaffMaxBlinkDistance);
buf.writeFloat(Config.travelStaffPowerPerBlockRF);
buf.writeInt(Config.teleportStaffMaxDistance);
buf.writeInt(Config.teleportStaffMaxBlinkDistance);
buf.writeInt(Config.teleportStaffFailedBlinkDistance);
buf.writeBoolean(Config.telepadLockCoords);
buf.writeBoolean(Config.telepadLockDimension);
}
@@ -38,6 +41,9 @@ public class PacketConfigSync implements IMessage, IMessageHandler<PacketConfigS
Config.travelStaffMaxDistance = data.readInt();
Config.travelStaffMaxBlinkDistance = data.readInt();
Config.travelStaffPowerPerBlockRF = data.readFloat();
Config.teleportStaffMaxDistance = data.readInt();
Config.teleportStaffMaxBlinkDistance = data.readInt();
Config.teleportStaffFailedBlinkDistance = data.readInt();
Config.telepadLockCoords = data.readBoolean();
Config.telepadLockDimension = data.readBoolean();
}
@@ -17,6 +17,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
@@ -180,7 +181,11 @@ public class GuiEnderface extends GuiScreen {
}
}
distance -= Mouse.getDWheel() * 0.01;
int wheelD = Mouse.getEventDWheel();
if (!EnderIO.hasLwjgl3) {
wheelD = MathHelper.clamp_int(wheelD, -1, 1);
}
distance -= wheelD;
distance = VecmathUtil.clamp(distance, 0.1, 20);
long elapsed = EnderIO.proxy.getTickCount() - initTime;
@@ -17,6 +17,7 @@ import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import net.minecraft.init.Blocks;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
@@ -156,7 +157,11 @@ public class IoConfigRenderer {
}
}
distance -= Mouse.getEventDWheel() * 0.01;
int wheelD = Mouse.getEventDWheel();
if (!EnderIO.hasLwjgl3) {
wheelD = MathHelper.clamp_int(wheelD, -1, 1);
}
distance -= wheelD;
distance = VecmathUtil.clamp(distance, 0.01, 200);
long elapsed = System.currentTimeMillis() - initTime;
@@ -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");