From 91d1b47194a46aa8012deb2644a0132938d77bed Mon Sep 17 00:00:00 2001 From: Pilzinsel64 Date: Mon, 1 May 2023 12:27:06 +0200 Subject: [PATCH] migrate to up-to-date build system --- .editorconfig | 22 + .gitattributes | 44 + .github/scripts/update_version | 12 + .github/workflows/build-and-test.yml | 13 + .github/workflows/release-tags.yml | 14 + .gitignore | 48 +- CODEOWNERS | 3 + build.gradle | 1482 ++++++++++++++++- dependencies.gradle | 39 + gradle.properties | 143 ++ gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 61608 bytes gradle/wrapper/gradle-wrapper.properties | 6 + gradlew | 244 +++ gradlew.bat | 92 + jitpack.yml | 2 + repositories.gradle | 5 + settings.gradle | 28 + src/api/java/buildcraft/LICENSE | 21 - .../buildcraft/api/tools/IToolPipette.java | 48 - .../buildcraft/api/tools/IToolWrench.java | 40 - .../buildcraft/api/tools/package-info.java | 3 - src/api/java/cofh/api/CoFHAPIProps.java | 11 - .../java/cofh/api/energy/EnergyStorage.java | 158 -- .../cofh/api/energy/IEnergyConnection.java | 21 - .../cofh/api/energy/IEnergyContainerItem.java | 52 - .../java/cofh/api/energy/IEnergyHandler.java | 58 - .../java/cofh/api/energy/IEnergyProvider.java | 38 - .../java/cofh/api/energy/IEnergyReceiver.java | 38 - .../java/cofh/api/energy/IEnergyStorage.java | 46 - .../cofh/api/energy/ItemEnergyContainer.java | 110 -- .../cofh/api/energy/TileEnergyHandler.java | 65 - .../java/cofh/api/energy/package-info.java | 10 - src/api/java/cofh/api/package-info.java | 9 - .../com/piepenguin/rfwindmill/RFWindmill.java | 1 + .../blocks/ItemBlockWindmillBlock.java | 2 +- .../rfwindmill/blocks/ModBlocks.java | 3 +- .../rfwindmill/blocks/RotorBlock.java | 99 +- .../rfwindmill/blocks/WindmillBlock.java | 138 +- .../piepenguin/rfwindmill/items/ModItems.java | 6 +- .../piepenguin/rfwindmill/items/RFWItem.java | 6 +- .../piepenguin/rfwindmill/lib/Constants.java | 1 + .../rfwindmill/lib/EnergyPacket.java | 30 +- .../rfwindmill/lib/EnergyStorage.java | 28 +- .../com/piepenguin/rfwindmill/lib/Lang.java | 1 + .../rfwindmill/lib/ModConfiguration.java | 146 +- .../com/piepenguin/rfwindmill/lib/Util.java | 62 +- .../rfwindmill/proxy/ClientProxy.java | 1 + .../rfwindmill/proxy/CommonProxy.java | 1 + .../rfwindmill/recipes/ModRecipes.java | 273 ++- .../RenderTileEntityRotorBlock.java | 29 +- .../tileentities/TileEntityRotorBlock.java | 34 +- .../tileentities/TileEntityWindmillBlock.java | 142 +- src/main/resources/mcmod.info | 34 +- 53 files changed, 2789 insertions(+), 1173 deletions(-) create mode 100644 .editorconfig create mode 100644 .gitattributes create mode 100644 .github/scripts/update_version create mode 100644 .github/workflows/build-and-test.yml create mode 100644 .github/workflows/release-tags.yml create mode 100644 CODEOWNERS create mode 100644 dependencies.gradle create mode 100644 gradle.properties create mode 100644 gradle/wrapper/gradle-wrapper.jar create mode 100644 gradle/wrapper/gradle-wrapper.properties create mode 100644 gradlew create mode 100644 gradlew.bat create mode 100644 jitpack.yml create mode 100644 repositories.gradle create mode 100644 settings.gradle delete mode 100644 src/api/java/buildcraft/LICENSE delete mode 100644 src/api/java/buildcraft/api/tools/IToolPipette.java delete mode 100644 src/api/java/buildcraft/api/tools/IToolWrench.java delete mode 100644 src/api/java/buildcraft/api/tools/package-info.java delete mode 100644 src/api/java/cofh/api/CoFHAPIProps.java delete mode 100644 src/api/java/cofh/api/energy/EnergyStorage.java delete mode 100644 src/api/java/cofh/api/energy/IEnergyConnection.java delete mode 100644 src/api/java/cofh/api/energy/IEnergyContainerItem.java delete mode 100644 src/api/java/cofh/api/energy/IEnergyHandler.java delete mode 100644 src/api/java/cofh/api/energy/IEnergyProvider.java delete mode 100644 src/api/java/cofh/api/energy/IEnergyReceiver.java delete mode 100644 src/api/java/cofh/api/energy/IEnergyStorage.java delete mode 100644 src/api/java/cofh/api/energy/ItemEnergyContainer.java delete mode 100644 src/api/java/cofh/api/energy/TileEnergyHandler.java delete mode 100644 src/api/java/cofh/api/energy/package-info.java delete mode 100644 src/api/java/cofh/api/package-info.java diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..4ffbd90 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,22 @@ +# This is the universal Text Editor Configuration +# for all GTNewHorizons projects +# See: https://editorconfig.org/ + +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 4 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true + +[*.{bat,ini}] +end_of_line = crlf + +[*.{dtd,json,info,mcmeta,md,sh,svg,xml,xsd,xsl,yaml,yml}] +indent_size = 2 + +[*.lang] +trim_trailing_whitespace = false diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..fd2792b --- /dev/null +++ b/.gitattributes @@ -0,0 +1,44 @@ +* text eol=lf + +*.[jJ][aA][rR] binary + +*.[pP][nN][gG] binary +*.[jJ][pP][gG] binary +*.[jJ][pP][eE][gG] binary +*.[gG][iI][fF] binary +*.[tT][iI][fF] binary +*.[tT][iI][fF][fF] binary +*.[iI][cC][oO] binary +*.[sS][vV][gG] text +*.[eE][pP][sS] binary +*.[xX][cC][fF] binary + +*.[kK][aA][rR] binary +*.[mM]4[aA] binary +*.[mM][iI][dD] binary +*.[mM][iI][dD][iI] binary +*.[mM][pP]3 binary +*.[oO][gG][gG] binary +*.[rR][aA] binary + +*.7[zZ] binary +*.[gG][zZ] binary +*.[tT][aA][rR] binary +*.[tT][gG][zZ] binary +*.[zZ][iI][pP] binary + +*.[tT][cC][nN] binary +*.[sS][oO] binary +*.[dD][lL][lL] binary +*.[dD][yY][lL][iI][bB] binary +*.[pP][sS][dD] binary +*.[tT][tT][fF] binary +*.[oO][tT][fF] binary + +*.[pP][aA][tT][cC][hH] -text + +*.[bB][aA][tT] text eol=crlf +*.[cC][mM][dD] text eol=crlf +*.[pP][sS]1 text eol=crlf + +*[aA][uU][tT][oO][gG][eE][nN][eE][rR][aA][tT][eE][dD]* binary diff --git a/.github/scripts/update_version b/.github/scripts/update_version new file mode 100644 index 0000000..3e5f752 --- /dev/null +++ b/.github/scripts/update_version @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +if ! git diff --name-only HEAD HEAD~1 | grep -qF 'build.gradle'; then + new_version="$(date +%s)" + sed --in-place "s!^//version:.*!//version: $new_version!g" build.gradle + git add build.gradle + git commit -m "[ci skip] update build script version to $new_version" + git push + printf 'Updated buildscript version to %s\n' "$new_version" +else + printf 'Ignored buildscript version update: no changes detected\n' +fi diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml new file mode 100644 index 0000000..3ee2f68 --- /dev/null +++ b/.github/workflows/build-and-test.yml @@ -0,0 +1,13 @@ + +name: Build and test + +on: + pull_request: + branches: [ master, main ] + push: + branches: [ master, main ] + +jobs: + build-and-test: + uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/build-and-test.yml@master + secrets: inherit diff --git a/.github/workflows/release-tags.yml b/.github/workflows/release-tags.yml new file mode 100644 index 0000000..e4c0be6 --- /dev/null +++ b/.github/workflows/release-tags.yml @@ -0,0 +1,14 @@ + +name: Release tagged build + +on: + push: + tags: [ '*' ] + +permissions: + contents: write + +jobs: + release-tags: + uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/release-tags.yml@master + secrets: inherit diff --git a/.gitignore b/.gitignore index fc09aee..34ac734 100644 --- a/.gitignore +++ b/.gitignore @@ -1,26 +1,32 @@ -# Mac -.DS_Store - -# Gradle -gradle -gradlew -gradlew.bat .gradle - -# Build -/bin/ -/build/ +.settings +/.idea/ +/.vscode/ /run/ - -# Eclipse -eclipse +/build/ +/eclipse/ .classpath .project -.settings/ -.checkstyle - -# IntelliJ -.idea/ -*.ipr +/bin/ +/config/ +/crash-reports/ +/logs/ +options.txt +/saves/ +usernamecache.json +banned-ips.json +banned-players.json +eula.txt +ops.json +server.properties +servers.dat +usercache.json +whitelist.json +/out/ *.iml -*.iws \ No newline at end of file +*.ipr +*.iws +src/main/resources/mixins.*([!.]).json +*.bat +*.DS_Store +!gradlew.bat diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000..a6b5f68 --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1,3 @@ +# Any Github changes require admin approval +/.github/** @GTNewHorizons/admin + diff --git a/build.gradle b/build.gradle index 0d7c48f..17e7501 100644 --- a/build.gradle +++ b/build.gradle @@ -1,67 +1,1477 @@ +//version: 1682616243 +/* + DO NOT CHANGE THIS FILE! + Also, you may replace this file at any time if there is an update available. + Please check https://github.com/GTNewHorizons/ExampleMod1.7.10/blob/master/build.gradle for updates. + */ + + +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.gtnewhorizons.retrofuturagradle.util.Distribution +import com.matthewprenger.cursegradle.CurseArtifact +import com.matthewprenger.cursegradle.CurseRelation +import com.modrinth.minotaur.dependencies.ModDependency +import com.modrinth.minotaur.dependencies.VersionDependency +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.Application +import org.jetbrains.gradle.ext.Gradle + +import javax.inject.Inject +import java.nio.file.Files +import java.nio.file.Paths +import java.util.concurrent.TimeUnit + buildscript { repositories { mavenCentral() + + maven { + name 'forge' + url 'https://maven.minecraftforge.net' + } maven { - name = "forge" - url = "http://files.minecraftforge.net/maven" + // GTNH RetroFuturaGradle and ASM Fork + name "GTNH Maven" + url "http://jenkins.usrv.eu:8081/nexus/content/groups/public/" + allowInsecureProtocol = true } maven { - name = "sonatype" - url = "https://oss.sonatype.org/content/repositories/snapshots/" + name 'sonatype' + url 'https://oss.sonatype.org/content/repositories/snapshots/' + } + maven { + name 'Scala CI dependencies' + url 'https://repo1.maven.org/maven2/' + } + + mavenLocal() + } +} +plugins { + id 'java-library' + id "org.jetbrains.gradle.plugin.idea-ext" version "1.1.7" + id 'eclipse' + id 'scala' + id 'maven-publish' + 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 '8.1.1' apply false + id 'com.palantir.git-version' version '3.0.0' apply false + id 'de.undercouch.download' version '5.4.0' + id 'com.github.gmazzo.buildconfig' version '3.1.0' apply false // Unused, available for addon.gradle + id 'com.diffplug.spotless' version '6.13.0' apply false // 6.13.0 is the last jvm8 supporting version + id 'com.modrinth.minotaur' version '2.+' apply false + id 'com.matthewprenger.cursegradle' version '1.4.0' apply false + id 'com.gtnewhorizons.retrofuturagradle' version '1.3.7' +} +boolean settingsupdated = verifySettingsGradle() +settingsupdated = verifyGitAttributes() || settingsupdated +if (settingsupdated) + throw new GradleException("Settings has been updated, please re-run task.") + +// In submodules, .git is a file pointing to the real git dir +if (project.file('.git/HEAD').isFile() || project.file('.git').isFile()) { + apply plugin: 'com.palantir.git-version' +} + +def out = services.get(StyledTextOutputFactory).create('an-output') + +def projectJavaVersion = JavaLanguageVersion.of(8) + +boolean disableSpotless = project.hasProperty("disableSpotless") ? project.disableSpotless.toBoolean() : false + +checkPropertyExists("modName") +checkPropertyExists("modId") +checkPropertyExists("modGroup") +checkPropertyExists("autoUpdateBuildScript") +checkPropertyExists("minecraftVersion") +checkPropertyExists("forgeVersion") +checkPropertyExists("replaceGradleTokenInFile") +checkPropertyExists("gradleTokenVersion") +checkPropertyExists("apiPackage") +checkPropertyExists("accessTransformersFile") +checkPropertyExists("usesMixins") +checkPropertyExists("mixinPlugin") +checkPropertyExists("mixinsPackage") +checkPropertyExists("coreModClass") +checkPropertyExists("containsMixinsAndOrCoreModOnly") +checkPropertyExists("usesShadowedDependencies") +checkPropertyExists("developmentEnvironmentUserName") + +propertyDefaultIfUnset("generateGradleTokenClass", "") +propertyDefaultIfUnset("includeWellKnownRepositories", true) +propertyDefaultIfUnset("noPublishedSources", false) +propertyDefaultIfUnset("usesMixinDebug", project.usesMixins) +propertyDefaultIfUnset("forceEnableMixins", false) +propertyDefaultIfUnset("channel", "stable") +propertyDefaultIfUnset("mappingsVersion", "12") +propertyDefaultIfUnset("modrinthProjectId", "") +propertyDefaultIfUnset("modrinthRelations", "") +propertyDefaultIfUnset("curseForgeProjectId", "") +propertyDefaultIfUnset("curseForgeRelations", "") +propertyDefaultIfUnset("minimizeShadowedDependencies", true) +propertyDefaultIfUnset("relocateShadowedDependencies", true) +// Deprecated properties (kept for backwards compat) +propertyDefaultIfUnset("gradleTokenModId", "") +propertyDefaultIfUnset("gradleTokenModName", "") +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(com.diffplug.blowdryer.Blowdryer, "Blowdryer", com.diffplug.blowdryer.Blowdryer) // Make blowdryer available in "apply from:" scripts +if (!disableSpotless) { + apply plugin: 'com.diffplug.spotless' + apply from: Blowdryer.file('spotless.gradle') +} + +String javaSourceDir = "src/main/java/" +String scalaSourceDir = "src/main/scala/" +String kotlinSourceDir = "src/main/kotlin/" + +if (usesShadowedDependencies.toBoolean()) { + apply plugin: "com.github.johnrengelman.shadow" +} + +java { + toolchain { + if (enableModernJavaSyntax.toBoolean()) { + languageVersion.set(JavaLanguageVersion.of(17)) + } else { + languageVersion.set(projectJavaVersion) + } + vendor.set(JvmVendorSpec.AZUL) + } + if (!noPublishedSources) { + withSourcesJar() + } +} + +tasks.withType(JavaCompile).configureEach { + options.encoding = "UTF-8" +} + +tasks.withType(ScalaCompile).configureEach { + options.encoding = "UTF-8" +} + +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" + canBeConsumed = false + canBeResolved = false + } + + 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) +} + +if (enableModernJavaSyntax.toBoolean()) { + repositories { + mavenCentral { + mavenContent { + includeGroup("me.eigenraven.java8unsupported") + } } } + dependencies { - classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT' + 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 { + if (it.name in ["compileMcLauncherJava", "compilePatchedMcJava"]) { + return + } + sourceCompatibility = 17 // for the IDE support + options.release.set(8) + + javaCompiler.set(javaToolchains.compilerFor { + languageVersion.set(JavaLanguageVersion.of(17)) + vendor.set(JvmVendorSpec.AZUL) + }) } } -apply plugin: 'forge' +eclipse { + classpath { + downloadSources = true + downloadJavadoc = true + } +} + +final String modGroupPath = modGroup.toString().replace('.' as char, '/' as char) +final String apiPackagePath = apiPackage.toString().replace('.' as char, '/' as char) + +String targetPackageJava = javaSourceDir + modGroupPath +String targetPackageScala = scalaSourceDir + modGroupPath +String targetPackageKotlin = kotlinSourceDir + modGroupPath +if (!(getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists() || getFile(targetPackageKotlin).exists())) { + throw new GradleException("Could not resolve \"modGroup\"! Could not find " + targetPackageJava + " or " + targetPackageScala + " or " + targetPackageKotlin) +} + +if (apiPackage) { + targetPackageJava = javaSourceDir + modGroupPath + "/" + apiPackagePath + targetPackageScala = scalaSourceDir + modGroupPath + "/" + apiPackagePath + targetPackageKotlin = kotlinSourceDir + modGroupPath + "/" + apiPackagePath + if (!(getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists() || getFile(targetPackageKotlin).exists())) { + throw new GradleException("Could not resolve \"apiPackage\"! Could not find " + targetPackageJava + " or " + targetPackageScala + " or " + targetPackageKotlin) + } +} + +if (accessTransformersFile) { + 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") + } +} + +if (usesMixins.toBoolean()) { + if (mixinsPackage.isEmpty()) { + throw new GradleException("\"usesMixins\" requires \"mixinsPackage\" to be set!") + } + final String mixinPackagePath = mixinsPackage.toString().replaceAll("\\.", "/") + final String mixinPluginPath = mixinPlugin.toString().replaceAll("\\.", "/") + + targetPackageJava = javaSourceDir + modGroupPath + "/" + mixinPackagePath + targetPackageScala = scalaSourceDir + modGroupPath + "/" + mixinPackagePath + targetPackageKotlin = kotlinSourceDir + modGroupPath + "/" + mixinPackagePath + if (!(getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists() || getFile(targetPackageKotlin).exists())) { + throw new GradleException("Could not resolve \"mixinsPackage\"! Could not find " + targetPackageJava + " or " + targetPackageScala + " or " + targetPackageKotlin) + } + + if (!mixinPlugin.isEmpty()) { + String targetFileJava = javaSourceDir + modGroupPath + "/" + mixinPluginPath + ".java" + String targetFileScala = scalaSourceDir + modGroupPath + "/" + mixinPluginPath + ".scala" + String targetFileScalaJava = scalaSourceDir + modGroupPath + "/" + mixinPluginPath + ".java" + String targetFileKotlin = kotlinSourceDir + modGroupPath + "/" + mixinPluginPath + ".kt" + if (!(getFile(targetFileJava).exists() || getFile(targetFileScala).exists() || getFile(targetFileScalaJava).exists() || getFile(targetFileKotlin).exists())) { + throw new GradleException("Could not resolve \"mixinPlugin\"! Could not find " + targetFileJava + " or " + targetFileScala + " or " + targetFileScalaJava + " or " + targetFileKotlin) + } + } +} + +if (coreModClass) { + final String coreModPath = coreModClass.toString().replaceAll("\\.", "/") + String targetFileJava = javaSourceDir + modGroupPath + "/" + coreModPath + ".java" + String targetFileScala = scalaSourceDir + modGroupPath + "/" + coreModPath + ".scala" + String targetFileScalaJava = scalaSourceDir + modGroupPath + "/" + coreModPath + ".java" + String targetFileKotlin = kotlinSourceDir + modGroupPath + "/" + coreModPath + ".kt" + if (!(getFile(targetFileJava).exists() || getFile(targetFileScala).exists() || getFile(targetFileScalaJava).exists() || getFile(targetFileKotlin).exists())) { + throw new GradleException("Could not resolve \"coreModClass\"! Could not find " + targetFileJava + " or " + targetFileScala + " or " + targetFileScalaJava + " or " + targetFileKotlin) + } +} + +configurations.configureEach { + resolutionStrategy.cacheChangingModulesFor(0, TimeUnit.SECONDS) + + // Make sure GregTech build won't time out + System.setProperty("org.gradle.internal.http.connectionTimeout", 120000 as String) + System.setProperty("org.gradle.internal.http.socketTimeout", 120000 as String) +} + +// Fix Jenkins' Git: chmod a file should not be detected as a change and append a '.dirty' to the version +try { + 'git config core.fileMode false'.execute() +} +catch (Exception ignored) { + out.style(Style.Failure).println("git isn't installed at all") +} + +// Pulls version first from the VERSION env and then git tag +String identifiedVersion +String versionOverride = System.getenv("VERSION") ?: null +try { + identifiedVersion = versionOverride == null ? gitVersion() : versionOverride +} +catch (Exception ignored) { + out.style(Style.Failure).text( + 'This mod must be version controlled by Git AND the repository must provide at least one tag,\n' + + 'or the VERSION override must be set! ').style(Style.SuccessHeader).text('(Do NOT download from GitHub using the ZIP option, instead\n' + + 'clone the repository, see ').style(Style.Info).text('https://gtnh.miraheze.org/wiki/Development').style(Style.SuccessHeader).println(' for details.)' + ) + versionOverride = 'NO-GIT-TAG-SET' + identifiedVersion = versionOverride +} +version = identifiedVersion +ext { + modVersion = identifiedVersion +} + +if (identifiedVersion == versionOverride) { + out.style(Style.Failure).text('Override version to ').style(Style.Identifier).text(modVersion).style(Style.Failure).println('!\7') +} + +group = "com.github.GTNewHorizons" +if (project.hasProperty("customArchiveBaseName") && customArchiveBaseName) { + archivesBaseName = customArchiveBaseName +} else { + archivesBaseName = modId +} -version = "1.7.10-0.7c" -group= "com.piepenguin.rfwindmill" // http://maven.apache.org/guides/mini/guide-naming-conventions.html -archivesBaseName = "rfwindmill" minecraft { - version = "1.7.10-10.13.2.1291" - runDir = "eclipse" + if (replaceGradleTokenInFile) { + for (f in replaceGradleTokenInFile.split(',')) { + tagReplacementFiles.add f + } + } + if (gradleTokenModId) { + injectedTags.put gradleTokenModId, modId + } + if (gradleTokenModName) { + injectedTags.put gradleTokenModName, modName + } + if (gradleTokenVersion) { + injectedTags.put gradleTokenVersion, modVersion + } + if (gradleTokenGroupName) { + injectedTags.put gradleTokenGroupName, modGroup + } + if (enableGenericInjection.toBoolean()) { + injectMissingGenerics.set(true) + } + + username = developmentEnvironmentUserName.toString() + + lwjgl3Version = "3.3.2" + + // Enable assertions in the current mod + extraRunJvmArguments.add("-ea:${modGroup}") + + if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) { + if (usesMixinDebug.toBoolean()) { + extraRunJvmArguments.addAll([ + "-Dmixin.debug.countInjections=true", + "-Dmixin.debug.verbose=true", + "-Dmixin.debug.export=true" + ]) + } + } + + // Blowdryer is present in some old mod builds, do not propagate it further as a dependency + // IC2 has no reobf jars in its Maven + groupsToExcludeFromAutoReobfMapping.addAll(["com.diffplug", "com.diffplug.durian", "net.industrial-craft"]) } +if (generateGradleTokenClass) { + tasks.injectTags.outputClassName.set(generateGradleTokenClass) +} + +// Custom reobf auto-mappings +configurations.configureEach { + dependencies.configureEach { dep -> + if (dep instanceof org.gradle.api.artifacts.ExternalModuleDependency) { + if (dep.group == "net.industrial-craft" && dep.name == "industrialcraft-2") { + // https://www.curseforge.com/minecraft/mc-mods/industrial-craft/files/2353971 + project.dependencies.reobfJarConfiguration("curse.maven:ic2-242638:2353971") + } + } + } + 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()) { + apply from: 'addon.gradle' +} + +// Allow unsafe repos but warn +repositories.configureEach { repo -> + if (repo instanceof org.gradle.api.artifacts.repositories.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 + } + } +} + +apply from: 'repositories.gradle' + +configurations { + runtimeClasspath.extendsFrom(runtimeOnlyNonPublishable) + testRuntimeClasspath.extendsFrom(runtimeOnlyNonPublishable) + for (config in [compileClasspath, runtimeClasspath, testCompileClasspath, testRuntimeClasspath]) { + if (usesShadowedDependencies.toBoolean()) { + config.extendsFrom(shadowImplementation) + // TODO: remove Compile after all uses are refactored to Implementation + config.extendsFrom(shadeCompile) + config.extendsFrom(shadowCompile) + } + } + // A "bag-of-dependencies"-style configuration for backwards compatibility, gets put in "api" + create("compile") { + description = "Deprecated: use api or implementation instead, gets put in api" + canBeConsumed = false + canBeResolved = false + visible = false + } + create("testCompile") { + description = "Deprecated: use testImplementation instead" + canBeConsumed = false + canBeResolved = false + visible = false + } + api.extendsFrom(compile) + testImplementation.extendsFrom(testCompile) +} + +afterEvaluate { + if (!configurations.compile.allDependencies.empty || !configurations.testCompile.allDependencies.empty) { + logger.warn("This project uses deprecated `compile` dependencies, please migrate to using `api` and `implementation`") + logger.warn("For more details, see https://github.com/GTNewHorizons/ExampleMod1.7.10/blob/master/dependencies.gradle") + } +} + +repositories { + maven { + name 'Overmind forge repo mirror' + url 'https://gregtech.overminddl1.com/' + mavenContent { + excludeGroup("net.minecraftforge") // missing the `universal` artefact + } + } + maven { + name = "GTNH Maven" + url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/" + allowInsecureProtocol = true + } + maven { + name 'sonatype' + url 'https://oss.sonatype.org/content/repositories/snapshots/' + content { + includeGroup "org.lwjgl" + } + } + if (includeWellKnownRepositories.toBoolean()) { + maven { + name "CurseMaven" + url "https://cursemaven.com" + content { + includeGroup "curse.maven" + } + } + maven { + name = "ic2" + url = "https://maven.ic2.player.to/" + metadataSources { + mavenPom() + artifact() + } + } + maven { + name = "ic2-mirror" + url = "https://maven2.ic2.player.to/" + metadataSources { + mavenPom() + artifact() + } + } + maven { + name "MMD Maven" + url "https://maven.mcmoddev.com/" + } + } +} + +def mixinProviderGroup = "io.github.legacymoddingmc" +def mixinProviderModule = "unimixins" +def mixinProviderVersion = "0.1.6" +def mixinProviderSpecNoClassifer = "${mixinProviderGroup}:${mixinProviderModule}:${mixinProviderVersion}" +def mixinProviderSpec = "${mixinProviderSpecNoClassifer}:dev" + dependencies { - // you may put jars on which you depend on in ./libs - // or you may define them like so.. - //compile "some.group:artifact:version:classifier" - //compile "some.group:artifact:version" - - // real examples - //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env - //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env + if (usesMixins.toBoolean()) { + 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(mixinProviderSpec) + if (usesMixinDebug.toBoolean()) { + runtimeOnlyNonPublishable('org.jetbrains:intellij-fernflower:1.2.1.16') + } + } + if (usesMixins.toBoolean()) { + implementation(mixinProviderSpec) + } else if (forceEnableMixins.toBoolean()) { + runtimeOnlyNonPublishable(mixinProviderSpec) + } +} + +pluginManager.withPlugin('org.jetbrains.kotlin.kapt') { + if (usesMixins.toBoolean()) { + dependencies { + kapt(mixinProviderSpec) + } + } +} + +// Replace old mixin mods with unimixins +// https://docs.gradle.org/8.0.2/userguide/resolution_rules.html#sec:substitution_with_classifier +configurations.all { + resolutionStrategy.dependencySubstitution { + substitute module('com.gtnewhorizon:gtnhmixins') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Unimixins replaces other mixin mods") + substitute module('com.github.GTNewHorizons:Mixingasm') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Unimixins replaces other mixin mods") + substitute module('com.github.GTNewHorizons:SpongePoweredMixin') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Unimixins replaces other mixin mods") + substitute module('com.github.GTNewHorizons:SpongeMixins') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Unimixins replaces other mixin mods") + substitute module('io.github.legacymoddingmc:unimixins') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Our previous unimixins upload was missing the dev classifier") + } +} + +apply from: 'dependencies.gradle' + +def mixingConfigRefMap = 'mixins.' + modId + '.refmap.json' +def mixinTmpDir = buildDir.path + File.separator + 'tmp' + File.separator + 'mixins' +def refMap = "${mixinTmpDir}" + File.separator + mixingConfigRefMap +def mixinSrg = "${mixinTmpDir}" + File.separator + "mixins.srg" + +tasks.register('generateAssets') { + group = "GTNH Buildscript" + description = "Generates a mixin config file at /src/main/resources/mixins.modid.json if needed" + onlyIf { usesMixins.toBoolean() } + doLast { + def mixinConfigFile = getFile("/src/main/resources/mixins." + modId + ".json") + if (!mixinConfigFile.exists()) { + def mixinPluginLine = "" + if (!mixinPlugin.isEmpty()) { + // We might not have a mixin plugin if we're using early/late mixins + mixinPluginLine += """\n "plugin": "${modGroup}.${mixinPlugin}", """ + } - // for more info... - // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html - // http://www.gradle.org/docs/current/userguide/dependency_management.html + mixinConfigFile.text = """{ + "required": true, + "minVersion": "0.8.5-GTNH", + "package": "${modGroup}.${mixinsPackage}",${mixinPluginLine} + "refmap": "${mixingConfigRefMap}", + "target": "@env(DEFAULT)", + "compatibilityLevel": "JAVA_8", + "mixins": [], + "client": [], + "server": [] +} +""" + } + } +} + +if (usesMixins.toBoolean()) { + tasks.named("reobfJar", ReobfuscatedJar).configure { + extraSrgFiles.from(mixinSrg) + } + + tasks.named("processResources").configure { + dependsOn("generateAssets") + } + + tasks.named("compileJava", JavaCompile).configure { + doFirst { + new File(mixinTmpDir).mkdirs() + } + options.compilerArgs += [ + "-AreobfSrgFile=${tasks.reobfJar.srg.get().asFile}", + "-AoutSrgFile=${mixinSrg}", + "-AoutRefMapFile=${refMap}", + // Elan: from what I understand they are just some linter configs so you get some warning on how to properly code + "-XDenableSunApiLintControl", + "-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() + } + } + } + } } -processResources -{ +tasks.named("processResources", ProcessResources).configure { // this will ensure that this task is redone when the versions change. inputs.property "version", project.version - inputs.property "mcversion", project.minecraft.version + inputs.property "mcversion", project.minecraft.mcVersion + exclude("spotless.gradle") - // replace stuff in mcmod.info, nothing else - from(sourceSets.main.resources.srcDirs) { - include 'mcmod.info' - - // replace version and mcversion - expand 'version':project.version, 'mcversion':project.minecraft.version + // replace stuff in mcmod.info, nothing else. replaces ${key} with value in text + filesMatching("mcmod.info") { + expand "minecraftVersion": project.minecraft.mcVersion, + "modVersion": modVersion, + "modId": modId, + "modName": modName + } + + if (usesMixins.toBoolean()) { + from refMap + dependsOn("compileJava", "compileScala") } - - // copy everything else, thats not the mcmod.info +} + +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.3.5' + def asmVersion = '9.4' + if (modId != 'lwjgl3ify') { + java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}") + } + if (modId != 'hodgepodge') { + java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.2.8') + } + + 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(Distribution 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 == Distribution.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) + } +} + +def runClient17Task = tasks.register("runClient17", RunHotswappableMinecraftTask, Distribution.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, Distribution.DEDICATED_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)) { + manifestAttributes += ["FMLCorePluginContainsFMLMod": true] + } + + if (accessTransformersFile) { + manifestAttributes += ["FMLAT": accessTransformersFile.toString()] + } + + if (coreModClass) { + manifestAttributes += ["FMLCorePlugin": modGroup + "." + coreModClass] + } + + if (usesMixins.toBoolean()) { + manifestAttributes += [ + "TweakClass" : "org.spongepowered.asm.launch.MixinTweaker", + "MixinConfigs" : "mixins." + modId + ".json", + "ForceLoadAsMod": !containsMixinsAndOrCoreModOnly.toBoolean() + ] + } + return manifestAttributes +} + +tasks.named("jar", Jar).configure { + manifest { + attributes(getManifestAttributes()) + } +} + +if (usesShadowedDependencies.toBoolean()) { + tasks.named("shadowJar", ShadowJar).configure { + manifest { + attributes(getManifestAttributes()) + } + + if (minimizeShadowedDependencies.toBoolean()) { + minimize() // This will only allow shading for actually used classes + } + configurations = [ + project.configurations.shadowImplementation, + project.configurations.shadowCompile, + project.configurations.shadeCompile + ] + 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", "runClient17", "runServer17"]) { + tasks.named(runTask).configure { + dependsOn("shadowJar") + } + } +} +ext.publishableDevJar = usesShadowedDependencies.toBoolean() ? tasks.shadowJar : tasks.jar +ext.publishableObfJar = tasks.reobfJar + +tasks.register('apiJar', Jar) { + from(sourceSets.main.allSource) { + include modGroupPath + "/" + apiPackagePath + '/**' + } + + from(sourceSets.main.output) { + include modGroupPath + "/" + apiPackagePath + '/**' + } + from(sourceSets.main.resources.srcDirs) { - exclude 'mcmod.info' + include("LICENSE") } + + getArchiveClassifier().set('api') } -sourceSets { - main { output.resourcesDir = output.classesDir } +artifacts { + if (!noPublishedSources) { + archives tasks.named("sourcesJar") + } + if (apiPackage) { + archives tasks.named("apiJar") + } +} + +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"] + } + "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"] + } + "4. Run Obfuscated Server"(Gradle) { + taskNames = ["runObfServer"] + } + if (!disableSpotless) { + "5. Apply spotless"(Gradle) { + taskNames = ["spotlessApply"] + } + } + def coreModArgs = "" + if (coreModClass) { + coreModArgs = ' "-Dfml.coreMods.load=' + modGroup + '.' + coreModClass + '"' + } + "Run Client (IJ Native)"(Application) { + mainClass = "GradleStart" + moduleName = project.name + ".ideVirtualMain" + afterEvaluate { + workingDirectory = tasks.runClient.workingDir.absolutePath + programParameters = tasks.runClient.calculateArgs(project).collect { '"' + it + '"' }.join(' ') + jvmArgs = tasks.runClient.calculateJvmArgs(project).collect { '"' + it + '"' }.join(' ') + + ' ' + tasks.runClient.systemProperties.collect { '"-D' + it.key + '=' + it.value.toString() + '"' }.join(' ') + + coreModArgs + } + } + "Run Server (IJ Native)"(Application) { + mainClass = "GradleStartServer" + moduleName = project.name + ".ideVirtualMain" + afterEvaluate { + workingDirectory = tasks.runServer.workingDir.absolutePath + programParameters = tasks.runServer.calculateArgs(project).collect { '"' + it + '"' }.join(' ') + jvmArgs = tasks.runServer.calculateJvmArgs(project).collect { '"' + it + '"' }.join(' ') + + ' ' + tasks.runServer.systemProperties.collect { '"-D' + it.key + '=' + it.value.toString() + '"' }.join(' ') + + coreModArgs + } + } + } + compiler.javac { + afterEvaluate { + javacAdditionalOptions = "-encoding utf8" + moduleJavacAdditionalOptions = [ + (project.name + ".main"): tasks.compileJava.options.compilerArgs.collect { '"' + it + '"' }.join(' ') + ] + } + } + 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 = """ + + + + + +""" + } + } + } + } + } +} + +tasks.named("processIdeaSettings").configure { + dependsOn("injectTags") +} + +// workaround variable hiding in pom processing +def projectConfigs = project.configurations + +publishing { + publications { + create("maven", MavenPublication) { + from components.java + + if (apiPackage) { + artifact apiJar + } + + 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 + } + } + + repositories { + maven { + url = "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases" + allowInsecureProtocol = true + credentials { + username = System.getenv("MAVEN_USER") ?: "NONE" + password = System.getenv("MAVEN_PASSWORD") ?: "NONE" + } + } + } +} + +if (modrinthProjectId.size() != 0 && System.getenv("MODRINTH_TOKEN") != null) { + apply plugin: 'com.modrinth.minotaur' + + File changelogFile = new File(System.getenv("CHANGELOG_FILE") ?: "CHANGELOG.md") + + modrinth { + token = System.getenv("MODRINTH_TOKEN") + projectId = modrinthProjectId + versionNumber = identifiedVersion + versionType = identifiedVersion.endsWith("-pre") ? "beta" : "release" + changelog = changelogFile.exists() ? changelogFile.getText("UTF-8") : "" + uploadFile = publishableObfJar + additionalFiles = getSecondaryArtifacts() + gameVersions = [minecraftVersion] + loaders = ["forge"] + debugMode = false + } + + if (modrinthRelations.size() != 0) { + String[] deps = modrinthRelations.split(";") + deps.each { dep -> + if (dep.size() == 0) { + return + } + String[] parts = dep.split(":") + String[] qual = parts[0].split("-") + addModrinthDep(qual[0], qual[1], parts[1]) + } + } + if (usesMixins.toBoolean()) { + addModrinthDep("required", "project", "unimixins") + } + tasks.modrinth.dependsOn(build) + tasks.publish.dependsOn(tasks.modrinth) +} + +if (curseForgeProjectId.size() != 0 && System.getenv("CURSEFORGE_TOKEN") != null) { + apply plugin: 'com.matthewprenger.cursegradle' + + File changelogFile = new File(System.getenv("CHANGELOG_FILE") ?: "CHANGELOG.md") + + curseforge { + apiKey = System.getenv("CURSEFORGE_TOKEN") + project { + id = curseForgeProjectId + if (changelogFile.exists()) { + changelogType = "markdown" + changelog = changelogFile + } + releaseType = identifiedVersion.endsWith("-pre") ? "beta" : "release" + addGameVersion minecraftVersion + addGameVersion "Forge" + mainArtifact publishableObfJar + for (artifact in getSecondaryArtifacts()) addArtifact artifact + } + + options { + javaIntegration = false + forgeGradleIntegration = false + debug = false + } + } + + if (curseForgeRelations.size() != 0) { + String[] deps = curseForgeRelations.split(";") + deps.each { dep -> + if (dep.size() == 0) { + return + } + String[] parts = dep.split(":") + addCurseForgeRelation(parts[0], parts[1]) + } + } + if (usesMixins.toBoolean()) { + addCurseForgeRelation("requiredDependency", "unimixins") + } + tasks.curseforge.dependsOn(build) + tasks.publish.dependsOn(tasks.curseforge) +} + +def addModrinthDep(String scope, String type, String name) { + com.modrinth.minotaur.dependencies.Dependency dep; + if (!(scope in ["required", "optional", "incompatible", "embedded"])) { + throw new Exception("Invalid modrinth dependency scope: " + scope) + } + switch (type) { + case "project": + dep = new ModDependency(name, scope) + break + case "version": + dep = new VersionDependency(name, scope) + break + default: + throw new Exception("Invalid modrinth dependency type: " + type) + } + project.modrinth.dependencies.add(dep) +} + +def addCurseForgeRelation(String type, String name) { + if (!(type in ["requiredDependency", "embeddedLibrary", "optionalDependency", "tool", "incompatible"])) { + throw new Exception("Invalid CurseForge relation type: " + type) + } + CurseArtifact artifact = project.curseforge.curseProjects[0].mainArtifact + CurseRelation rel = (artifact.curseRelations ?: (artifact.curseRelations = new CurseRelation())) + rel."$type"(name) +} + +// Updating + +def buildscriptGradleVersion = "8.1.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 + + print("Build script already up-to-date!") + } +} + +if (!project.getGradle().startParameter.isOffline() && !Boolean.getBoolean('DISABLE_BUILDSCRIPT_UPDATE_CHECK') && isNewBuildScriptVersionAvailable()) { + if (autoUpdateBuildScript.toBoolean()) { + 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") + } + } +} + +static URL availableBuildScriptUrl() { + new URL("https://raw.githubusercontent.com/GTNewHorizons/ExampleMod1.7.10/master/build.gradle") +} + +static URL exampleSettingsGradleUrl() { + new URL("https://raw.githubusercontent.com/GTNewHorizons/ExampleMod1.7.10/master/settings.gradle.example") +} + +static URL exampleGitAttributesUrl() { + new URL("https://raw.githubusercontent.com/GTNewHorizons/ExampleMod1.7.10/master/.gitattributes") +} + + +boolean verifyGitAttributes() { + def gitattributesFile = getFile(".gitattributes") + if (!gitattributesFile.exists()) { + println("Downloading default .gitattributes") + exampleGitAttributesUrl().withInputStream { i -> gitattributesFile.withOutputStream { it << i } } + exec { + workingDir '.' + commandLine 'git', 'add', '--renormalize', '.' + } + return true + } + return false +} + +boolean verifySettingsGradle() { + def settingsFile = getFile("settings.gradle") + if (!settingsFile.exists()) { + println("Downloading default settings.gradle") + exampleSettingsGradleUrl().withInputStream { i -> settingsFile.withOutputStream { it << i } } + return true + } + return false +} + +boolean performBuildScriptUpdate() { + if (isNewBuildScriptVersionAvailable()) { + def buildscriptFile = getFile("build.gradle") + availableBuildScriptUrl().withInputStream { i -> buildscriptFile.withOutputStream { it << i } } + def out = services.get(StyledTextOutputFactory).create('buildscript-update-output') + out.style(Style.Success).print("Build script updated. Please REIMPORT the project or RESTART your IDE!") + boolean settingsupdated = verifySettingsGradle() + settingsupdated = verifyGitAttributes() || settingsupdated + if (settingsupdated) + throw new GradleException("Settings has been updated, please re-run task.") + return true + } + return false +} + +boolean isNewBuildScriptVersionAvailable() { + Map parameters = ["connectTimeout": 2000, "readTimeout": 2000] + + String currentBuildScript = getFile("build.gradle").getText() + String currentBuildScriptHash = getVersionHash(currentBuildScript) + String availableBuildScript = availableBuildScriptUrl().newInputStream(parameters).getText() + String availableBuildScriptHash = getVersionHash(availableBuildScript) + + boolean isUpToDate = currentBuildScriptHash.empty || availableBuildScriptHash.empty || currentBuildScriptHash == availableBuildScriptHash + return !isUpToDate +} + +static String getVersionHash(String buildScriptContent) { + String versionLine = buildScriptContent.find("^//version: [a-z0-9]*") + if (versionLine != null) { + return versionLine.split(": ").last() + } + return "" +} + +// Parameter Deobfuscation + +tasks.register('deobfParams') { + group = 'GTNH Buildscript' + description = 'Rename all obfuscated parameter names inherited from Minecraft classes' + doLast { // TODO + + String mcpDir = "$project.gradle.gradleUserHomeDir/caches/minecraft/de/oceanlabs/mcp/mcp_$channel/$mappingsVersion" + String mcpZIP = "$mcpDir/mcp_$channel-$mappingsVersion-${minecraftVersion}.zip" + String paramsCSV = "$mcpDir/params.csv" + + download.run { + src "https://maven.minecraftforge.net/de/oceanlabs/mcp/mcp_$channel/$mappingsVersion-$minecraftVersion/mcp_$channel-$mappingsVersion-${minecraftVersion}.zip" + dest mcpZIP + overwrite false + } + + if (!file(paramsCSV).exists()) { + println("Extracting MCP archive ...") + copy { + from(zipTree(mcpZIP)) + into(mcpDir) + } + } + + println("Parsing params.csv ...") + Map params = new HashMap<>() + Files.lines(Paths.get(paramsCSV)).forEach { line -> + String[] cells = line.split(",") + if (cells.length > 2 && cells[0].matches("p_i?\\d+_\\d+_")) { + params.put(cells[0], cells[1]) + } + } + + out.style(Style.Success).println("Modified ${replaceParams(file("$projectDir/src/main/java"), params)} files!") + out.style(Style.Failure).println("Don't forget to verify that the code still works as before!\n It could be broken due to duplicate variables existing now\n or parameters taking priority over other variables.") + } +} + +static int replaceParams(File file, Map params) { + int fileCount = 0 + + if (file.isDirectory()) { + for (File f : file.listFiles()) { + fileCount += replaceParams(f, params) + } + return fileCount + } + println("Visiting ${file.getName()} ...") + try { + String content = new String(Files.readAllBytes(file.toPath())) + int hash = content.hashCode() + params.forEach { key, value -> + content = content.replaceAll(key, value) + } + if (hash != content.hashCode()) { + Files.write(file.toPath(), content.getBytes("UTF-8")) + return 1 + } + } catch (Exception e) { + e.printStackTrace() + } + return 0 +} + +// Dependency Deobfuscation (Deprecated, use the new RFG API documented in dependencies.gradle) + +def deobf(String sourceURL) { + try { + URL url = new URL(sourceURL) + String fileName = url.getFile() + + //get rid of directories: + int lastSlash = fileName.lastIndexOf("/") + if (lastSlash > 0) { + fileName = fileName.substring(lastSlash + 1) + } + //get rid of extension: + if (fileName.endsWith(".jar") || fileName.endsWith(".litemod")) { + fileName = fileName.substring(0, fileName.lastIndexOf(".")) + } + + String hostName = url.getHost() + if (hostName.startsWith("www.")) { + hostName = hostName.substring(4) + } + List parts = Arrays.asList(hostName.split("\\.")) + Collections.reverse(parts) + hostName = String.join(".", parts) + + return deobf(sourceURL, "$hostName/$fileName") + } catch (Exception ignored) { + return deobf(sourceURL, "deobf/${sourceURL.hashCode()}") + } +} + +def deobfMaven(String repoURL, String mavenDep) { + if (!repoURL.endsWith("/")) { + repoURL += "/" + } + String[] parts = mavenDep.split(":") + parts[0] = parts[0].replace('.', '/') + def jarURL = repoURL + parts[0] + "/" + parts[1] + "/" + parts[2] + "/" + parts[1] + "-" + parts[2] + ".jar" + return deobf(jarURL) +} + +def deobfCurse(String curseDep) { + return dependencies.rfg.deobf("curse.maven:$curseDep") +} + +// The method above is to be preferred. Use this method if the filename is not at the end of the URL. +def deobf(String sourceURL, String rawFileName) { + String bon2Version = "2.5.1" + String fileName = URLDecoder.decode(rawFileName, "UTF-8") + String cacheDir = "$project.gradle.gradleUserHomeDir/caches" + String obfFile = "$cacheDir/modules-2/files-2.1/${fileName}.jar" + + download.run { + src sourceURL + dest obfFile + quiet true + overwrite false + } + return dependencies.rfg.deobf(files(obfFile)) +} +// Helper methods + +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/GTNewHorizons/ExampleMod1.7.10/blob/main/gradle.properties") + } +} + +def propertyDefaultIfUnset(String propertyName, defaultValue) { + if (!project.hasProperty(propertyName) || project.property(propertyName) == "") { + project.ext.setProperty(propertyName, defaultValue) + } +} + +def getFile(String relativePath) { + return new File(projectDir, relativePath) +} + +def getSecondaryArtifacts() { + // Because noPublishedSources from the beginning of the script is somehow not visible here... + boolean noPublishedSources = project.hasProperty("noPublishedSources") ? project.noPublishedSources.toBoolean() : false + def secondaryArtifacts = [publishableDevJar] + if (!noPublishedSources) secondaryArtifacts += [sourcesJar] + if (apiPackage) secondaryArtifacts += [apiJar] + return secondaryArtifacts } diff --git a/dependencies.gradle b/dependencies.gradle new file mode 100644 index 0000000..cfa82fc --- /dev/null +++ b/dependencies.gradle @@ -0,0 +1,39 @@ +/* + * Add your dependencies here. Supported configurations: + * - api("group:name:version:classifier"): if you use the types from this dependency in the public API of this mod + * Available at runtime and compiletime for mods depending on this mod + * - implementation("g:n:v:c"): if you need this for internal implementation details of the mod, but none of it is visible via the public API + * Available at runtime but not compiletime for mods depending on this mod + * - compileOnly("g:n:v:c"): if the mod you're building doesn't need this dependency during runtime at all, e.g. for optional mods + * Not available at all for mods depending on this mod, only visible at compiletime for this mod + * - compileOnlyApi("g:n:v:c"): like compileOnly, but also visible at compiletime for mods depending on this mod + * Available at compiletime but not runtime for mods depending on this mod + * - runtimeOnlyNonPublishable("g:n:v:c"): if you want to include a mod in this mod's runClient/runServer runs, but not publish it as a dependency + * Not available at all for mods depending on this mod, only visible at runtime for this mod + * - devOnlyNonPublishable("g:n:v:c"): a combination of runtimeOnlyNonPublishable and compileOnly for dependencies present at both compiletime and runtime, + * but not published as Maven dependencies - useful for RFG-deobfuscated dependencies or local testing + * - runtimeOnly("g:n:v:c"): if you don't need this at compile time, but want it to be present at runtime + * Available at runtime for mods depending on this mod + * - annotationProcessor("g:n:v:c"): mostly for java compiler plugins, if you know you need this, use it, otherwise don't worry + * - testCONFIG("g:n:v:c") - replace CONFIG by one of the above (except api), same as above but for the test sources instead of main + * + * - shadowImplementation("g:n:v:c"): effectively the same as API, but the dependency is included in your jar under a renamed package name + * Requires you to enable usesShadowedDependencies in gradle.properties + * + * - compile("g:n:v:c"): deprecated, replace with "api" (works like the old "compile") or "implementation" (can be more efficient) + * + * You can exclude transitive dependencies (dependencies of the chosen dependency) by appending { transitive = false } if needed, + * but use this sparingly as it can break using your mod as another mod's dependency if you're not careful. + * + * To depend on obfuscated jars you can use `devOnlyNonPublishable(rfg.deobf("dep:spec:1.2.3"))` to fetch an obfuscated jar from maven, + * or `devOnlyNonPublishable(rfg.deobf(project.files("libs/my-mod-jar.jar")))` to use a file. + * + * Gradle names for some of the configuration can be misleading, compileOnlyApi and runtimeOnly both get published as dependencies in Maven, but compileOnly does not. + * The buildscript adds runtimeOnlyNonPublishable to also have a runtime dependency that's not published. + * + * For more details, see https://docs.gradle.org/8.0.1/userguide/java_library_plugin.html#sec:java_library_configurations_graph + */ +dependencies { + api("com.github.GTNewHorizons:BuildCraft:7.1.24:dev") + api("curse.maven:cofh-lib-220333:2388748") +} diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..ef222aa --- /dev/null +++ b/gradle.properties @@ -0,0 +1,143 @@ +modName = WindmillFlux + +# This is a case-sensitive string to identify your mod. Convention is to use lower case. +modId = rfwindmill + +modGroup = com.piepenguin.rfwindmill + +# WHY is there no version field? +# The build script relies on git to provide a version via tags. It is super easy and will enable you to always know the +# code base or your binary. Check out this tutorial: https://blog.mattclemente.com/2017/10/13/versioning-with-git-tags/ + +# Will update your build.gradle automatically whenever an update is available +autoUpdateBuildScript = false + +minecraftVersion = 1.7.10 +forgeVersion = 10.13.4.1614 + +# Specify a MCP channel and mappings version for dependency deobfuscation and the deobfParams task. +channel = stable +mappingsVersion = 12 + +# Define other MCP mappings for dependency deobfuscation +remoteMappings = https://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/ + +# 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 +developmentEnvironmentUserName = Developer + +# Enables using modern java syntax (up to version 17) via Jabel, while still targetting JVM 8. +# See https://github.com/bsideup/jabel for details on how this works. +enableModernJavaSyntax = true + +# Enables injecting missing generics into the decompiled source code for a better coding experience +# Turns most publically visible List, Map, etc. into proper List, Map types +enableGenericInjection = false + +# Generate a class with String fields for the mod id, name, version and group name named with the fields below +generateGradleTokenClass = com.piepenguin.rfwindmill.Tags +gradleTokenModId = MODID +gradleTokenModName = MODNAME +gradleTokenVersion = VERSION +gradleTokenGroupName = GROUPNAME +# [DEPRECATED] +# Multiple source files can be defined here by providing a comma-seperated list: Class1.java,Class2.java,Class3.java +# public static final String VERSION = "GRADLETOKEN_VERSION"; +# The string's content will be replaced with your mod's version when compiled. You should use this to specify your mod's +# version in @Mod([...], version = VERSION, [...]) +# Leave these properties empty to skip individual token replacements +replaceGradleTokenInFile = + +# 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 = + +# Specify the configuration file for Forge's access transformers here. It must be placed into /src/main/resources/META-INF/ +# There can be multiple files in a comma-separated list. +# Example value: mymodid_at.cfg,nei_at.cfg +accessTransformersFile = + +# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled! +usesMixins = false +# Adds some debug arguments like verbose output and export +usesMixinDebug = false +# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise. +mixinPlugin = +# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail! +mixinsPackage = +# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin! +# This parameter is for legacy compatibility only +# 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 ( = some class +# that is 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 + +# 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 = false +# If disabled, won't remove unused classes from shaded dependencies. Some libraries use reflection to access +# their own classes, making the minimization unreliable. +minimizeShadowedDependencies = true +# If disabled, won't rename the shadowed classes. +relocateShadowedDependencies = true + +# Adds the GTNH maven, CurseMaven, IC2/Player maven, and some more well-known 1.7.10 repositories +includeWellKnownRepositories = true + +# Publishing to modrinth requires you to set the MODRINTH_TOKEN environment variable to your current modrinth API token. + +# The project's ID on Modrinth. Can be either the slug or the ID. +# Leave this empty if you don't want to publish on Modrinth. +modrinthProjectId = + +# The project's relations on Modrinth. You can use this to refer to other projects on Modrinth. +# Syntax: scope1-type1:name1;scope2-type2:name2;... +# Where scope can be one of [required, optional, incompatible, embedded], +# type can be one of [project, version], +# and the name is the Modrinth project or version slug/id of the other mod. +# Example: required-project:fplib;optional-project:gasstation;incompatible-project:gregtech +# Note: GTNH Mixins is automatically set as a required dependency if usesMixins = true +modrinthRelations = + + +# Publishing to CurseForge requires you to set the CURSEFORGE_TOKEN environment variable to one of your CurseForge API tokens. + +# The project's numeric ID on CurseForge. You can find this in the About Project box. +# Leave this empty if you don't want to publish on CurseForge. +curseForgeProjectId = + +# The project's relations on CurseForge. You can use this to refer to other projects on CurseForge. +# Syntax: type1:name1;type2:name2;... +# Where type can be one of [requiredDependency, embeddedLibrary, optionalDependency, tool, incompatible], +# and the name is the CurseForge project slug of the other mod. +# Example: requiredDependency:railcraft;embeddedLibrary:cofhlib;incompatible:buildcraft +# Note: GTNH Mixins is automatically set as a required dependency if usesMixins = true +curseForgeRelations = + + +# Optional parameter to customize the produced artifacts. Use this to preserver artifact naming when migrating older +# projects. New projects should not use this parameter. +# customArchiveBaseName = + +# Optional parameter to prevent the source code from being published +# noPublishedSources = + +# Uncomment this to disable spotless checks +# This should only be uncommented to keep it easier to sync with upstream/other forks. +# That is, if there is no other active fork/upstream, NEVER change this. +# disableSpotless = true + +# Override the IDEA build type. Valid value is "" (leave blank, do not override), "idea" (force use native IDEA build), "gradle" +# (force use delegated build). +# This is meant to be set in $HOME/.gradle/gradle.properties. +# e.g. add "systemProp.org.gradle.project.ideaOverrideBuildType=idea" will override the build type to be always native build. +# WARNING: If you do use this option, it will overwrite whatever you have in your existing projects. This might not be what you want! +# Usually there is no need to uncomment this here as other developers do not necessarily use the same build type as you. +# ideaOverrideBuildType = idea diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..ccebba7710deaf9f98673a68957ea02138b60d0a GIT binary patch literal 61608 zcmb5VV{~QRw)Y#`wrv{~+qP{x72B%VwzFc}c2cp;N~)5ZbDrJayPv(!dGEd-##*zr z)#n-$y^sH|_dchh3@8{H5D*j;5D<{i*8l5IFJ|DjL!e)upfGNX(kojugZ3I`oH1PvW`wFW_ske0j@lB9bX zO;2)`y+|!@X(fZ1<2n!Qx*)_^Ai@Cv-dF&(vnudG?0CsddG_&Wtae(n|K59ew)6St z#dj7_(Cfwzh$H$5M!$UDd8=4>IQsD3xV=lXUq($;(h*$0^yd+b{qq63f0r_de#!o_ zXDngc>zy`uor)4A^2M#U*DC~i+dc<)Tb1Tv&~Ev@oM)5iJ4Sn#8iRw16XXuV50BS7 zdBL5Mefch(&^{luE{*5qtCZk$oFr3RH=H!c3wGR=HJ(yKc_re_X9pD` zJ;uxPzUfVpgU>DSq?J;I@a+10l0ONXPcDkiYcihREt5~T5Gb}sT0+6Q;AWHl`S5dV>lv%-p9l#xNNy7ZCr%cyqHY%TZ8Q4 zbp&#ov1*$#grNG#1vgfFOLJCaNG@K|2!W&HSh@3@Y%T?3YI75bJp!VP*$*!< z;(ffNS_;@RJ`=c7yX04!u3JP*<8jeqLHVJu#WV&v6wA!OYJS4h<_}^QI&97-;=ojW zQ-1t)7wnxG*5I%U4)9$wlv5Fr;cIizft@&N+32O%B{R1POm$oap@&f| zh+5J{>U6ftv|vAeKGc|zC=kO(+l7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wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..37aef8d --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip +networkTimeout=10000 +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100644 index 0000000..79a61d4 --- /dev/null +++ b/gradlew @@ -0,0 +1,244 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +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 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..93e3f59 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,92 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/jitpack.yml b/jitpack.yml new file mode 100644 index 0000000..09bbb51 --- /dev/null +++ b/jitpack.yml @@ -0,0 +1,2 @@ +before_install: + - ./gradlew setupCIWorkspace \ No newline at end of file diff --git a/repositories.gradle b/repositories.gradle new file mode 100644 index 0000000..c884390 --- /dev/null +++ b/repositories.gradle @@ -0,0 +1,5 @@ +// Add any additional repositories for your dependencies here + +repositories { + +} diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..e334397 --- /dev/null +++ b/settings.gradle @@ -0,0 +1,28 @@ + +pluginManagement { + repositories { + maven { + // RetroFuturaGradle + name "GTNH Maven" + url "http://jenkins.usrv.eu:8081/nexus/content/groups/public/" + allowInsecureProtocol = true + mavenContent { + includeGroup("com.gtnewhorizons.retrofuturagradle") + } + } + gradlePluginPortal() + mavenCentral() + mavenLocal() + } +} + +plugins { + id 'com.diffplug.blowdryerSetup' version '1.6.0' + id 'org.gradle.toolchains.foojay-resolver-convention' version '0.4.0' // Provides java toolchains +} + +blowdryerSetup { + repoSubfolder 'gtnhShared' + github('GTNewHorizons/ExampleMod1.7.10', 'tag', '0.2.2') + //devLocal '.' // Use this when testing config updates locally +} diff --git a/src/api/java/buildcraft/LICENSE b/src/api/java/buildcraft/LICENSE deleted file mode 100644 index 2c06b34..0000000 --- a/src/api/java/buildcraft/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -BuildCraft API License - -Copyright (c) 2011-2014 SpaceToad and the BuildCraft team - -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: - -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. \ No newline at end of file diff --git a/src/api/java/buildcraft/api/tools/IToolPipette.java b/src/api/java/buildcraft/api/tools/IToolPipette.java deleted file mode 100644 index bca9d26..0000000 --- a/src/api/java/buildcraft/api/tools/IToolPipette.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ -package buildcraft.api.tools; - -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; - -public interface IToolPipette { - - /** - * @param pipette - * ItemStack of the pipette. - * @return Capacity of the pipette. - */ - int getCapacity(ItemStack pipette); - - /** - * @param pipette - * @return true if the pipette can pipette. - */ - boolean canPipette(ItemStack pipette); - - /** - * Fills the pipette with the given liquid stack. - * - * @param pipette - * @param liquid - * @param doFill - * @return Amount of liquid used in filling the pipette. - */ - int fill(ItemStack pipette, FluidStack liquid, boolean doFill); - - /** - * Drains liquid from the pipette - * - * @param pipette - * @param maxDrain - * @param doDrain - * @return Fluid stack representing the liquid and amount drained from the pipette. - */ - FluidStack drain(ItemStack pipette, int maxDrain, boolean doDrain); -} diff --git a/src/api/java/buildcraft/api/tools/IToolWrench.java b/src/api/java/buildcraft/api/tools/IToolWrench.java deleted file mode 100644 index a6c56e8..0000000 --- a/src/api/java/buildcraft/api/tools/IToolWrench.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ -package buildcraft.api.tools; - -import net.minecraft.entity.player.EntityPlayer; - -/*** - * Implement this interface on subclasses of Item to have that item work as a wrench for buildcraft - */ -public interface IToolWrench { - - /*** - * Called to ensure that the wrench can be used. To get the ItemStack that is used, check player.inventory.getCurrentItem() - * - * @param player - * - The player doing the wrenching - * @param x - * ,y,z - The coordinates for the block being wrenched - * - * @return true if wrenching is allowed, false if not - */ - public boolean canWrench(EntityPlayer player, int x, int y, int z); - - /*** - * Callback after the wrench has been used. This can be used to decrease durability or for other purposes. To get the ItemStack that was used, check - * player.inventory.getCurrentItem() - * - * @param player - * - The player doing the wrenching - * @param x - * ,y,z - The coordinates of the block being wrenched - */ - public void wrenchUsed(EntityPlayer player, int x, int y, int z); -} diff --git a/src/api/java/buildcraft/api/tools/package-info.java b/src/api/java/buildcraft/api/tools/package-info.java deleted file mode 100644 index a5e03a0..0000000 --- a/src/api/java/buildcraft/api/tools/package-info.java +++ /dev/null @@ -1,3 +0,0 @@ -@API(apiVersion="1.0",owner="BuildCraftAPI|core",provides="BuildCraftAPI|tools") -package buildcraft.api.tools; -import cpw.mods.fml.common.API; \ No newline at end of file diff --git a/src/api/java/cofh/api/CoFHAPIProps.java b/src/api/java/cofh/api/CoFHAPIProps.java deleted file mode 100644 index 9b52830..0000000 --- a/src/api/java/cofh/api/CoFHAPIProps.java +++ /dev/null @@ -1,11 +0,0 @@ -package cofh.api; - -public class CoFHAPIProps { - - private CoFHAPIProps() { - - } - - public static final String VERSION = "1.7.10R1.0.2"; - -} diff --git a/src/api/java/cofh/api/energy/EnergyStorage.java b/src/api/java/cofh/api/energy/EnergyStorage.java deleted file mode 100644 index 1674c18..0000000 --- a/src/api/java/cofh/api/energy/EnergyStorage.java +++ /dev/null @@ -1,158 +0,0 @@ -package cofh.api.energy; - -import net.minecraft.nbt.NBTTagCompound; - -/** - * Reference implementation of {@link IEnergyStorage}. Use/extend this or implement your own. - * - * @author King Lemming - * - */ -public class EnergyStorage implements IEnergyStorage { - - protected int energy; - protected int capacity; - protected int maxReceive; - protected int maxExtract; - - public EnergyStorage(int capacity) { - - this(capacity, capacity, capacity); - } - - public EnergyStorage(int capacity, int maxTransfer) { - - this(capacity, maxTransfer, maxTransfer); - } - - public EnergyStorage(int capacity, int maxReceive, int maxExtract) { - - this.capacity = capacity; - this.maxReceive = maxReceive; - this.maxExtract = maxExtract; - } - - public EnergyStorage readFromNBT(NBTTagCompound nbt) { - - this.energy = nbt.getInteger("Energy"); - - if (energy > capacity) { - energy = capacity; - } - return this; - } - - public NBTTagCompound writeToNBT(NBTTagCompound nbt) { - - if (energy < 0) { - energy = 0; - } - nbt.setInteger("Energy", energy); - return nbt; - } - - public void setCapacity(int capacity) { - - this.capacity = capacity; - - if (energy > capacity) { - energy = capacity; - } - } - - public void setMaxTransfer(int maxTransfer) { - - setMaxReceive(maxTransfer); - setMaxExtract(maxTransfer); - } - - public void setMaxReceive(int maxReceive) { - - this.maxReceive = maxReceive; - } - - public void setMaxExtract(int maxExtract) { - - this.maxExtract = maxExtract; - } - - public int getMaxReceive() { - - return maxReceive; - } - - public int getMaxExtract() { - - return maxExtract; - } - - /** - * This function is included to allow for server -> client sync. Do not call this externally to the containing Tile Entity, as not all IEnergyHandlers - * are guaranteed to have it. - * - * @param energy - */ - public void setEnergyStored(int energy) { - - this.energy = energy; - - if (this.energy > capacity) { - this.energy = capacity; - } else if (this.energy < 0) { - this.energy = 0; - } - } - - /** - * This function is included to allow the containing tile to directly and efficiently modify the energy contained in the EnergyStorage. Do not rely on this - * externally, as not all IEnergyHandlers are guaranteed to have it. - * - * @param energy - */ - public void modifyEnergyStored(int energy) { - - this.energy += energy; - - if (this.energy > capacity) { - this.energy = capacity; - } else if (this.energy < 0) { - this.energy = 0; - } - } - - /* IEnergyStorage */ - @Override - public int receiveEnergy(int maxReceive, boolean simulate) { - - int energyReceived = Math.min(capacity - energy, Math.min(this.maxReceive, maxReceive)); - - if (!simulate) { - energy += energyReceived; - } - return energyReceived; - } - - @Override - public int extractEnergy(int maxExtract, boolean simulate) { - - int energyExtracted = Math.min(energy, Math.min(this.maxExtract, maxExtract)); - - if (!simulate) { - energy -= energyExtracted; - } - return energyExtracted; - } - - @Override - public int getEnergyStored() { - - return energy; - } - - @Override - public int getMaxEnergyStored() { - - return capacity; - } - -} diff --git a/src/api/java/cofh/api/energy/IEnergyConnection.java b/src/api/java/cofh/api/energy/IEnergyConnection.java deleted file mode 100644 index 79bdf77..0000000 --- a/src/api/java/cofh/api/energy/IEnergyConnection.java +++ /dev/null @@ -1,21 +0,0 @@ -package cofh.api.energy; - -import net.minecraftforge.common.util.ForgeDirection; - -/** - * Implement this interface on TileEntities which should connect to energy transportation blocks. This is intended for blocks which generate energy but do not - * accept it; otherwise just use IEnergyHandler. - *

- * Note that {@link IEnergyHandler} is an extension of this. - * - * @author King Lemming - * - */ -public interface IEnergyConnection { - - /** - * Returns TRUE if the TileEntity can connect on a given side. - */ - boolean canConnectEnergy(ForgeDirection from); - -} diff --git a/src/api/java/cofh/api/energy/IEnergyContainerItem.java b/src/api/java/cofh/api/energy/IEnergyContainerItem.java deleted file mode 100644 index c28455b..0000000 --- a/src/api/java/cofh/api/energy/IEnergyContainerItem.java +++ /dev/null @@ -1,52 +0,0 @@ -package cofh.api.energy; - -import net.minecraft.item.ItemStack; - -/** - * Implement this interface on Item classes that support external manipulation of their internal energy storages. - *

- * A reference implementation is provided {@link ItemEnergyContainer}. - * - * @author King Lemming - * - */ -public interface IEnergyContainerItem { - - /** - * Adds energy to a container item. Returns the quantity of energy that was accepted. This should always return 0 if the item cannot be externally charged. - * - * @param container - * ItemStack to be charged. - * @param maxReceive - * Maximum amount of energy to be sent into the item. - * @param simulate - * If TRUE, the charge will only be simulated. - * @return Amount of energy that was (or would have been, if simulated) received by the item. - */ - int receiveEnergy(ItemStack container, int maxReceive, boolean simulate); - - /** - * Removes energy from a container item. Returns the quantity of energy that was removed. This should always return 0 if the item cannot be externally - * discharged. - * - * @param container - * ItemStack to be discharged. - * @param maxExtract - * Maximum amount of energy to be extracted from the item. - * @param simulate - * If TRUE, the discharge will only be simulated. - * @return Amount of energy that was (or would have been, if simulated) extracted from the item. - */ - int extractEnergy(ItemStack container, int maxExtract, boolean simulate); - - /** - * Get the amount of energy currently stored in the container item. - */ - int getEnergyStored(ItemStack container); - - /** - * Get the max amount of energy that can be stored in the container item. - */ - int getMaxEnergyStored(ItemStack container); - -} diff --git a/src/api/java/cofh/api/energy/IEnergyHandler.java b/src/api/java/cofh/api/energy/IEnergyHandler.java deleted file mode 100644 index 22f2dbc..0000000 --- a/src/api/java/cofh/api/energy/IEnergyHandler.java +++ /dev/null @@ -1,58 +0,0 @@ -package cofh.api.energy; - -import net.minecraftforge.common.util.ForgeDirection; - -/** - * Implement this interface on Tile Entities which should handle energy, generally storing it in one or more internal {@link IEnergyStorage} objects. - *

- * A reference implementation is provided {@link TileEnergyHandler}. - * - * @author King Lemming - * - */ -public interface IEnergyHandler extends IEnergyProvider, IEnergyReceiver { - - // merely a convenience interface (remove these methods in 1.8; provided here for back-compat via compiler doing things) - - /** - * Add energy to an IEnergyReceiver, internal distribution is left entirely to the IEnergyReceiver. - * - * @param from - * Orientation the energy is received from. - * @param maxReceive - * Maximum amount of energy to receive. - * @param simulate - * If TRUE, the charge will only be simulated. - * @return Amount of energy that was (or would have been, if simulated) received. - */ - @Override - int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate); - - /** - * Remove energy from an IEnergyProvider, internal distribution is left entirely to the IEnergyProvider. - * - * @param from - * Orientation the energy is extracted from. - * @param maxExtract - * Maximum amount of energy to extract. - * @param simulate - * If TRUE, the extraction will only be simulated. - * @return Amount of energy that was (or would have been, if simulated) extracted. - */ - @Override - int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate); - - - /** - * Returns the amount of energy currently stored. - */ - @Override - int getEnergyStored(ForgeDirection from); - - /** - * Returns the maximum amount of energy that can be stored. - */ - @Override - int getMaxEnergyStored(ForgeDirection from); - -} diff --git a/src/api/java/cofh/api/energy/IEnergyProvider.java b/src/api/java/cofh/api/energy/IEnergyProvider.java deleted file mode 100644 index 05287b3..0000000 --- a/src/api/java/cofh/api/energy/IEnergyProvider.java +++ /dev/null @@ -1,38 +0,0 @@ -package cofh.api.energy; - -import net.minecraftforge.common.util.ForgeDirection; - -/** - * Implement this interface on Tile Entities which should provide energy, generally storing it in one or more internal {@link IEnergyStorage} objects. - *

- * A reference implementation is provided {@link TileEnergyHandler}. - * - * @author King Lemming - * - */ -public interface IEnergyProvider extends IEnergyConnection { - - /** - * Remove energy from an IEnergyProvider, internal distribution is left entirely to the IEnergyProvider. - * - * @param from - * Orientation the energy is extracted from. - * @param maxExtract - * Maximum amount of energy to extract. - * @param simulate - * If TRUE, the extraction will only be simulated. - * @return Amount of energy that was (or would have been, if simulated) extracted. - */ - int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate); - - /** - * Returns the amount of energy currently stored. - */ - int getEnergyStored(ForgeDirection from); - - /** - * Returns the maximum amount of energy that can be stored. - */ - int getMaxEnergyStored(ForgeDirection from); - -} diff --git a/src/api/java/cofh/api/energy/IEnergyReceiver.java b/src/api/java/cofh/api/energy/IEnergyReceiver.java deleted file mode 100644 index c726e09..0000000 --- a/src/api/java/cofh/api/energy/IEnergyReceiver.java +++ /dev/null @@ -1,38 +0,0 @@ -package cofh.api.energy; - -import net.minecraftforge.common.util.ForgeDirection; - -/** - * Implement this interface on Tile Entities which should receive energy, generally storing it in one or more internal {@link IEnergyStorage} objects. - *

- * A reference implementation is provided {@link TileEnergyHandler}. - * - * @author King Lemming - * - */ -public interface IEnergyReceiver extends IEnergyConnection { - - /** - * Add energy to an IEnergyReceiver, internal distribution is left entirely to the IEnergyReceiver. - * - * @param from - * Orientation the energy is received from. - * @param maxReceive - * Maximum amount of energy to receive. - * @param simulate - * If TRUE, the charge will only be simulated. - * @return Amount of energy that was (or would have been, if simulated) received. - */ - int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate); - - /** - * Returns the amount of energy currently stored. - */ - int getEnergyStored(ForgeDirection from); - - /** - * Returns the maximum amount of energy that can be stored. - */ - int getMaxEnergyStored(ForgeDirection from); - -} diff --git a/src/api/java/cofh/api/energy/IEnergyStorage.java b/src/api/java/cofh/api/energy/IEnergyStorage.java deleted file mode 100644 index bc20656..0000000 --- a/src/api/java/cofh/api/energy/IEnergyStorage.java +++ /dev/null @@ -1,46 +0,0 @@ -package cofh.api.energy; - -/** - * An energy storage is the unit of interaction with Energy inventories.
- * This is not to be implemented on TileEntities. This is for internal use only. - *

- * A reference implementation can be found at {@link EnergyStorage}. - * - * @author King Lemming - * - */ -public interface IEnergyStorage { - - /** - * Adds energy to the storage. Returns quantity of energy that was accepted. - * - * @param maxReceive - * Maximum amount of energy to be inserted. - * @param simulate - * If TRUE, the insertion will only be simulated. - * @return Amount of energy that was (or would have been, if simulated) accepted by the storage. - */ - int receiveEnergy(int maxReceive, boolean simulate); - - /** - * Removes energy from the storage. Returns quantity of energy that was removed. - * - * @param maxExtract - * Maximum amount of energy to be extracted. - * @param simulate - * If TRUE, the extraction will only be simulated. - * @return Amount of energy that was (or would have been, if simulated) extracted from the storage. - */ - int extractEnergy(int maxExtract, boolean simulate); - - /** - * Returns the amount of energy currently stored. - */ - int getEnergyStored(); - - /** - * Returns the maximum amount of energy that can be stored. - */ - int getMaxEnergyStored(); - -} diff --git a/src/api/java/cofh/api/energy/ItemEnergyContainer.java b/src/api/java/cofh/api/energy/ItemEnergyContainer.java deleted file mode 100644 index 055ae45..0000000 --- a/src/api/java/cofh/api/energy/ItemEnergyContainer.java +++ /dev/null @@ -1,110 +0,0 @@ -package cofh.api.energy; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; - -/** - * Reference implementation of {@link IEnergyContainerItem}. Use/extend this or implement your own. - * - * @author King Lemming - * - */ -public class ItemEnergyContainer extends Item implements IEnergyContainerItem { - - protected int capacity; - protected int maxReceive; - protected int maxExtract; - - public ItemEnergyContainer() { - - } - - public ItemEnergyContainer(int capacity) { - - this(capacity, capacity, capacity); - } - - public ItemEnergyContainer(int capacity, int maxTransfer) { - - this(capacity, maxTransfer, maxTransfer); - } - - public ItemEnergyContainer(int capacity, int maxReceive, int maxExtract) { - - this.capacity = capacity; - this.maxReceive = maxReceive; - this.maxExtract = maxExtract; - } - - public ItemEnergyContainer setCapacity(int capacity) { - - this.capacity = capacity; - return this; - } - - public void setMaxTransfer(int maxTransfer) { - - setMaxReceive(maxTransfer); - setMaxExtract(maxTransfer); - } - - public void setMaxReceive(int maxReceive) { - - this.maxReceive = maxReceive; - } - - public void setMaxExtract(int maxExtract) { - - this.maxExtract = maxExtract; - } - - /* IEnergyContainerItem */ - @Override - public int receiveEnergy(ItemStack container, int maxReceive, boolean simulate) { - - if (container.stackTagCompound == null) { - container.stackTagCompound = new NBTTagCompound(); - } - int energy = container.stackTagCompound.getInteger("Energy"); - int energyReceived = Math.min(capacity - energy, Math.min(this.maxReceive, maxReceive)); - - if (!simulate) { - energy += energyReceived; - container.stackTagCompound.setInteger("Energy", energy); - } - return energyReceived; - } - - @Override - public int extractEnergy(ItemStack container, int maxExtract, boolean simulate) { - - if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("Energy")) { - return 0; - } - int energy = container.stackTagCompound.getInteger("Energy"); - int energyExtracted = Math.min(energy, Math.min(this.maxExtract, maxExtract)); - - if (!simulate) { - energy -= energyExtracted; - container.stackTagCompound.setInteger("Energy", energy); - } - return energyExtracted; - } - - @Override - public int getEnergyStored(ItemStack container) { - - if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("Energy")) { - return 0; - } - return container.stackTagCompound.getInteger("Energy"); - } - - @Override - public int getMaxEnergyStored(ItemStack container) { - - return capacity; - } - -} diff --git a/src/api/java/cofh/api/energy/TileEnergyHandler.java b/src/api/java/cofh/api/energy/TileEnergyHandler.java deleted file mode 100644 index 7cc655e..0000000 --- a/src/api/java/cofh/api/energy/TileEnergyHandler.java +++ /dev/null @@ -1,65 +0,0 @@ -package cofh.api.energy; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; - -/** - * Reference implementation of {@link IEnergyHandler}. Use/extend this or implement your own. - * - * @author King Lemming - * - */ -public class TileEnergyHandler extends TileEntity implements IEnergyHandler { - - protected EnergyStorage storage = new EnergyStorage(32000); - - @Override - public void readFromNBT(NBTTagCompound nbt) { - - super.readFromNBT(nbt); - storage.readFromNBT(nbt); - } - - @Override - public void writeToNBT(NBTTagCompound nbt) { - - super.writeToNBT(nbt); - storage.writeToNBT(nbt); - } - - /* IEnergyConnection */ - @Override - public boolean canConnectEnergy(ForgeDirection from) { - - return true; - } - - /* IEnergyReceiver */ - @Override - public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate) { - - return storage.receiveEnergy(maxReceive, simulate); - } - - /* IEnergyProvider */ - @Override - public int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate) { - - return storage.extractEnergy(maxExtract, simulate); - } - - /* IEnergyReceiver and IEnergyProvider */ - @Override - public int getEnergyStored(ForgeDirection from) { - - return storage.getEnergyStored(); - } - - @Override - public int getMaxEnergyStored(ForgeDirection from) { - - return storage.getMaxEnergyStored(); - } - -} diff --git a/src/api/java/cofh/api/energy/package-info.java b/src/api/java/cofh/api/energy/package-info.java deleted file mode 100644 index 7379702..0000000 --- a/src/api/java/cofh/api/energy/package-info.java +++ /dev/null @@ -1,10 +0,0 @@ -/** - * (C) 2014 Team CoFH / CoFH / Cult of the Full Hub - * http://www.teamcofh.com - */ -@API(apiVersion = CoFHAPIProps.VERSION, owner = "CoFHAPI", provides = "CoFHAPI|energy") -package cofh.api.energy; - -import cofh.api.CoFHAPIProps; -import cpw.mods.fml.common.API; - diff --git a/src/api/java/cofh/api/package-info.java b/src/api/java/cofh/api/package-info.java deleted file mode 100644 index 08ff5fc..0000000 --- a/src/api/java/cofh/api/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -/** - * (C) 2014 Team CoFH / CoFH / Cult of the Full Hub - * http://www.teamcofh.com - */ -@API(apiVersion = CoFHAPIProps.VERSION, owner = "CoFHLib", provides = "CoFHAPI") -package cofh.api; - -import cpw.mods.fml.common.API; - diff --git a/src/main/java/com/piepenguin/rfwindmill/RFWindmill.java b/src/main/java/com/piepenguin/rfwindmill/RFWindmill.java index 96915d3..9350206 100644 --- a/src/main/java/com/piepenguin/rfwindmill/RFWindmill.java +++ b/src/main/java/com/piepenguin/rfwindmill/RFWindmill.java @@ -6,6 +6,7 @@ import com.piepenguin.rfwindmill.lib.ModConfiguration; import com.piepenguin.rfwindmill.proxy.CommonProxy; import com.piepenguin.rfwindmill.recipes.ModRecipes; + import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; diff --git a/src/main/java/com/piepenguin/rfwindmill/blocks/ItemBlockWindmillBlock.java b/src/main/java/com/piepenguin/rfwindmill/blocks/ItemBlockWindmillBlock.java index 630a064..f4f60d1 100644 --- a/src/main/java/com/piepenguin/rfwindmill/blocks/ItemBlockWindmillBlock.java +++ b/src/main/java/com/piepenguin/rfwindmill/blocks/ItemBlockWindmillBlock.java @@ -18,7 +18,7 @@ public ItemBlockWindmillBlock(Block pBlock) { @Override public String getUnlocalizedName(ItemStack pItemStack) { String name; - switch(pItemStack.getItemDamage()) { + switch (pItemStack.getItemDamage()) { default: case 0: name = "basic"; diff --git a/src/main/java/com/piepenguin/rfwindmill/blocks/ModBlocks.java b/src/main/java/com/piepenguin/rfwindmill/blocks/ModBlocks.java index 38d1380..6b022cb 100644 --- a/src/main/java/com/piepenguin/rfwindmill/blocks/ModBlocks.java +++ b/src/main/java/com/piepenguin/rfwindmill/blocks/ModBlocks.java @@ -1,8 +1,9 @@ package com.piepenguin.rfwindmill.blocks; -import com.piepenguin.rfwindmill.lib.ModConfiguration; import net.minecraft.block.Block; +import com.piepenguin.rfwindmill.lib.ModConfiguration; + /** * Creates {@link Block} instances of all the blocks in the mod. */ diff --git a/src/main/java/com/piepenguin/rfwindmill/blocks/RotorBlock.java b/src/main/java/com/piepenguin/rfwindmill/blocks/RotorBlock.java index 1036f75..517e301 100644 --- a/src/main/java/com/piepenguin/rfwindmill/blocks/RotorBlock.java +++ b/src/main/java/com/piepenguin/rfwindmill/blocks/RotorBlock.java @@ -1,13 +1,5 @@ package com.piepenguin.rfwindmill.blocks; -import com.piepenguin.rfwindmill.lib.Constants; -import com.piepenguin.rfwindmill.lib.ModConfiguration; -import com.piepenguin.rfwindmill.lib.Util; -import com.piepenguin.rfwindmill.tileentities.TileEntityRotorBlock; -import com.piepenguin.rfwindmill.tileentities.TileEntityWindmillBlock; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; @@ -21,6 +13,15 @@ import net.minecraftforge.common.util.FakePlayer; import net.minecraftforge.common.util.ForgeDirection; +import com.piepenguin.rfwindmill.lib.Constants; +import com.piepenguin.rfwindmill.lib.Util; +import com.piepenguin.rfwindmill.tileentities.TileEntityRotorBlock; +import com.piepenguin.rfwindmill.tileentities.TileEntityWindmillBlock; + +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + /** * Rotor blocks are created when a {@link WindmillBlock} is right clicked with * a rotor item, and are necessary for the {@link WindmillBlock} to produce RF. @@ -42,7 +43,7 @@ public RotorBlock() { } public static String getMaterialName(int pRotorType) { - switch(pRotorType) { + switch (pRotorType) { default: case 0: return "rotorIron"; @@ -54,9 +55,10 @@ public static String getMaterialName(int pRotorType) { return (Util.useThermalFoundation() ? "rotorEnderium" : "rotorDiamond"); } } + @Override public void registerBlockIcons(IIconRegister pIconRegister) { - for(int i = 0; i < numIcons; ++i) { + for (int i = 0; i < numIcons; ++i) { icons[i] = pIconRegister.registerIcon(Constants.MODID + ":" + getMaterialName(i)); } } @@ -95,14 +97,16 @@ public TileEntity createNewTileEntity(World pWorld, int pMeta) { @Override public void onBlockHarvested(World pWorld, int pX, int pY, int pZ, int pSide, EntityPlayer pPlayer) { // Tell the parent windmill block that it no longer has a rotor - TileEntityRotorBlock rotorEntity = (TileEntityRotorBlock)pWorld.getTileEntity(pX, pY, pZ); - if(rotorEntity != null) { - ForgeDirection rotorDir = Util.intToDirection(rotorEntity.getBlockMetadata() & 3).getOpposite(); + TileEntityRotorBlock rotorEntity = (TileEntityRotorBlock) pWorld.getTileEntity(pX, pY, pZ); + if (rotorEntity != null) { + ForgeDirection rotorDir = Util.intToDirection(rotorEntity.getBlockMetadata() & 3) + .getOpposite(); int parentX = pX + rotorDir.offsetX; int parentY = pY + rotorDir.offsetY; int parentZ = pZ + rotorDir.offsetZ; - TileEntityWindmillBlock windmillEntity = (TileEntityWindmillBlock)pWorld.getTileEntity(parentX, parentY, parentZ); - if(windmillEntity != null) { + TileEntityWindmillBlock windmillEntity = (TileEntityWindmillBlock) pWorld + .getTileEntity(parentX, parentY, parentZ); + if (windmillEntity != null) { windmillEntity.setRotor(-1, ForgeDirection.NORTH); } } @@ -111,20 +115,22 @@ public void onBlockHarvested(World pWorld, int pX, int pY, int pZ, int pSide, En } @Override - public boolean onBlockActivated(World pWorld, int pX, int pY, int pZ, EntityPlayer pPlayer, int pSide, float pDx, float pDy, float pDz) { + public boolean onBlockActivated(World pWorld, int pX, int pY, int pZ, EntityPlayer pPlayer, int pSide, float pDx, + float pDy, float pDz) { // Cannot be activated by a block activator, must be a player - if(pPlayer == null || pPlayer instanceof FakePlayer) - { + if (pPlayer == null || pPlayer instanceof FakePlayer) { return false; } - TileEntityRotorBlock rotorEntity = (TileEntityRotorBlock)pWorld.getTileEntity(pX, pY, pZ); - if(rotorEntity != null) { - ForgeDirection rotorDir = Util.intToDirection(rotorEntity.getBlockMetadata() & 3).getOpposite(); + TileEntityRotorBlock rotorEntity = (TileEntityRotorBlock) pWorld.getTileEntity(pX, pY, pZ); + if (rotorEntity != null) { + ForgeDirection rotorDir = Util.intToDirection(rotorEntity.getBlockMetadata() & 3) + .getOpposite(); int parentX = pX + rotorDir.offsetX; int parentY = pY + rotorDir.offsetY; int parentZ = pZ + rotorDir.offsetZ; - TileEntityWindmillBlock windmillEntity = (TileEntityWindmillBlock)pWorld.getTileEntity(parentX, parentY, parentZ); - if(windmillEntity != null) { + TileEntityWindmillBlock windmillEntity = (TileEntityWindmillBlock) pWorld + .getTileEntity(parentX, parentY, parentZ); + if (windmillEntity != null) { windmillEntity.handcrank(); } } @@ -134,13 +140,14 @@ public boolean onBlockActivated(World pWorld, int pX, int pY, int pZ, EntityPlay /** * Remove the block from the world and drop the corresponding rotor as an * item. Does not notify the parent {@link WindmillBlock} of any changes. + * * @param pWorld Minecraft {@link World} - * @param pX X coordinate of the block - * @param pY Y coordinate of the block - * @param pZ Z coordinate of the block + * @param pX X coordinate of the block + * @param pY Y coordinate of the block + * @param pZ Z coordinate of the block */ public void dismantle(World pWorld, int pX, int pY, int pZ) { - TileEntityRotorBlock entity = (TileEntityRotorBlock)pWorld.getTileEntity(pX, pY, pZ); + TileEntityRotorBlock entity = (TileEntityRotorBlock) pWorld.getTileEntity(pX, pY, pZ); ItemStack itemStack = new ItemStack(entity.getRotorItem()); // Delete the block pWorld.setBlockToAir(pX, pY, pZ); @@ -155,32 +162,36 @@ public void dismantle(World pWorld, int pX, int pY, int pZ) { * Checks the area around the specified position for a 3x3x1 plane of free * blocks in the plane normal to the specified direction, which corresponds * to the bounding box of the rotor when its rendered. - * @param pWorld Minecraft {@link World} - * @param pX X coordinate where the block is trying to be placed - * @param pY Y coordinate where the block is trying to be placed - * @param pZ Z coordinate where the block is trying to be placed + * + * @param pWorld Minecraft {@link World} + * @param pX X coordinate where the block is trying to be placed + * @param pY Y coordinate where the block is trying to be placed + * @param pZ Z coordinate where the block is trying to be placed * @param pPlayer Player trying to place the block - * @param pDir Direction the rotor should be facing in + * @param pDir Direction the rotor should be facing in * @return {@code true} if the rotor can be placed, and {@code false} - * otherwise + * otherwise */ - public static boolean canPlace(World pWorld, int pX, int pY, int pZ, EntityPlayer pPlayer, ForgeDirection pDir ) { + public static boolean canPlace(World pWorld, int pX, int pY, int pZ, EntityPlayer pPlayer, ForgeDirection pDir) { // Check if air is free in a 3x3x1 space in the same plane as the rotor // This is hideous but I don't know enough Java to fix it :( - if(pWorld.isAirBlock(pX,pY+1,pZ) && pWorld.isAirBlock(pX,pY,pZ) && pWorld.isAirBlock(pX,pY-1,pZ)) { - if(pDir == ForgeDirection.NORTH || pDir == ForgeDirection.SOUTH) { + if (pWorld.isAirBlock(pX, pY + 1, pZ) && pWorld.isAirBlock(pX, pY, pZ) && pWorld.isAirBlock(pX, pY - 1, pZ)) { + if (pDir == ForgeDirection.NORTH || pDir == ForgeDirection.SOUTH) { // Need east/west i.e. xy plane - if(pWorld.isAirBlock(pX-1,pY+1,pZ) && pWorld.isAirBlock(pX+1,pY+1,pZ) && - pWorld.isAirBlock(pX-1,pY,pZ) && pWorld.isAirBlock(pX+1,pY,pZ) && - pWorld.isAirBlock(pX-1,pY-1,pZ) && pWorld.isAirBlock(pX+1,pY-1,pZ)) { + if (pWorld.isAirBlock(pX - 1, pY + 1, pZ) && pWorld.isAirBlock(pX + 1, pY + 1, pZ) + && pWorld.isAirBlock(pX - 1, pY, pZ) + && pWorld.isAirBlock(pX + 1, pY, pZ) + && pWorld.isAirBlock(pX - 1, pY - 1, pZ) + && pWorld.isAirBlock(pX + 1, pY - 1, pZ)) { return true; } - } - else { + } else { // Need north/south i.e. yz plane - if(pWorld.isAirBlock(pX,pY+1,pZ-1) && pWorld.isAirBlock(pX,pY+1,pZ+1) && - pWorld.isAirBlock(pX,pY,pZ-1) && pWorld.isAirBlock(pX,pY,pZ+1) && - pWorld.isAirBlock(pX,pY-1,pZ-1) && pWorld.isAirBlock(pX,pY-1,pZ+1)) { + if (pWorld.isAirBlock(pX, pY + 1, pZ - 1) && pWorld.isAirBlock(pX, pY + 1, pZ + 1) + && pWorld.isAirBlock(pX, pY, pZ - 1) + && pWorld.isAirBlock(pX, pY, pZ + 1) + && pWorld.isAirBlock(pX, pY - 1, pZ - 1) + && pWorld.isAirBlock(pX, pY - 1, pZ + 1)) { return true; } } diff --git a/src/main/java/com/piepenguin/rfwindmill/blocks/WindmillBlock.java b/src/main/java/com/piepenguin/rfwindmill/blocks/WindmillBlock.java index e499603..74fd0dd 100644 --- a/src/main/java/com/piepenguin/rfwindmill/blocks/WindmillBlock.java +++ b/src/main/java/com/piepenguin/rfwindmill/blocks/WindmillBlock.java @@ -1,14 +1,8 @@ package com.piepenguin.rfwindmill.blocks; -import com.google.common.base.Preconditions; -import com.piepenguin.rfwindmill.items.ModItems; -import com.piepenguin.rfwindmill.items.RFWItem; -import com.piepenguin.rfwindmill.lib.*; -import com.piepenguin.rfwindmill.tileentities.TileEntityRotorBlock; -import com.piepenguin.rfwindmill.tileentities.TileEntityWindmillBlock; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import java.util.Arrays; +import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.material.Material; @@ -26,8 +20,16 @@ import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import java.util.Arrays; -import java.util.List; +import com.google.common.base.Preconditions; +import com.piepenguin.rfwindmill.items.ModItems; +import com.piepenguin.rfwindmill.items.RFWItem; +import com.piepenguin.rfwindmill.lib.*; +import com.piepenguin.rfwindmill.tileentities.TileEntityRotorBlock; +import com.piepenguin.rfwindmill.tileentities.TileEntityWindmillBlock; + +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; /** * The main structural block of a windmill, handles creation of the @@ -59,7 +61,9 @@ public WindmillBlock(String pName, float[] pEfficiency, int[] pCapacity) { setStepSound(Block.soundTypeMetal); efficiency = pEfficiency; maximumEnergyTransfer = new int[efficiency.length]; - Arrays.fill(maximumEnergyTransfer, (int)(ModConfiguration.getWindGenerationBase() * ModConfiguration.getWindmillEnergyTransferMultiplier())); + Arrays.fill( + maximumEnergyTransfer, + (int) (ModConfiguration.getWindGenerationBase() * ModConfiguration.getWindmillEnergyTransferMultiplier())); capacity = pCapacity; name = pName; this.setBlockName(Constants.MODID + "_" + name); @@ -70,8 +74,8 @@ public WindmillBlock(String pName, float[] pEfficiency, int[] pCapacity) { @Override public void registerBlockIcons(IIconRegister pIconRegister) { - for(int i = 0; i < maxMeta; ++i) { - icons[i] = pIconRegister.registerIcon(Constants.MODID + ":" + name + (i+1) + "Side"); + for (int i = 0; i < maxMeta; ++i) { + icons[i] = pIconRegister.registerIcon(Constants.MODID + ":" + name + (i + 1) + "Side"); } } @@ -95,10 +99,10 @@ public int damageDropped(int pMeta) { return pMeta; } - @SuppressWarnings({"unchecked", "rawtypes"}) + @SuppressWarnings({ "unchecked", "rawtypes" }) @Override public void getSubBlocks(Item pItem, CreativeTabs pCreativeTabs, List list) { - for(int i = 0; i < maxMeta; ++i) { + for (int i = 0; i < maxMeta; ++i) { list.add(new ItemStack(pItem, 1, i)); } } @@ -107,38 +111,37 @@ public void getSubBlocks(Item pItem, CreativeTabs pCreativeTabs, List list) { public void onBlockPlacedBy(World pWorld, int pX, int pY, int pZ, EntityLivingBase pEntity, ItemStack pItemStack) { // If the ItemBlock version has energy stored in it then give the newly // created tile entity that energy - if(pItemStack.stackTagCompound != null) { - TileEntityWindmillBlock entity = (TileEntityWindmillBlock)pWorld.getTileEntity(pX, pY, pZ); + if (pItemStack.stackTagCompound != null) { + TileEntityWindmillBlock entity = (TileEntityWindmillBlock) pWorld.getTileEntity(pX, pY, pZ); entity.setEnergyStored(pItemStack.stackTagCompound.getInteger(EnergyStorage.NBT_ENERGY)); } super.onBlockPlacedBy(pWorld, pX, pY, pZ, pEntity, pItemStack); } @Override - public boolean onBlockActivated(World pWorld, int pX, int pY, int pZ, EntityPlayer pPlayer, int pSide, float pDx, float pDy, float pDz) { - if(!pWorld.isRemote) { - if(pPlayer.isSneaking()) { + public boolean onBlockActivated(World pWorld, int pX, int pY, int pZ, EntityPlayer pPlayer, int pSide, float pDx, + float pDy, float pDz) { + if (!pWorld.isRemote) { + if (pPlayer.isSneaking()) { // Dismantle block if player has a wrench - if(Util.hasWrench(pPlayer, pX, pY, pZ)) { + if (Util.hasWrench(pPlayer, pX, pY, pZ)) { dismantle(pWorld, pX, pY, pZ); return true; - } - else { + } else { // Print energy information otherwise printChatInfo(pWorld, pX, pY, pZ, pPlayer); return true; } - } - else { + } else { // Attach a rotor if the player is holding one ItemStack equippedItem = pPlayer.getCurrentEquippedItem(); - if(equippedItem != null && (equippedItem.getItem() == ModItems.rotor1 || - equippedItem.getItem() == ModItems.rotor2 || - equippedItem.getItem() == ModItems.rotor3 || - equippedItem.getItem() == ModItems.rotor4)) { + if (equippedItem != null + && (equippedItem.getItem() == ModItems.rotor1 || equippedItem.getItem() == ModItems.rotor2 + || equippedItem.getItem() == ModItems.rotor3 + || equippedItem.getItem() == ModItems.rotor4)) { // Get the direction offset of the face the player clicked ForgeDirection fDirection = ForgeDirection.getOrientation(pSide); - if(fDirection == ForgeDirection.DOWN || fDirection == ForgeDirection.UP) { + if (fDirection == ForgeDirection.DOWN || fDirection == ForgeDirection.UP) { return false; } int dx = pX + fDirection.offsetX; @@ -146,35 +149,31 @@ public boolean onBlockActivated(World pWorld, int pX, int pY, int pZ, EntityPlay int dz = pZ + fDirection.offsetZ; // Check that the tile entity for this block doesn't already have a rotor // and that a rotor can be placed at the offsset - TileEntityWindmillBlock entity = (TileEntityWindmillBlock)pWorld.getTileEntity(pX, pY, pZ); - if(RotorBlock.canPlace(pWorld, dx, dy, dz, pPlayer, fDirection) && !entity.hasRotor()) { + TileEntityWindmillBlock entity = (TileEntityWindmillBlock) pWorld.getTileEntity(pX, pY, pZ); + if (RotorBlock.canPlace(pWorld, dx, dy, dz, pPlayer, fDirection) && !entity.hasRotor()) { // Attach the rotor to the windmill - RFWItem equippedRotor = (RFWItem)equippedItem.getItem(); + RFWItem equippedRotor = (RFWItem) equippedItem.getItem(); pWorld.setBlock(dx, dy, dz, ModBlocks.rotorBlock1); pWorld.setBlockMetadataWithNotify(dx, dy, dz, Util.directionToInt(fDirection), 2); - TileEntityRotorBlock rotorEntity = (TileEntityRotorBlock)pWorld.getTileEntity(dx, dy, dz); + TileEntityRotorBlock rotorEntity = (TileEntityRotorBlock) pWorld.getTileEntity(dx, dy, dz); // No arbitrary switch statements :( int rotorType = -1; - if(equippedRotor == ModItems.rotor1) { + if (equippedRotor == ModItems.rotor1) { rotorType = 0; - } - else if(equippedRotor == ModItems.rotor2) { + } else if (equippedRotor == ModItems.rotor2) { rotorType = 1; - } - else if(equippedRotor == ModItems.rotor3) { + } else if (equippedRotor == ModItems.rotor3) { rotorType = 2; - } - else if(equippedRotor == ModItems.rotor4) { + } else if (equippedRotor == ModItems.rotor4) { rotorType = 3; } // Tell entities the rotor type rotorEntity.setType(rotorType); entity.setRotor(rotorType, fDirection); // Remove rotor from player's inventory - if(equippedItem.stackSize > 1) { + if (equippedItem.stackSize > 1) { equippedItem.stackSize -= 1; - } - else { + } else { pPlayer.destroyCurrentEquippedItem(); } } // Brace cascade of shame @@ -186,7 +185,7 @@ else if(equippedRotor == ModItems.rotor4) { @Override public void onBlockHarvested(World pWorld, int pX, int pY, int pZ, int pSide, EntityPlayer pPlayer) { - if(!pWorld.isRemote) { + if (!pWorld.isRemote) { dismantle(pWorld, pX, pY, pZ); } } @@ -195,33 +194,32 @@ public void onBlockHarvested(World pWorld, int pX, int pY, int pZ, int pSide, En * Removes the attached rotor (if there is one) and drops it the ground * and then removes this block and drops that too, making sure to save the * stored energy in the newly created {@link ItemStack} + * * @param pWorld Minecraft {@link World} - * @param pX X coordinate of this block - * @param pY Y coordinate of this block - * @param pZ Z coordinate of this block + * @param pX X coordinate of this block + * @param pY Y coordinate of this block + * @param pZ Z coordinate of this block */ private void dismantle(World pWorld, int pX, int pY, int pZ) { // Something has gone very wrong if this block doesn't have a tile entity - TileEntityWindmillBlock entity = (TileEntityWindmillBlock)pWorld.getTileEntity(pX, pY, pZ); + TileEntityWindmillBlock entity = (TileEntityWindmillBlock) pWorld.getTileEntity(pX, pY, pZ); Preconditions.checkNotNull(entity); // Remove the attached rotor, if there is one - if(entity.hasRotor()) { + if (entity.hasRotor()) { ForgeDirection dir = entity.getRotorDir(); - RotorBlock rotor = (RotorBlock)pWorld.getBlock( - pX + dir.offsetX, - pY + dir.offsetY, - pZ + dir.offsetZ); + RotorBlock rotor = (RotorBlock) pWorld.getBlock(pX + dir.offsetX, pY + dir.offsetY, pZ + dir.offsetZ); rotor.dismantle(pWorld, pX + dir.offsetX, pY + dir.offsetY, pZ + dir.offsetZ); } // Remove the actual turbine and drop it ItemStack itemStack = new ItemStack(this, 1, entity.getBlockMetadata()); int energy = entity.getEnergyStored(); - if(energy > 0) { - if(itemStack.getTagCompound() == null) { + if (energy > 0) { + if (itemStack.getTagCompound() == null) { itemStack.setTagCompound(new NBTTagCompound()); } - itemStack.getTagCompound().setInteger(EnergyStorage.NBT_ENERGY, energy); + itemStack.getTagCompound() + .setInteger(EnergyStorage.NBT_ENERGY, energy); } pWorld.setBlockToAir(pX, pY, pZ); EntityItem entityItem = new EntityItem(pWorld, pX + 0.5, pY + 0.5, pZ + 0.5, itemStack); @@ -233,20 +231,22 @@ private void dismantle(World pWorld, int pX, int pY, int pZ) { /** * Print the amount of energy stored in the windmill in RF and the amount * being produced in RF/t to the chat. - * @param pWorld Minecraft {@link World} - * @param pX X coordinate of this block - * @param pY Y coordinate of this block - * @param pZ Z coordinate of this block + * + * @param pWorld Minecraft {@link World} + * @param pX X coordinate of this block + * @param pY Y coordinate of this block + * @param pZ Z coordinate of this block * @param pPlayer Player whose chat the message should be printed to */ private void printChatInfo(World pWorld, int pX, int pY, int pZ, EntityPlayer pPlayer) { - TileEntityWindmillBlock entity = (TileEntityWindmillBlock)pWorld.getTileEntity(pX, pY, pZ); - String msg = String.format("%s: %d/%d RF %s: %.2f RF/t", - Lang.localise("energy.stored"), - entity.getEnergyStored(), - entity.getMaxEnergyStored(), - Lang.localise("energy.generating"), - entity.getCurrentEnergyGeneration()); + TileEntityWindmillBlock entity = (TileEntityWindmillBlock) pWorld.getTileEntity(pX, pY, pZ); + String msg = String.format( + "%s: %d/%d RF %s: %.2f RF/t", + Lang.localise("energy.stored"), + entity.getEnergyStored(), + entity.getMaxEnergyStored(), + Lang.localise("energy.generating"), + entity.getCurrentEnergyGeneration()); pPlayer.addChatMessage(new ChatComponentText(msg)); } } diff --git a/src/main/java/com/piepenguin/rfwindmill/items/ModItems.java b/src/main/java/com/piepenguin/rfwindmill/items/ModItems.java index e430993..1f93f57 100644 --- a/src/main/java/com/piepenguin/rfwindmill/items/ModItems.java +++ b/src/main/java/com/piepenguin/rfwindmill/items/ModItems.java @@ -1,6 +1,7 @@ package com.piepenguin.rfwindmill.items; import com.piepenguin.rfwindmill.lib.Constants; + import cpw.mods.fml.common.Loader; /** @@ -18,12 +19,11 @@ public final class ModItems { */ public static void init() { rotor1 = new RFWItem("rotorIron"); - if(Loader.isModLoaded(Constants.THERMAL_EXPANSION_MOD_ID)) { + if (Loader.isModLoaded(Constants.THERMAL_EXPANSION_MOD_ID)) { rotor2 = new RFWItem("rotorElectrum"); rotor3 = new RFWItem("rotorSignalum"); rotor4 = new RFWItem("rotorEnderium"); - } - else { + } else { rotor2 = new RFWItem("rotorGold"); rotor3 = new RFWItem("rotorNether"); rotor4 = new RFWItem("rotorDiamond"); diff --git a/src/main/java/com/piepenguin/rfwindmill/items/RFWItem.java b/src/main/java/com/piepenguin/rfwindmill/items/RFWItem.java index d00497e..a404c03 100644 --- a/src/main/java/com/piepenguin/rfwindmill/items/RFWItem.java +++ b/src/main/java/com/piepenguin/rfwindmill/items/RFWItem.java @@ -1,10 +1,12 @@ package com.piepenguin.rfwindmill.items; -import com.piepenguin.rfwindmill.lib.Constants; -import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; +import com.piepenguin.rfwindmill.lib.Constants; + +import cpw.mods.fml.common.registry.GameRegistry; + /** * Abstract class which all items from this mod should extend. Adds them to * creative tabs, and sets the name and texture from the name given in the diff --git a/src/main/java/com/piepenguin/rfwindmill/lib/Constants.java b/src/main/java/com/piepenguin/rfwindmill/lib/Constants.java index f9f4adf..332b794 100644 --- a/src/main/java/com/piepenguin/rfwindmill/lib/Constants.java +++ b/src/main/java/com/piepenguin/rfwindmill/lib/Constants.java @@ -4,6 +4,7 @@ * Contains various constants used by the mod, all pretty self-explanatory, */ public class Constants { + public static final String MODID = "rfwindmill"; public static final String NAME = "RFWindmill"; public static final String VERSION = "0.7c"; diff --git a/src/main/java/com/piepenguin/rfwindmill/lib/EnergyPacket.java b/src/main/java/com/piepenguin/rfwindmill/lib/EnergyPacket.java index 0ea3450..d15cc1f 100644 --- a/src/main/java/com/piepenguin/rfwindmill/lib/EnergyPacket.java +++ b/src/main/java/com/piepenguin/rfwindmill/lib/EnergyPacket.java @@ -1,24 +1,30 @@ package com.piepenguin.rfwindmill.lib; /** - *

Energy production is handled by producing energy packets, which have a total + *

+ * Energy production is handled by producing energy packets, which have a total * amount of energy and a lifetime. External factors such as wind or the player * create packets and send them to the generators. Over the lifetime of the * packet (in ticks) the machine will extract energy based on its efficiency. * This way the energy source is decoupled from the machine itself, allowing for * an easy energy-efficiency-based system and allowing multiple methods of - * generation can be handled by a single system.

+ * generation can be handled by a single system. + *

* - *

Machines should not accept new energy packets until they have dealt with + *

+ * Machines should not accept new energy packets until they have dealt with * their current one in general as packet build-up will lead to a long delay * after the machine should no longer be receiving power where it is still * processing the existing packets. This could be a feature in some situations * (such as nuclear reactors or burning fuel) but is unsuitable for renewable - * sources.

+ * sources. + *

* - *

Assuming a machine takes a single packet as described above the packet + *

+ * Assuming a machine takes a single packet as described above the packet * length can be used to lessen the load on the server, as the external energy - * production only has to be calculated after a packet has been depleted.

+ * production only has to be calculated after a packet has been depleted. + *

*/ public class EnergyPacket { @@ -60,27 +66,27 @@ public float getTotalEnergyStored() { /** * Get the amount of energy in the packet that should be released per tick. + * * @return 0 if the packet is empty, or an even fraction of total energy otherwise */ public float getEnergyPerTick() { - if(lifetime <= 0) { + if (lifetime <= 0) { return 0; - } - else { + } else { return energyStored / lifetime; } } /** * Reduce the lifetime of the packet by one tick. + * * @return true if the packet is depleted, false otherwise */ public boolean deplete() { - if(currentLifetime > 0) { + if (currentLifetime > 0) { --currentLifetime; return false; - } - else { + } else { return true; } } diff --git a/src/main/java/com/piepenguin/rfwindmill/lib/EnergyStorage.java b/src/main/java/com/piepenguin/rfwindmill/lib/EnergyStorage.java index e5f4944..460a9c5 100644 --- a/src/main/java/com/piepenguin/rfwindmill/lib/EnergyStorage.java +++ b/src/main/java/com/piepenguin/rfwindmill/lib/EnergyStorage.java @@ -1,8 +1,9 @@ package com.piepenguin.rfwindmill.lib; -import cofh.api.energy.IEnergyStorage; import net.minecraft.nbt.NBTTagCompound; +import cofh.api.energy.IEnergyStorage; + /** * Energy storage component of a machine, stores RF and handles RF transfer. * Should be included in any block that stores RF, i.e. @@ -46,7 +47,7 @@ public void readFromNBT(NBTTagCompound pNbt) { } public void writeToNBT(NBTTagCompound pNbt) { - if(energy < 0) { + if (energy < 0) { energy = 0; } pNbt.setInteger(NBT_CAPACITY, getMaxEnergyStored()); @@ -57,9 +58,9 @@ public void writeToNBT(NBTTagCompound pNbt) { @Override public int receiveEnergy(int pMaxReceive, boolean pSimulate) { - int energyReceived = Math.min(capacity - (int)energy, Math.min(maxReceive, pMaxReceive)); + int energyReceived = Math.min(capacity - (int) energy, Math.min(maxReceive, pMaxReceive)); - if(!pSimulate) { + if (!pSimulate) { energy += energyReceived; } @@ -68,9 +69,9 @@ public int receiveEnergy(int pMaxReceive, boolean pSimulate) { @Override public int extractEnergy(int pMaxExtract, boolean pSimulate) { - int energyExtracted = Math.min((int)energy, Math.min(maxExtract, pMaxExtract)); + int energyExtracted = Math.min((int) energy, Math.min(maxExtract, pMaxExtract)); - if(!pSimulate) { + if (!pSimulate) { energy -= energyExtracted; } @@ -80,31 +81,29 @@ public int extractEnergy(int pMaxExtract, boolean pSimulate) { public void modifyEnergyStored(float pEnergy) { energy += pEnergy; - if(energy > capacity) { + if (energy > capacity) { energy = capacity; - } - else if(energy < 0) { + } else if (energy < 0) { energy = 0; } } @Override public int getEnergyStored() { - return (int)energy; + return (int) energy; } public void setEnergyStored(int pEnergy) { energy = pEnergy; - if(energy > capacity) { + if (energy > capacity) { energy = capacity; - } - else if(energy < 0) { + } else if (energy < 0) { energy = 0; } } public int getExtract() { - return Math.min(maxExtract, (int)energy); + return Math.min(maxExtract, (int) energy); } @Override @@ -138,4 +137,3 @@ public void setMaxTransfer(int pMaxTransfer) { } } - diff --git a/src/main/java/com/piepenguin/rfwindmill/lib/Lang.java b/src/main/java/com/piepenguin/rfwindmill/lib/Lang.java index afd7cd6..0ca8034 100644 --- a/src/main/java/com/piepenguin/rfwindmill/lib/Lang.java +++ b/src/main/java/com/piepenguin/rfwindmill/lib/Lang.java @@ -10,6 +10,7 @@ public class Lang { /** * Localise the given info string. Used for info strings only, not block * names or textures. + * * @param pText identifier for the info string * @return Localised version of the string */ diff --git a/src/main/java/com/piepenguin/rfwindmill/lib/ModConfiguration.java b/src/main/java/com/piepenguin/rfwindmill/lib/ModConfiguration.java index 244c970..67ca618 100644 --- a/src/main/java/com/piepenguin/rfwindmill/lib/ModConfiguration.java +++ b/src/main/java/com/piepenguin/rfwindmill/lib/ModConfiguration.java @@ -1,10 +1,12 @@ package com.piepenguin.rfwindmill.lib; -import com.google.common.base.Preconditions; -import cpw.mods.fml.common.FMLCommonHandler; +import java.io.File; + import net.minecraftforge.common.config.Configuration; -import java.io.File; +import com.google.common.base.Preconditions; + +import cpw.mods.fml.common.FMLCommonHandler; /** * Handles configuration of the mod via a configuration file, and sets up the @@ -27,10 +29,12 @@ public class ModConfiguration { private static float angularVelocityPerRF; public static void init(File pConfigFile) { - if(pConfigFile != null) { + if (pConfigFile != null) { config = new Configuration(pConfigFile); } - FMLCommonHandler.instance().bus().register(new ModConfiguration()); + FMLCommonHandler.instance() + .bus() + .register(new ModConfiguration()); loadConfig(); } @@ -40,78 +44,98 @@ public static void init(File pConfigFile) { */ private static void loadConfig() { Preconditions.checkNotNull(config); - forceVanillaRecipes = config.get(Configuration.CATEGORY_GENERAL, + forceVanillaRecipes = config + .get( + Configuration.CATEGORY_GENERAL, "ForceVanillaRecipes", false, - "Ignore Thermal Expansion and use Vanilla recipes instead").getBoolean(); - forceIronRotor = config.get(Configuration.CATEGORY_GENERAL, + "Ignore Thermal Expansion and use Vanilla recipes instead") + .getBoolean(); + forceIronRotor = config + .get( + Configuration.CATEGORY_GENERAL, "ForceIronRotorTexture", false, - "Use the iron rotor texture regardless of the rotor material").getBoolean(); - windGenerationBase = (float)config.get(Configuration.CATEGORY_GENERAL, - "WindGenerationBase", - 40.0, - "The amount of energy in the wind in RF/t").getDouble(); - windmillEfficiency[0] = (float)config.get(Configuration.CATEGORY_GENERAL, + "Use the iron rotor texture regardless of the rotor material") + .getBoolean(); + windGenerationBase = (float) config + .get(Configuration.CATEGORY_GENERAL, "WindGenerationBase", 40.0, "The amount of energy in the wind in RF/t") + .getDouble(); + windmillEfficiency[0] = (float) config + .get( + Configuration.CATEGORY_GENERAL, "WindmillBasicEfficiency", 0.1, - "How good the windmill is at extracting energy from the wind").getDouble(); - windmillEfficiency[1] = (float)config.get(Configuration.CATEGORY_GENERAL, - "WindmillHardenedEfficiency", - 0.3).getDouble(); - windmillEfficiency[2] = (float)config.get(Configuration.CATEGORY_GENERAL, - "WindmillReinforcedEfficiency", - 0.6).getDouble(); - windmillEfficiency[3] = (float)config.get(Configuration.CATEGORY_GENERAL, - "WindmillResonantEfficiency", - 0.9).getDouble(); - windmillEnergyStorage[0] = config.get(Configuration.CATEGORY_GENERAL, + "How good the windmill is at extracting energy from the wind") + .getDouble(); + windmillEfficiency[1] = (float) config.get(Configuration.CATEGORY_GENERAL, "WindmillHardenedEfficiency", 0.3) + .getDouble(); + windmillEfficiency[2] = (float) config.get(Configuration.CATEGORY_GENERAL, "WindmillReinforcedEfficiency", 0.6) + .getDouble(); + windmillEfficiency[3] = (float) config.get(Configuration.CATEGORY_GENERAL, "WindmillResonantEfficiency", 0.9) + .getDouble(); + windmillEnergyStorage[0] = config + .get( + Configuration.CATEGORY_GENERAL, "WindmillBasicEnergyStorage", 16000, - "Energy storage capacity of the windmill in RF").getInt(); - windmillEnergyStorage[1] = config.get(Configuration.CATEGORY_GENERAL, - "WindmillHardenedEnergyStorage", - 32000).getInt(); - windmillEnergyStorage[2] = config.get(Configuration.CATEGORY_GENERAL, - "WindmillReinforcedEnergyStorage", - 48000).getInt(); - windmillEnergyStorage[3] = config.get(Configuration.CATEGORY_GENERAL, - "WindmillResonantEnergyStorage", - 64000).getInt(); - windmillEnergyTransferMultiplier = config.get(Configuration.CATEGORY_GENERAL, + "Energy storage capacity of the windmill in RF") + .getInt(); + windmillEnergyStorage[1] = config.get(Configuration.CATEGORY_GENERAL, "WindmillHardenedEnergyStorage", 32000) + .getInt(); + windmillEnergyStorage[2] = config.get(Configuration.CATEGORY_GENERAL, "WindmillReinforcedEnergyStorage", 48000) + .getInt(); + windmillEnergyStorage[3] = config.get(Configuration.CATEGORY_GENERAL, "WindmillResonantEnergyStorage", 64000) + .getInt(); + windmillEnergyTransferMultiplier = config + .get( + Configuration.CATEGORY_GENERAL, "WindmillEnergyTransferMultiplier", 4, - "Multiply by the base wind energy generation to get the rate of energy transfer in RF/t").getInt(); - rotorEnergyMultiplier[0] = config.get(Configuration.CATEGORY_GENERAL, + "Multiply by the base wind energy generation to get the rate of energy transfer in RF/t") + .getInt(); + rotorEnergyMultiplier[0] = config + .get( + Configuration.CATEGORY_GENERAL, "RotorBasicEnergyMultiplier", 0.625, - "Multiplier applied to the windmill generation due to the rotor").getDouble(); - rotorEnergyMultiplier[1] = config.get(Configuration.CATEGORY_GENERAL, - "RotorHardenedEnergyMultiplier", - 0.75).getDouble(); - rotorEnergyMultiplier[2] = config.get(Configuration.CATEGORY_GENERAL, - "RotorReinforcedEnergyMultiplier", - 0.875).getDouble(); - rotorEnergyMultiplier[3] = config.get(Configuration.CATEGORY_GENERAL, - "RotorResonantEnergyMultiplier", - 1.0).getDouble(); - weatherMultiplierRain = config.get(Configuration.CATEGORY_GENERAL, + "Multiplier applied to the windmill generation due to the rotor") + .getDouble(); + rotorEnergyMultiplier[1] = config.get(Configuration.CATEGORY_GENERAL, "RotorHardenedEnergyMultiplier", 0.75) + .getDouble(); + rotorEnergyMultiplier[2] = config.get(Configuration.CATEGORY_GENERAL, "RotorReinforcedEnergyMultiplier", 0.875) + .getDouble(); + rotorEnergyMultiplier[3] = config.get(Configuration.CATEGORY_GENERAL, "RotorResonantEnergyMultiplier", 1.0) + .getDouble(); + weatherMultiplierRain = config + .get( + Configuration.CATEGORY_GENERAL, "WeatherRainEnergyGenerationMultiplier", 1.2, - "Multiplier applied to the windmill generation when it's raining").getDouble(); - weatherMultiplierThunder = config.get(Configuration.CATEGORY_GENERAL, + "Multiplier applied to the windmill generation when it's raining") + .getDouble(); + weatherMultiplierThunder = config + .get( + Configuration.CATEGORY_GENERAL, "WeatherThunderEnergyGenerationMultiplier", 1.5, - "Multiplier applied to the windmill generation when it's raining").getDouble(); - handcrankEnergyMultiplier = config.get(Configuration.CATEGORY_GENERAL, + "Multiplier applied to the windmill generation when it's raining") + .getDouble(); + handcrankEnergyMultiplier = config + .get( + Configuration.CATEGORY_GENERAL, "HandcrankEnergyMultiplier", 0.4, - "Multiplier applied to energy generation when turning rotors by hand").getDouble(); - angularVelocityPerRF = (float)config.get(Configuration.CATEGORY_GENERAL, + "Multiplier applied to energy generation when turning rotors by hand") + .getDouble(); + angularVelocityPerRF = (float) config + .get( + Configuration.CATEGORY_GENERAL, "AngularVelocityPerRF", 0.5, - "Degrees per RF per tick that the rotor rotates by").getDouble(); - if(config.hasChanged()) { + "Degrees per RF per tick that the rotor rotates by") + .getDouble(); + if (config.hasChanged()) { config.save(); } } @@ -137,19 +161,19 @@ public static int getWindmillEnergyTransferMultiplier() { } public static float getRotorEnergyMultiplier(int pType) { - return (float)rotorEnergyMultiplier[pType]; + return (float) rotorEnergyMultiplier[pType]; } public static float getWeatherMultiplierRain() { - return (float)weatherMultiplierRain; + return (float) weatherMultiplierRain; } public static float getWeatherMultiplierThunder() { - return (float)weatherMultiplierThunder; + return (float) weatherMultiplierThunder; } public static float getHandcrankEnergyMultiplier() { - return (float)handcrankEnergyMultiplier; + return (float) handcrankEnergyMultiplier; } public static float getWindGenerationBase() { diff --git a/src/main/java/com/piepenguin/rfwindmill/lib/Util.java b/src/main/java/com/piepenguin/rfwindmill/lib/Util.java index 411c229..12faac8 100644 --- a/src/main/java/com/piepenguin/rfwindmill/lib/Util.java +++ b/src/main/java/com/piepenguin/rfwindmill/lib/Util.java @@ -1,12 +1,13 @@ package com.piepenguin.rfwindmill.lib; -import buildcraft.api.tools.IToolWrench; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.ModAPIManager; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; +import buildcraft.api.tools.IToolWrench; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.ModAPIManager; + /** * Various useful functions that are used throughout the codebase. */ @@ -14,32 +15,34 @@ public class Util { /** * Checks if the player is currently wielding a Buildcraft-compatible wrench + * * @param pPlayer Player who might be holding the wrench - * @param pX X coordinate of the position trying to be wrenched - * @param pY Y coordinate of the position trying to be wrenched - * @param pZ Z coordinate of the position trying to be wrenched + * @param pX X coordinate of the position trying to be wrenched + * @param pY Y coordinate of the position trying to be wrenched + * @param pZ Z coordinate of the position trying to be wrenched * @return {@code true} if the player can wrench and {@code false} otherwise */ public static boolean hasWrench(EntityPlayer pPlayer, int pX, int pY, int pZ) { ItemStack tool = pPlayer.getCurrentEquippedItem(); - return tool != null && (ModAPIManager.INSTANCE.hasAPI("BuildCraftAPI|tools") && - (tool.getItem() instanceof IToolWrench) && - ((IToolWrench)tool.getItem()).canWrench(pPlayer, pX, pY, pZ)); + return tool != null + && (ModAPIManager.INSTANCE.hasAPI("BuildCraftAPI|tools") && (tool.getItem() instanceof IToolWrench) + && ((IToolWrench) tool.getItem()).canWrench(pPlayer, pX, pY, pZ)); } /** * Convert an integer 0-3 into a Forge direction in the xz plane according to *
    - *
  • 0 -> North
  • - *
  • 1 -> East
  • - *
  • 2 -> South
  • - *
  • 3 -> West
  • + *
  • 0 -> North
  • + *
  • 1 -> East
  • + *
  • 2 -> South
  • + *
  • 3 -> West
  • *
+ * * @param pDir Integer representing a direction in the xz plane * @return Forge direction corresponding to that direction */ public static ForgeDirection intToDirection(int pDir) { - switch(pDir) { + switch (pDir) { case 0: return ForgeDirection.NORTH; case 1: @@ -56,31 +59,28 @@ public static ForgeDirection intToDirection(int pDir) { /** * Convert a Forge direction in the xz plane into an integer 0-3 according to *
    - *
  • North -> 0
  • - *
  • East -> 1
  • - *
  • South -> 2
  • - *
  • West -> 3
  • + *
  • North -> 0
  • + *
  • East -> 1
  • + *
  • South -> 2
  • + *
  • West -> 3
  • *
+ * * @param pDir Forge direction in the xz plane * @return Integer representing that direction */ public static int directionToInt(ForgeDirection pDir) { - if(pDir == ForgeDirection.NORTH) - return 0; - else if(pDir == ForgeDirection.EAST) - return 1; - else if(pDir == ForgeDirection.SOUTH) - return 2; - else if(pDir == ForgeDirection.WEST) - return 3; - else - return 0; + if (pDir == ForgeDirection.NORTH) return 0; + else if (pDir == ForgeDirection.EAST) return 1; + else if (pDir == ForgeDirection.SOUTH) return 2; + else if (pDir == ForgeDirection.WEST) return 3; + else return 0; } /** * Checks if Thermal Expansion features should be used + * * @return {@code true} if Thermal Expansion is loaded and the recipes - * aren't disabled and {@code false} otherwise + * aren't disabled and {@code false} otherwise */ public static boolean useThermalExpansion() { return Loader.isModLoaded(Constants.THERMAL_EXPANSION_MOD_ID) && !ModConfiguration.useVanillaRecipes(); @@ -88,8 +88,9 @@ public static boolean useThermalExpansion() { /** * Checks if Thermal Foundation features should be used + * * @return {@code true} if Thermal Foundation is loaded and the recipes - * aren't disabled, and {@code false} otherwise + * aren't disabled, and {@code false} otherwise */ public static boolean useThermalFoundation() { return Loader.isModLoaded(Constants.THERMAL_FOUNDATION_MOD_ID) && !ModConfiguration.useVanillaRecipes(); @@ -97,6 +98,7 @@ public static boolean useThermalFoundation() { /** * Returns the number of ticks one right click cycle takes. + * * @return Ticks in a player click cycle */ public static int ticksPerClick() { diff --git a/src/main/java/com/piepenguin/rfwindmill/proxy/ClientProxy.java b/src/main/java/com/piepenguin/rfwindmill/proxy/ClientProxy.java index a93aed5..3a951b7 100644 --- a/src/main/java/com/piepenguin/rfwindmill/proxy/ClientProxy.java +++ b/src/main/java/com/piepenguin/rfwindmill/proxy/ClientProxy.java @@ -2,6 +2,7 @@ import com.piepenguin.rfwindmill.tileentities.RenderTileEntityRotorBlock; import com.piepenguin.rfwindmill.tileentities.TileEntityRotorBlock; + import cpw.mods.fml.client.registry.ClientRegistry; public class ClientProxy extends CommonProxy { diff --git a/src/main/java/com/piepenguin/rfwindmill/proxy/CommonProxy.java b/src/main/java/com/piepenguin/rfwindmill/proxy/CommonProxy.java index afce245..7656115 100644 --- a/src/main/java/com/piepenguin/rfwindmill/proxy/CommonProxy.java +++ b/src/main/java/com/piepenguin/rfwindmill/proxy/CommonProxy.java @@ -2,6 +2,7 @@ import com.piepenguin.rfwindmill.tileentities.TileEntityRotorBlock; import com.piepenguin.rfwindmill.tileentities.TileEntityWindmillBlock; + import cpw.mods.fml.common.registry.GameRegistry; public class CommonProxy { diff --git a/src/main/java/com/piepenguin/rfwindmill/recipes/ModRecipes.java b/src/main/java/com/piepenguin/rfwindmill/recipes/ModRecipes.java index 272dc9f..0bbe716 100644 --- a/src/main/java/com/piepenguin/rfwindmill/recipes/ModRecipes.java +++ b/src/main/java/com/piepenguin/rfwindmill/recipes/ModRecipes.java @@ -1,5 +1,10 @@ package com.piepenguin.rfwindmill.recipes; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; +import net.minecraftforge.oredict.ShapedOreRecipe; import com.google.common.base.Preconditions; import com.piepenguin.rfwindmill.blocks.ModBlocks; @@ -7,12 +12,8 @@ import com.piepenguin.rfwindmill.lib.Constants; import com.piepenguin.rfwindmill.lib.ModConfiguration; import com.piepenguin.rfwindmill.lib.Util; + import cpw.mods.fml.common.registry.GameRegistry; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import net.minecraftforge.oredict.ShapedOreRecipe; /** * Contains methods to register the recipes for all the items and blocks in the @@ -29,16 +30,14 @@ public class ModRecipes { */ public static void init() { registerCommonRecipes(); - if(Util.useThermalFoundation() && !ModConfiguration.useVanillaRecipes()) { + if (Util.useThermalFoundation() && !ModConfiguration.useVanillaRecipes()) { registerThermalFoundationRotors(); - } - else { + } else { registerVanillaRotors(); } - if(Util.useThermalExpansion() && !ModConfiguration.useVanillaRecipes()) { + if (Util.useThermalExpansion() && !ModConfiguration.useVanillaRecipes()) { registerThermalExpansionTurbines(); - } - else { + } else { registerVanillaTurbines(); } } @@ -59,77 +58,261 @@ private static void registerCommonRecipes() { private static void registerVanillaTurbines() { String ingotTin = getOreWithFallback("ingotTin", "ingotIron"); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.windmillBlock, 1, 0), " x ", "ibi", "ixi", 'x', "dustRedstone", 'i', ingotTin, 'b', "blockIron")); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.windmillBlock, 1, 1), " x ", "ibi", "ixi", 'x', "dustRedstone", 'i', "ingotGold", 'b', "blockIron")); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.windmillBlock, 1, 2), " x ", "ibi", "oxo", 'x', "dustRedstone", 'i', Blocks.quartz_block, 'o', Blocks.obsidian, 'b', "blockIron")); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.windmillBlock, 1, 3), " x ", "dbd", "ixi", 'x', "dustRedstone", 'd', "gemDiamond", 'i', "ingotGold", 'b', "blockIron")); + GameRegistry.addRecipe( + new ShapedOreRecipe( + new ItemStack(ModBlocks.windmillBlock, 1, 0), + " x ", + "ibi", + "ixi", + 'x', + "dustRedstone", + 'i', + ingotTin, + 'b', + "blockIron")); + GameRegistry.addRecipe( + new ShapedOreRecipe( + new ItemStack(ModBlocks.windmillBlock, 1, 1), + " x ", + "ibi", + "ixi", + 'x', + "dustRedstone", + 'i', + "ingotGold", + 'b', + "blockIron")); + GameRegistry.addRecipe( + new ShapedOreRecipe( + new ItemStack(ModBlocks.windmillBlock, 1, 2), + " x ", + "ibi", + "oxo", + 'x', + "dustRedstone", + 'i', + Blocks.quartz_block, + 'o', + Blocks.obsidian, + 'b', + "blockIron")); + GameRegistry.addRecipe( + new ShapedOreRecipe( + new ItemStack(ModBlocks.windmillBlock, 1, 3), + " x ", + "dbd", + "ixi", + 'x', + "dustRedstone", + 'd', + "gemDiamond", + 'i', + "ingotGold", + 'b', + "blockIron")); // Add upgrade recipes - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.windmillBlock, 1, 1), "i i", " b ", "i i", 'i', "ingotGold", 'b', new ItemStack(ModBlocks.windmillBlock, 1, 0))); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.windmillBlock, 1, 2), "i i", " b ", "o o", 'i', Blocks.quartz_block, 'o', Blocks.obsidian, 'b', new ItemStack(ModBlocks.windmillBlock, 1, 1))); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.windmillBlock, 1, 3), "d d", " b ", "i i", 'i', "ingotGold", 'd', "gemDiamond", 'b', new ItemStack(ModBlocks.windmillBlock, 1, 2))); + GameRegistry.addRecipe( + new ShapedOreRecipe( + new ItemStack(ModBlocks.windmillBlock, 1, 1), + "i i", + " b ", + "i i", + 'i', + "ingotGold", + 'b', + new ItemStack(ModBlocks.windmillBlock, 1, 0))); + GameRegistry.addRecipe( + new ShapedOreRecipe( + new ItemStack(ModBlocks.windmillBlock, 1, 2), + "i i", + " b ", + "o o", + 'i', + Blocks.quartz_block, + 'o', + Blocks.obsidian, + 'b', + new ItemStack(ModBlocks.windmillBlock, 1, 1))); + GameRegistry.addRecipe( + new ShapedOreRecipe( + new ItemStack(ModBlocks.windmillBlock, 1, 3), + "d d", + " b ", + "i i", + 'i', + "ingotGold", + 'd', + "gemDiamond", + 'b', + new ItemStack(ModBlocks.windmillBlock, 1, 2))); } /** * Register vanilla rotor recipes. Called when Thermal Foundation is not * loaded or vanilla recipes are forced. Rotor types created are *
    - *
  • Gold Rotor
  • - *
  • Nether Rotor
  • - *
  • Diamond Rotor
  • + *
  • Gold Rotor
  • + *
  • Nether Rotor
  • + *
  • Diamond Rotor
  • *
*/ private static void registerVanillaRotors() { - GameRegistry.addRecipe(new ShapedOreRecipe(ModItems.rotor2, "g ", "gig", " g", 'i', "ingotIron", 'g', "ingotGold")); - GameRegistry.addRecipe(new ShapedOreRecipe(ModItems.rotor3, "n ", "non", " n", 'n', Items.quartz, 'o', Blocks.obsidian)); - GameRegistry.addRecipe(new ShapedOreRecipe(ModItems.rotor4, "d ", "dgd", " d", 'd', "gemDiamond", 'g', "ingotGold")); + GameRegistry + .addRecipe(new ShapedOreRecipe(ModItems.rotor2, "g ", "gig", " g", 'i', "ingotIron", 'g', "ingotGold")); + GameRegistry.addRecipe( + new ShapedOreRecipe(ModItems.rotor3, "n ", "non", " n", 'n', Items.quartz, 'o', Blocks.obsidian)); + GameRegistry + .addRecipe(new ShapedOreRecipe(ModItems.rotor4, "d ", "dgd", " d", 'd', "gemDiamond", 'g', "ingotGold")); } /** * Register Thermal Foundation rotor recipes. Rotor types are *
    - *
  • Electrum Rotor
  • - *
  • Signalum Rotor
  • - *
  • Enderium Rotor
  • + *
  • Electrum Rotor
  • + *
  • Signalum Rotor
  • + *
  • Enderium Rotor
  • *
*/ private static void registerThermalFoundationRotors() { - GameRegistry.addRecipe(new ShapedOreRecipe(ModItems.rotor2, "e ", "eie", " e", 'i', "ingotInvar", 'e', "ingotElectrum")); - GameRegistry.addRecipe(new ShapedOreRecipe(ModItems.rotor3, "s ", "ses", " s", 's', "ingotSignalum", 'e', "ingotElectrum")); - GameRegistry.addRecipe(new ShapedOreRecipe(ModItems.rotor4, "e ", "eie", " e", 'e', "ingotEnderium", 'i', "ingotInvar")); + GameRegistry.addRecipe( + new ShapedOreRecipe(ModItems.rotor2, "e ", "eie", " e", 'i', "ingotInvar", 'e', "ingotElectrum")); + GameRegistry.addRecipe( + new ShapedOreRecipe(ModItems.rotor3, "s ", "ses", " s", 's', "ingotSignalum", 'e', "ingotElectrum")); + GameRegistry.addRecipe( + new ShapedOreRecipe(ModItems.rotor4, "e ", "eie", " e", 'e', "ingotEnderium", 'i', "ingotInvar")); } /** * Register Thermal Expansion turbine recipes. */ private static void registerThermalExpansionTurbines() { - ItemStack powerCoilSilver = Preconditions.checkNotNull(GameRegistry.findItemStack(Constants.THERMAL_EXPANSION_MOD_ID, "powerCoilSilver", 1)); - ItemStack machineFrameBasic = Preconditions.checkNotNull(GameRegistry.findItemStack(Constants.THERMAL_EXPANSION_MOD_ID, "frameMachineBasic", 1)); - ItemStack machineFrameHardened = Preconditions.checkNotNull(GameRegistry.findItemStack(Constants.THERMAL_EXPANSION_MOD_ID, "frameMachineHardened", 1)); - ItemStack machineFrameReinforced = Preconditions.checkNotNull(GameRegistry.findItemStack(Constants.THERMAL_EXPANSION_MOD_ID, "frameMachineReinforced", 1)); - ItemStack machineFrameResonant = Preconditions.checkNotNull(GameRegistry.findItemStack(Constants.THERMAL_EXPANSION_MOD_ID, "frameMachineResonant", 1)); - ItemStack hardenedGlass = Preconditions.checkNotNull(GameRegistry.findItemStack(Constants.THERMAL_EXPANSION_MOD_ID, "Glass", 1)); + ItemStack powerCoilSilver = Preconditions + .checkNotNull(GameRegistry.findItemStack(Constants.THERMAL_EXPANSION_MOD_ID, "powerCoilSilver", 1)); + ItemStack machineFrameBasic = Preconditions + .checkNotNull(GameRegistry.findItemStack(Constants.THERMAL_EXPANSION_MOD_ID, "frameMachineBasic", 1)); + ItemStack machineFrameHardened = Preconditions + .checkNotNull(GameRegistry.findItemStack(Constants.THERMAL_EXPANSION_MOD_ID, "frameMachineHardened", 1)); + ItemStack machineFrameReinforced = Preconditions + .checkNotNull(GameRegistry.findItemStack(Constants.THERMAL_EXPANSION_MOD_ID, "frameMachineReinforced", 1)); + ItemStack machineFrameResonant = Preconditions + .checkNotNull(GameRegistry.findItemStack(Constants.THERMAL_EXPANSION_MOD_ID, "frameMachineResonant", 1)); + ItemStack hardenedGlass = Preconditions + .checkNotNull(GameRegistry.findItemStack(Constants.THERMAL_EXPANSION_MOD_ID, "Glass", 1)); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.windmillBlock, 1, 0), " x ", "imi", " c ", 'x', "dustRedstone", 'i', "ingotTin", 'm', machineFrameBasic, 'c', powerCoilSilver)); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.windmillBlock, 1, 1), " x ", "imi", " c ", 'x', "dustRedstone", 'i', "ingotInvar", 'm', machineFrameHardened, 'c', powerCoilSilver)); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.windmillBlock, 1, 2), " x ", "imi", " c ", 'x', "dustRedstone", 'i', "ingotSilver", 'm', machineFrameReinforced, 'c', powerCoilSilver)); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.windmillBlock, 1, 3), " x ", "imi", " c ", 'x', "dustRedstone", 'i', "ingotPlatinum", 'm', machineFrameResonant, 'c', powerCoilSilver)); + GameRegistry.addRecipe( + new ShapedOreRecipe( + new ItemStack(ModBlocks.windmillBlock, 1, 0), + " x ", + "imi", + " c ", + 'x', + "dustRedstone", + 'i', + "ingotTin", + 'm', + machineFrameBasic, + 'c', + powerCoilSilver)); + GameRegistry.addRecipe( + new ShapedOreRecipe( + new ItemStack(ModBlocks.windmillBlock, 1, 1), + " x ", + "imi", + " c ", + 'x', + "dustRedstone", + 'i', + "ingotInvar", + 'm', + machineFrameHardened, + 'c', + powerCoilSilver)); + GameRegistry.addRecipe( + new ShapedOreRecipe( + new ItemStack(ModBlocks.windmillBlock, 1, 2), + " x ", + "imi", + " c ", + 'x', + "dustRedstone", + 'i', + "ingotSilver", + 'm', + machineFrameReinforced, + 'c', + powerCoilSilver)); + GameRegistry.addRecipe( + new ShapedOreRecipe( + new ItemStack(ModBlocks.windmillBlock, 1, 3), + " x ", + "imi", + " c ", + 'x', + "dustRedstone", + 'i', + "ingotPlatinum", + 'm', + machineFrameResonant, + 'c', + powerCoilSilver)); // Add upgrade recipes - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.windmillBlock, 1, 1), "igi", "jmj", "i i", 'i', "ingotInvar", 'j', "ingotInvar", 'g', "gearElectrum", 'm', new ItemStack(ModBlocks.windmillBlock, 1, 0))); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.windmillBlock, 1, 2), "igi", "jmj", "i i", 'i', hardenedGlass, 'j', "ingotSilver", 'g', "gearSignalum", 'm', new ItemStack(ModBlocks.windmillBlock, 1, 1))); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.windmillBlock, 1, 3), "igi", "jmj", "i i", 'i', "ingotSilver", 'j', "ingotPlatinum", 'g', "gearEnderium", 'm', new ItemStack(ModBlocks.windmillBlock, 1, 2))); + GameRegistry.addRecipe( + new ShapedOreRecipe( + new ItemStack(ModBlocks.windmillBlock, 1, 1), + "igi", + "jmj", + "i i", + 'i', + "ingotInvar", + 'j', + "ingotInvar", + 'g', + "gearElectrum", + 'm', + new ItemStack(ModBlocks.windmillBlock, 1, 0))); + GameRegistry.addRecipe( + new ShapedOreRecipe( + new ItemStack(ModBlocks.windmillBlock, 1, 2), + "igi", + "jmj", + "i i", + 'i', + hardenedGlass, + 'j', + "ingotSilver", + 'g', + "gearSignalum", + 'm', + new ItemStack(ModBlocks.windmillBlock, 1, 1))); + GameRegistry.addRecipe( + new ShapedOreRecipe( + new ItemStack(ModBlocks.windmillBlock, 1, 3), + "igi", + "jmj", + "i i", + 'i', + "ingotSilver", + 'j', + "ingotPlatinum", + 'g', + "gearEnderium", + 'm', + new ItemStack(ModBlocks.windmillBlock, 1, 2))); } /** * Attempt to find the {@code pOre} in the Forge ore dictionary and return * it if found otherwise return the {@code pFallback} - * @param pOre Ore name to search for (not necessarily an ore) + * + * @param pOre Ore name to search for (not necessarily an ore) * @param pFallback Material to fall back to if the {@code pOre} wasn't found * @return {@code pOre} if it's in the dictionary, {@code fallback} otherwise */ public static String getOreWithFallback(String pOre, String pFallback) { - if(OreDictionary.getOres(pOre).isEmpty()) { + if (OreDictionary.getOres(pOre) + .isEmpty()) { return pFallback; } return pOre; diff --git a/src/main/java/com/piepenguin/rfwindmill/tileentities/RenderTileEntityRotorBlock.java b/src/main/java/com/piepenguin/rfwindmill/tileentities/RenderTileEntityRotorBlock.java index 7867ace..702343f 100644 --- a/src/main/java/com/piepenguin/rfwindmill/tileentities/RenderTileEntityRotorBlock.java +++ b/src/main/java/com/piepenguin/rfwindmill/tileentities/RenderTileEntityRotorBlock.java @@ -1,13 +1,15 @@ package com.piepenguin.rfwindmill.tileentities; -import com.piepenguin.rfwindmill.lib.Constants; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.model.AdvancedModelLoader; import net.minecraftforge.client.model.IModelCustom; + import org.lwjgl.opengl.GL11; +import com.piepenguin.rfwindmill.lib.Constants; + /** * Handles custom rendering of {@link com.piepenguin.rfwindmill.blocks.RotorBlock} * by replacing it with a rotating 3d rotor model. All possible textures are @@ -17,13 +19,12 @@ public class RenderTileEntityRotorBlock extends TileEntitySpecialRenderer { private static ResourceLocation[] textures = { - new ResourceLocation(Constants.MODID, "models/RotorBlockIronTexture.png"), - new ResourceLocation(Constants.MODID, "models/RotorBlockElectrumTexture.png"), - new ResourceLocation(Constants.MODID, "models/RotorBlockSignalumTexture.png"), - new ResourceLocation(Constants.MODID, "models/RotorBlockEnderiumTexture.png"), - new ResourceLocation(Constants.MODID, "models/RotorBlockNetherTexture.png"), - new ResourceLocation(Constants.MODID, "models/RotorBlockDiamondTexture.png") - }; + new ResourceLocation(Constants.MODID, "models/RotorBlockIronTexture.png"), + new ResourceLocation(Constants.MODID, "models/RotorBlockElectrumTexture.png"), + new ResourceLocation(Constants.MODID, "models/RotorBlockSignalumTexture.png"), + new ResourceLocation(Constants.MODID, "models/RotorBlockEnderiumTexture.png"), + new ResourceLocation(Constants.MODID, "models/RotorBlockNetherTexture.png"), + new ResourceLocation(Constants.MODID, "models/RotorBlockDiamondTexture.png") }; private static String objectModelPath = "models/RotorBlockModel.obj"; private ResourceLocation objModelLocation; private IModelCustom model; @@ -35,27 +36,27 @@ public RenderTileEntityRotorBlock() { @Override public void renderTileEntityAt(TileEntity pEntity, double pX, double pY, double pZ, float pDt) { - TileEntityRotorBlock entity = (TileEntityRotorBlock)pEntity; + TileEntityRotorBlock entity = (TileEntityRotorBlock) pEntity; float rotation = entity.getRotation(); float scale = entity.getScale(); int meta = entity.getBlockMetadata() & 3; bindTexture(textures[entity.getTexture()]); GL11.glPushMatrix(); // Position the rotor on the centre of the face and turn it the right way - switch(meta) { + switch (meta) { case 0: - GL11.glTranslated(pX+0.5f, pY+0.5f, pZ+1.0f); + GL11.glTranslated(pX + 0.5f, pY + 0.5f, pZ + 1.0f); GL11.glRotatef(180.0f, 0, 1.0f, 0); break; case 1: - GL11.glTranslated(pX, pY+0.5f, pZ+0.5f); + GL11.glTranslated(pX, pY + 0.5f, pZ + 0.5f); GL11.glRotatef(90.0f, 0, 1.0f, 0); break; case 2: - GL11.glTranslated(pX+0.5f, pY+0.5f, pZ); + GL11.glTranslated(pX + 0.5f, pY + 0.5f, pZ); break; case 3: - GL11.glTranslated(pX+1.0f, pY+0.5f, pZ+0.5f); + GL11.glTranslated(pX + 1.0f, pY + 0.5f, pZ + 0.5f); GL11.glRotatef(270.0f, 0, 1.0f, 0); break; } diff --git a/src/main/java/com/piepenguin/rfwindmill/tileentities/TileEntityRotorBlock.java b/src/main/java/com/piepenguin/rfwindmill/tileentities/TileEntityRotorBlock.java index cb0ec7d..c7b38f1 100644 --- a/src/main/java/com/piepenguin/rfwindmill/tileentities/TileEntityRotorBlock.java +++ b/src/main/java/com/piepenguin/rfwindmill/tileentities/TileEntityRotorBlock.java @@ -1,9 +1,5 @@ package com.piepenguin.rfwindmill.tileentities; -import com.piepenguin.rfwindmill.items.ModItems; -import com.piepenguin.rfwindmill.items.RFWItem; -import com.piepenguin.rfwindmill.lib.ModConfiguration; -import com.piepenguin.rfwindmill.lib.Util; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.NetworkManager; import net.minecraft.network.Packet; @@ -11,6 +7,11 @@ import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; +import com.piepenguin.rfwindmill.items.ModItems; +import com.piepenguin.rfwindmill.items.RFWItem; +import com.piepenguin.rfwindmill.lib.ModConfiguration; +import com.piepenguin.rfwindmill.lib.Util; + /** * Tile entity for the {@link com.piepenguin.rfwindmill.blocks.RotorBlock} * class which stores rotation and scale data for the attached @@ -28,15 +29,17 @@ public class TileEntityRotorBlock extends TileEntity { @Override public void updateEntity() { - if(worldObj.isRemote) { + if (worldObj.isRemote) { // We only need 4 directions so only the bottom two bits of // the metadata need to be considered - ForgeDirection turbineDir = Util.intToDirection(getBlockMetadata() & 3).getOpposite(); + ForgeDirection turbineDir = Util.intToDirection(getBlockMetadata() & 3) + .getOpposite(); int parentX = xCoord + turbineDir.offsetX; int parentY = yCoord + turbineDir.offsetY; int parentZ = zCoord + turbineDir.offsetZ; - TileEntityWindmillBlock entity = (TileEntityWindmillBlock)worldObj.getTileEntity(parentX, parentY, parentZ); - if(entity != null) { + TileEntityWindmillBlock entity = (TileEntityWindmillBlock) worldObj + .getTileEntity(parentX, parentY, parentZ); + if (entity != null) { rotation += entity.getCurrentEnergyGeneration() * degreesPerRFPerTick; } scale = 1.0f; @@ -79,6 +82,7 @@ public void onDataPacket(NetworkManager pNet, S35PacketUpdateTileEntity pPacket) /** * Get the rotation of the rotor about the axis normal to the face its * attached to. + * * @return Rotation in degrees of the rotor */ public float getRotation() { @@ -91,6 +95,7 @@ public float getScale() { /** * Get the tier of the rotor used to make the corresponding block. + * * @return Integer corresponding to the rotor tier used to make the rotor */ public int getType() { @@ -100,6 +105,7 @@ public int getType() { /** * Set the tier of the rotor used to make the corresponding block and * update the metadata of the block accordingly. + * * @param pType Tier of the rotor */ public void setType(int pType) { @@ -112,14 +118,15 @@ public void setType(int pType) { * configuration files. Can be forced to always display as the iron * texture, or (by default) takes a texture relative to the materials used * to make the rotor. + * * @return Array index used by {@link RenderTileEntityRotorBlock} to - * identify the texture + * identify the texture */ public int getTexture() { - if(ModConfiguration.useIronRotorTexture()) { + if (ModConfiguration.useIronRotorTexture()) { return 0; } - switch(type) { + switch (type) { default: case 0: return 0; @@ -136,11 +143,12 @@ public int getTexture() { * Converts the rotor tier into the item used to make it. Only ever four * rotors since high tier rotors are conditionally made based on config, * so this is a trivial function. + * * @return The rotor item used to make the corresponding - * {@link com.piepenguin.rfwindmill.blocks.RotorBlock} + * {@link com.piepenguin.rfwindmill.blocks.RotorBlock} */ public RFWItem getRotorItem() { - switch(type) { + switch (type) { default: case 0: return ModItems.rotor1; diff --git a/src/main/java/com/piepenguin/rfwindmill/tileentities/TileEntityWindmillBlock.java b/src/main/java/com/piepenguin/rfwindmill/tileentities/TileEntityWindmillBlock.java index 1511acd..43cb242 100644 --- a/src/main/java/com/piepenguin/rfwindmill/tileentities/TileEntityWindmillBlock.java +++ b/src/main/java/com/piepenguin/rfwindmill/tileentities/TileEntityWindmillBlock.java @@ -1,11 +1,5 @@ package com.piepenguin.rfwindmill.tileentities; -import cofh.api.energy.IEnergyProvider; -import cofh.api.energy.IEnergyReceiver; -import com.piepenguin.rfwindmill.lib.EnergyPacket; -import com.piepenguin.rfwindmill.lib.EnergyStorage; -import com.piepenguin.rfwindmill.lib.ModConfiguration; -import com.piepenguin.rfwindmill.lib.Util; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.nbt.NBTTagCompound; @@ -15,6 +9,14 @@ import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; +import com.piepenguin.rfwindmill.lib.EnergyPacket; +import com.piepenguin.rfwindmill.lib.EnergyStorage; +import com.piepenguin.rfwindmill.lib.ModConfiguration; +import com.piepenguin.rfwindmill.lib.Util; + +import cofh.api.energy.IEnergyProvider; +import cofh.api.energy.IEnergyReceiver; + /** * Tile entity for the {@link com.piepenguin.rfwindmill.blocks.WindmillBlock} * class, handles the energy generation, storage, and transfer. Energy produced @@ -28,7 +30,7 @@ public final class TileEntityWindmillBlock extends TileEntity implements IEnergy private static final int minHeight = 60; private static final int maxHeight = 100; private static final String NBT_EFFICIENCY = "RFWEfficiency"; - private static final String NBT_ROTOR_TYPE = "RFWRotorType"; + private static final String NBT_ROTOR_TYPE = "RFWRotorType"; private static final String NBT_ROTOR_DIR = "RFWRotorDir"; private static final String NBT_CURRENT_ENERGY_GENERATION = "RFWCurrentEnergyGeneration"; private float currentEnergyGeneration; @@ -63,9 +65,9 @@ public String getName() { @Override public void updateEntity() { super.updateEntity(); - if(!worldObj.isRemote) { + if (!worldObj.isRemote) { // Energy left in the packet so utilise it - if(energyPacket.getLifetime() > 0) { + if (energyPacket.getLifetime() > 0) { extractFromEnergyPacket(energyPacket); } // No energy left so attempt to generate a packet from the wind @@ -73,7 +75,7 @@ public void updateEntity() { energyPacket = getEnergyPacketFromWind(); extractFromEnergyPacket(energyPacket); } - if(storage.getEnergyStored() > 0) { + if (storage.getEnergyStored() > 0) { transferEnergy(); } } @@ -82,6 +84,7 @@ public void updateEntity() { /** * Reads data from {@code pNbt} that must be synced between client and * server, namely the current energy generation. + * * @param pNbt NBT to read from */ public void readSyncableDataFromNBT(NBTTagCompound pNbt) { @@ -91,6 +94,7 @@ public void readSyncableDataFromNBT(NBTTagCompound pNbt) { /** * Writes data to {@code pNbt} that must be synced between client and * server, namely the current energy generation. + * * @param pNbt NBT to write to */ public void writeSyncableDataToNBT(NBTTagCompound pNbt) { @@ -99,6 +103,7 @@ public void writeSyncableDataToNBT(NBTTagCompound pNbt) { /** * Read the non-syncable data from {@code pNbt}. + * * @param pNbt NBT to read from */ @Override @@ -113,6 +118,7 @@ public void readFromNBT(NBTTagCompound pNbt) { /** * Write the non-syncable data to {@code pNbt}. + * * @param pNbt NBT to write to */ @Override @@ -143,25 +149,27 @@ public void onDataPacket(NetworkManager pNet, S35PacketUpdateTileEntity pPacket) * Calculates the energy in the wind that is accessible to the windmill and * creates a new energy packet containing that energy. Takes into account * the height, weather, and wind tunnel length. + * * @return Energy packet containing energy from the wind. */ private EnergyPacket getEnergyPacketFromWind() { int deltaHeight = maxHeight - minHeight; - if(deltaHeight <= 0) deltaHeight = 1; + if (deltaHeight <= 0) deltaHeight = 1; - float heightModifier = (float)Math.min(Math.max(yCoord - minHeight, 0), deltaHeight) / (float)deltaHeight; + float heightModifier = (float) Math.min(Math.max(yCoord - minHeight, 0), deltaHeight) / (float) deltaHeight; float weatherModifier = 1.0f; - if(worldObj.isThundering()) { + if (worldObj.isThundering()) { weatherModifier = ModConfiguration.getWeatherMultiplierThunder(); - } - else if(worldObj.isRaining()) { + } else if (worldObj.isRaining()) { weatherModifier = ModConfiguration.getWeatherMultiplierRain(); } - float energy = ModConfiguration.getWindGenerationBase() * heightModifier * getTunnelLength() * 0.1f * weatherModifier; - if(energy < 0.01) { + float energy = ModConfiguration.getWindGenerationBase() * heightModifier + * getTunnelLength() + * 0.1f + * weatherModifier; + if (energy < 0.01) { return new EnergyPacket(0, 0); - } - else { + } else { return new EnergyPacket(energy * windPacketLength, windPacketLength); } } @@ -170,14 +178,18 @@ else if(worldObj.isRaining()) { * Create a new energy packet from hand power. * Calculates the energy coming from a player rotating the rotor and creates * a new energy packet containing that energy. + * * @return Energy packet containing energy from the player */ private EnergyPacket getEnergyPacketFromHand() { - return new EnergyPacket(Util.ticksPerClick() * ModConfiguration.getWindGenerationBase() * ModConfiguration.getHandcrankEnergyMultiplier(), Util.ticksPerClick()); + return new EnergyPacket( + Util.ticksPerClick() * ModConfiguration.getWindGenerationBase() + * ModConfiguration.getHandcrankEnergyMultiplier(), + Util.ticksPerClick()); } public void handcrank() { - if(energyPacket.getLifetime() <= 0) { + if (energyPacket.getLifetime() <= 0) { energyPacket = getEnergyPacketFromHand(); } } @@ -186,15 +198,15 @@ public void handcrank() { * Calculate the energy that can be extracted from the energy packet * limited by the efficiency of the system. Takes into account the efficiency * of the turbine and of the rotor. Does not modify the packet. + * * @param pEnergyPacket Energy packet to calculate from * @return Extractable energy in {@code pEnergyPacket} in RF/t */ private float getExtractableEnergyFromPacket(EnergyPacket pEnergyPacket) { float totalEfficiency = 1.0f; - if(!hasRotor()) { + if (!hasRotor()) { totalEfficiency = 0.0f; - } - else { + } else { totalEfficiency *= ModConfiguration.getRotorEnergyMultiplier(rotorType); totalEfficiency *= efficiency; } @@ -204,9 +216,10 @@ private float getExtractableEnergyFromPacket(EnergyPacket pEnergyPacket) { /** * Takes an energy packet and extracts energy from it. Modifies the lifetime * of the packet accordingly. + * * @param pEnergyPacket Packet to extract from */ - private void extractFromEnergyPacket(EnergyPacket pEnergyPacket){ + private void extractFromEnergyPacket(EnergyPacket pEnergyPacket) { currentEnergyGeneration = getExtractableEnergyFromPacket(pEnergyPacket); pEnergyPacket.deplete(); syncEnergy(); @@ -215,6 +228,7 @@ private void extractFromEnergyPacket(EnergyPacket pEnergyPacket){ /** * The current rate of energy production in RF/t + * * @return The current rate of energy production, 0 if no rotor attached */ public float getCurrentEnergyGeneration() { @@ -227,7 +241,7 @@ public float getCurrentEnergyGeneration() { */ private void syncEnergy() { // Amount of energy generated has changed so sync with server - if(Math.abs(currentEnergyGeneration - oldEnergyGeneration) > 0.01) { + if (Math.abs(currentEnergyGeneration - oldEnergyGeneration) > 0.01) { oldEnergyGeneration = currentEnergyGeneration; worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); markDirty(); @@ -239,22 +253,23 @@ private void syncEnergy() { * the first non-air block in the given direction and starting at the * given coordinate. Gives the length of a 'wind-tunnel' until an obstruction * is found. - * @param pX X coordinate to start measuring from - * @param pY Y coordinate to start measuring from - * @param pZ Z coordinate to start measuring from + * + * @param pX X coordinate to start measuring from + * @param pY Y coordinate to start measuring from + * @param pZ Z coordinate to start measuring from * @param pDirection Direction to check the tunnel in - * @param toSkip Number of blocks in {@code pDirection} to ignore + * @param toSkip Number of blocks in {@code pDirection} to ignore * @return Length of the 'wind-tunnel' */ private int getTunnelLengthSingleBlock(int pX, int pY, int pZ, ForgeDirection pDirection, int toSkip) { - for(int i = toSkip; i < tunnelRange; ++i) { + for (int i = toSkip; i < tunnelRange; ++i) { // Skip specified number of blocks int dx = pX + pDirection.offsetX * i; int dy = pY + pDirection.offsetY * i; int dz = pZ + pDirection.offsetZ * i; Block block = worldObj.getBlock(dx, dy, dz); - if(block == null || (block.getMaterial() != Material.air)) { - return i-1; + if (block == null || (block.getMaterial() != Material.air)) { + return i - 1; } } @@ -268,22 +283,21 @@ private int getTunnelLengthSingleBlock(int pX, int pY, int pZ, ForgeDirection pD * the shortest length taken to be the length of the wind tunnel. The first * block is ignored in the given {@code pDirection} so as to ignore the * {@link com.piepenguin.rfwindmill.blocks.RotorBlock}. - * @param pX X coordinate to start measuring from - * @param pY Y coordinate to start measuring from - * @param pZ Z coordinate to start measuring from + * + * @param pX X coordinate to start measuring from + * @param pY Y coordinate to start measuring from + * @param pZ Z coordinate to start measuring from * @param pDirection Direction the rotor is facing - * @param isCenter {@code true} if the tunnel starts on the windmill center + * @param isCenter {@code true} if the tunnel starts on the windmill center * @return Shortest unobstructed length of the two opposing 'wind-tunnel's */ private int getTunnelLengthTwoSided(int pX, int pY, int pZ, ForgeDirection pDirection, boolean isCenter) { - if(isCenter) { + if (isCenter) { return getTunnelLengthSingleBlock(pX, pY, pZ, pDirection, 2); - } - else { + } else { return Math.min( - getTunnelLengthSingleBlock(pX, pY, pZ, pDirection, 1), - getTunnelLengthSingleBlock(pX, pY, pZ, pDirection.getOpposite(), 0) - ); + getTunnelLengthSingleBlock(pX, pY, pZ, pDirection, 1), + getTunnelLengthSingleBlock(pX, pY, pZ, pDirection.getOpposite(), 0)); } } @@ -292,16 +306,17 @@ private int getTunnelLengthTwoSided(int pX, int pY, int pZ, ForgeDirection pDire * {@link #getTunnelLengthTwoSided(int, int, int, ForgeDirection, boolean)} * but take the shortest unobstructed range in the 3x3x{@code tunnelRange} * to be the length of the tunnel. + * * @return Length of the 'wind-tunnel' */ private int getTunnelLength() { int range = tunnelRange; // If rotor dir is north or south then check xy plane - if(rotorDir == ForgeDirection.NORTH || rotorDir == ForgeDirection.SOUTH) { - for(int x = -1; x <= 1; ++x) { - for(int y = -1; y <= 1; ++y) { + if (rotorDir == ForgeDirection.NORTH || rotorDir == ForgeDirection.SOUTH) { + for (int x = -1; x <= 1; ++x) { + for (int y = -1; y <= 1; ++y) { int r = getTunnelLengthTwoSided(xCoord + x, yCoord + y, zCoord, rotorDir, x == 0); - if(r < range) { + if (r < range) { range = r; } } @@ -310,10 +325,10 @@ private int getTunnelLength() { // Terrible lack of code reuse, better way? else { // Check yz plane - for(int z = -1; z <= 1; ++z) { - for(int y = -1; y <= 1; ++y) { + for (int z = -1; z <= 1; ++z) { + for (int y = -1; y <= 1; ++y) { int r = getTunnelLengthTwoSided(xCoord, yCoord + y, zCoord + z, rotorDir, z == 0); - if(r < range) { + if (r < range) { range = r; } } @@ -327,24 +342,24 @@ private int getTunnelLength() { * this one. */ private void transferEnergy() { - for(ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) { - TileEntity tile = getWorldObj().getTileEntity( - xCoord + direction.offsetX, - yCoord + direction.offsetY, - zCoord + direction.offsetZ); - if(tile instanceof IEnergyReceiver) { - IEnergyReceiver receiver = (IEnergyReceiver)tile; - extractEnergy(direction.getOpposite(), receiver.receiveEnergy(direction.getOpposite(), storage.getExtract(), false), false); + for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) { + TileEntity tile = getWorldObj() + .getTileEntity(xCoord + direction.offsetX, yCoord + direction.offsetY, zCoord + direction.offsetZ); + if (tile instanceof IEnergyReceiver) { + IEnergyReceiver receiver = (IEnergyReceiver) tile; + extractEnergy( + direction.getOpposite(), + receiver.receiveEnergy(direction.getOpposite(), storage.getExtract(), false), + false); } } } @Override public int extractEnergy(ForgeDirection pFrom, int pMaxExtract, boolean pSimulate) { - if(canConnectEnergy(pFrom)) { + if (canConnectEnergy(pFrom)) { return storage.extractEnergy(pMaxExtract, pSimulate); - } - else { + } else { return 0; } } @@ -384,9 +399,10 @@ public boolean hasRotor() { * Set the tier of the rotor connected to the corresponding * {@link com.piepenguin.rfwindmill.blocks.WindmillBlock}. -1 if no rotor is * connected. + * * @param pRotorType Tier of the rotor being attached. -1 if no rotor - * @param fDir Direction the rotor is facing, i.e. the normal to the face - * the rotor is being placed on + * @param fDir Direction the rotor is facing, i.e. the normal to the face + * the rotor is being placed on */ public void setRotor(int pRotorType, ForgeDirection fDir) { rotorType = pRotorType; diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index b2a4eac..d98f87a 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -1,17 +1,21 @@ -[ { - "modid": "rfwindmill", - "name": "RF Windmill", - "description": "Generate RF from the wind", - "version": "0.7c", - "mcversion": "1.7.10", - "url": "http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/2412705", - "updateUrl": "", - "authorList": ["Piepenguin"], - "credits": "", - "logoFile": "", - "screenshots": [], - "dependencies": ["ThermalExpansion", "ThermalFoundation"], - "useDependencyInformation": "true" + "modListVersion": 2, + "modList": [{ + "modid": "${modId}", + "name": "${modName}", + "description": "Generate RF from the wind", + "version": "${modVersion}", + "mcversion": "${minecraftVersion}", + "url": "https://github.com/Pilzinsel64/rfwindmill", + "updateUrl": "", + "authorList": ["Piepenguin", "Pilzinsel64"], + "credits": "", + "logoFile": "", + "screenshots": [], + "parent": "", + "requiredMods": [], + "dependencies": [], + "dependants": [], + "useDependencyInformation": true + }] } -]