diff options
46 files changed, 757 insertions, 1230 deletions
diff --git a/.gitignore b/.gitignore index 40fb5e4a7d..3d66b81105 100644 --- a/.gitignore +++ b/.gitignore @@ -1,29 +1,44 @@ -.gradle -.settings -/.idea/ -/run/ -/build/ -/eclipse/ +.gradle/ +run/ +.settings/ .classpath .project -/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/ +bin/ +out/ +libs/gregtech* +CREDITS-fml.txt +LICENSE-fml.txt +MinecraftForge-Credits.txt +MinecraftForge-License.txt +CoreMod.iml +CoreMod.ipr +CoreMod.iws +Idea.bat +SetupDevWorkspaces.bat *.iml *.ipr *.iws -src/main/resources/mixins.*.json *.bat +.idea/workspace.xml +*.db +*.log +.idea/ +\.directory +asm/ +config/ +saves/ +usernamecache.json +PlayerCache.dat +GregTech.cfg +options.txt +GregTech.lang +mods/ +classes/ +logs/ +libs/AsieLib-1.7.10-0.4.9-deobf.jar +libs/Computronics-1.7.10-1.6.6-deobf.jar +libs/Galacticraft-API-1.7-3.0.12.504.jar +libs/GTNewHorizonsCoreMod-1.7.10-1.6.10.jar +libs/MicdoodleCore-1.7-3.0.12.504.jar +libs/worldedit-forge-mc1.7.10-6.1.1-dist.jar +eclipse/ diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000..58eebb4aa5 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "AVRcore"] + path = AVRcore + url = https://github.com/Technus/AVRcore diff --git a/build.gradle b/build.gradle deleted file mode 100644 index f15607a826..0000000000 --- a/build.gradle +++ /dev/null @@ -1,605 +0,0 @@ -//version: 1642484596 -/* -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/main/build.gradle for updates. - */ - - -import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation -import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar - -import java.util.concurrent.TimeUnit - -buildscript { - repositories { - maven { - name = "forge" - url = "https://maven.minecraftforge.net" - } - maven { - name = "sonatype" - url = "https://oss.sonatype.org/content/repositories/snapshots/" - } - maven { - name = "Scala CI dependencies" - url = "https://repo1.maven.org/maven2/" - } - maven { - name = "jitpack" - url = "https://jitpack.io" - } - } - dependencies { - classpath 'com.github.GTNewHorizons:ForgeGradle:1.2.5' - } -} - -plugins { - id 'idea' - id 'scala' - id("org.ajoberstar.grgit") version("3.1.1") - id("com.github.johnrengelman.shadow") version("4.0.4") - id("com.palantir.git-version") version("0.12.3") - id("maven-publish") -} - -apply plugin: 'forge' - -def projectJavaVersion = JavaLanguageVersion.of(8) - -java { - toolchain { - languageVersion.set(projectJavaVersion) - } -} - -javadoc.options.encoding = 'UTF-8' -tasks.withType(Javadoc) { - options.encoding = 'UTF-8' -} -tasks.withType(JavaCompile) { - options.encoding = 'UTF-8' -} -tasks.withType(Test) { - systemProperty("file.encoding", "UTF-8") -} - -idea { - module { - inheritOutputDirs = true - downloadJavadoc = true - downloadSources = true - } -} - -if(JavaVersion.current() != JavaVersion.VERSION_1_8) { - throw new GradleException("This project requires Java 8, but it's running on " + JavaVersion.current()) -} - -checkPropertyExists("modName") -checkPropertyExists("modId") -checkPropertyExists("modGroup") -checkPropertyExists("autoUpdateBuildScript") -checkPropertyExists("minecraftVersion") -checkPropertyExists("forgeVersion") -checkPropertyExists("replaceGradleTokenInFile") -checkPropertyExists("gradleTokenModId") -checkPropertyExists("gradleTokenModName") -checkPropertyExists("gradleTokenVersion") -checkPropertyExists("gradleTokenGroupName") -checkPropertyExists("apiPackage") -checkPropertyExists("accessTransformersFile") -checkPropertyExists("usesMixins") -checkPropertyExists("mixinPlugin") -checkPropertyExists("mixinsPackage") -checkPropertyExists("coreModClass") -checkPropertyExists("containsMixinsAndOrCoreModOnly") -checkPropertyExists("usesShadowedDependencies") -checkPropertyExists("developmentEnvironmentUserName") - -boolean noPublishedSources = project.findProperty("noPublishedSources") ? project.noPublishedSources.toBoolean() : false - -String javaSourceDir = "src/main/java/" -String scalaSourceDir = "src/main/scala/" - -String targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") -String targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") -if((getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists()) == false) { - throw new GradleException("Could not resolve \"modGroup\"! Could not find " + targetPackageJava + " or " + targetPackageScala) -} - -if(apiPackage) { - targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/") - targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/") - if((getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists()) == false) { - throw new GradleException("Could not resolve \"apiPackage\"! Could not find " + targetPackageJava + " or " + targetPackageScala) - } -} - -if(accessTransformersFile) { - String targetFile = "src/main/resources/META-INF/" + accessTransformersFile - if(getFile(targetFile).exists() == false) { - throw new GradleException("Could not resolve \"accessTransformersFile\"! Could not find " + targetFile) - } -} - -if(usesMixins.toBoolean()) { - if(mixinsPackage.isEmpty() || mixinPlugin.isEmpty()) { - throw new GradleException("\"mixinPlugin\" requires \"mixinsPackage\" and \"mixinPlugin\" to be set!") - } - - targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinsPackage.toString().replaceAll("\\.", "/") - targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinsPackage.toString().replaceAll("\\.", "/") - if((getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists()) == false) { - throw new GradleException("Could not resolve \"mixinsPackage\"! Could not find " + targetPackageJava + " or " + targetPackageScala) - } - - String targetFileJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".java" - String targetFileScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".scala" - String targetFileScalaJava = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".java" - if((getFile(targetFileJava).exists() || getFile(targetFileScala).exists() || getFile(targetFileScalaJava).exists()) == false) { - throw new GradleException("Could not resolve \"mixinPlugin\"! Could not find " + targetFileJava + " or " + targetFileScala + " or " + targetFileScalaJava) - } -} - -if(coreModClass) { - String targetFileJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + coreModClass.toString().replaceAll("\\.", "/") + ".java" - String targetFileScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + coreModClass.toString().replaceAll("\\.", "/") + ".scala" - String targetFileScalaJava = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + coreModClass.toString().replaceAll("\\.", "/") + ".java" - if((getFile(targetFileJava).exists() || getFile(targetFileScala).exists() || getFile(targetFileScalaJava).exists()) == false) { - throw new GradleException("Could not resolve \"coreModClass\"! Could not find " + targetFileJava + " or " + targetFileScala + " or " + targetFileScalaJava) - } -} - -configurations.all { - 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 -'git config core.fileMode false'.execute() - -// Pulls version first from the VERSION env and then git tag -String identifiedVersion -try { - String versionOverride = System.getenv("VERSION") ?: null - identifiedVersion = versionOverride == null ? gitVersion() : versionOverride - version = minecraftVersion + "-" + identifiedVersion -} -catch (Exception e) { - throw new IllegalStateException("This mod must be version controlled by Git AND the repository must provide at least one tag, or the VERSION override must be set!"); -} - -group = modGroup -if(project.hasProperty("customArchiveBaseName") && customArchiveBaseName) { - archivesBaseName = customArchiveBaseName -} -else { - archivesBaseName = modId -} - -minecraft { - version = minecraftVersion + "-" + forgeVersion + "-" + minecraftVersion - runDir = "run" - - if (replaceGradleTokenInFile) { - replaceIn replaceGradleTokenInFile - if(gradleTokenModId) { - replace gradleTokenModId, modId - } - if(gradleTokenModName) { - replace gradleTokenModName, modName - } - if(gradleTokenVersion) { - replace gradleTokenVersion, versionDetails().lastTag - } - if(gradleTokenGroupName) { - replace gradleTokenGroupName, modGroup - } - } -} - -if(file("addon.gradle").exists()) { - apply from: "addon.gradle" -} - -apply from: 'repositories.gradle' - -configurations { - implementation.extendsFrom(shadowImplementation) // TODO: remove after all uses are refactored - implementation.extendsFrom(shadowCompile) - implementation.extendsFrom(shadeCompile) -} - -repositories { - maven { - name = "Overmind forge repo mirror" - url = "https://gregtech.overminddl1.com/" - } - if(usesMixins.toBoolean()) { - maven { - name = "sponge" - url = "https://repo.spongepowered.org/repository/maven-public" - } - maven { - url = "https://jitpack.io" - } - } -} - -dependencies { - 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("org.spongepowered:mixin:0.8-SNAPSHOT") - // using 0.8 to workaround a issue in 0.7 which fails mixin application - compile("com.github.GTNewHorizons:SpongePoweredMixin:0.7.12-GTNH") { - // Mixin includes a lot of dependencies that are too up-to-date - exclude module: "launchwrapper" - exclude module: "guava" - exclude module: "gson" - exclude module: "commons-io" - exclude module: "log4j-core" - } - compile("com.github.GTNewHorizons:SpongeMixins:1.5.0") - } -} - -apply from: 'dependencies.gradle' - -def mixingConfigRefMap = "mixins." + modId + ".refmap.json" -def refMap = "${tasks.compileJava.temporaryDir}" + File.separator + mixingConfigRefMap -def mixinSrg = "${tasks.reobf.temporaryDir}" + File.separator + "mixins.srg" - -task generateAssets { - if(usesMixins.toBoolean()) { - getFile("/src/main/resources/mixins." + modId + ".json").text = """{ - "required": true, - "minVersion": "0.7.11", - "package": "${modGroup}.${mixinsPackage}", - "plugin": "${modGroup}.${mixinPlugin}", - "refmap": "${mixingConfigRefMap}", - "target": "@env(DEFAULT)", - "compatibilityLevel": "JAVA_8" -} - -""" - } -} - -task relocateShadowJar(type: ConfigureShadowRelocation) { - target = tasks.shadowJar - prefix = modGroup + ".shadow" -} - -shadowJar { - project.configurations.shadeCompile.each { dep -> - from(project.zipTree(dep)) { - exclude 'META-INF', 'META-INF/**' - } - } - - manifest { - attributes(getManifestAttributes()) - } - - minimize() // This will only allow shading for actually used classes - configurations = [project.configurations.shadowImplementation, project.configurations.shadowCompile] - dependsOn(relocateShadowJar) -} - -jar { - project.configurations.shadeCompile.each { dep -> - from(project.zipTree(dep)) { - exclude 'META-INF', 'META-INF/**' - } - } - - manifest { - attributes(getManifestAttributes()) - } - - if(usesShadowedDependencies.toBoolean()) { - dependsOn(shadowJar) - enabled = false - } -} - -reobf { - if(usesMixins.toBoolean()) { - addExtraSrgFile mixinSrg - } -} - -afterEvaluate { - if(usesMixins.toBoolean()) { - tasks.compileJava { - options.compilerArgs += [ - "-AreobfSrgFile=${tasks.reobf.srg}", - "-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" - ] - } - } -} - -runClient { - def arguments = [] - - if(usesMixins.toBoolean()) { - arguments += [ - "--mods=../build/libs/$modId-${version}.jar", - "--tweakClass org.spongepowered.asm.launch.MixinTweaker" - ] - } - - if(developmentEnvironmentUserName) { - arguments += [ - "--username", - developmentEnvironmentUserName - ] - } - - args(arguments) -} - -runServer { - def arguments = [] - - if (usesMixins.toBoolean()) { - arguments += [ - "--mods=../build/libs/$modId-${version}.jar", - "--tweakClass org.spongepowered.asm.launch.MixinTweaker" - ] - } - - args(arguments) -} - -tasks.withType(JavaExec).configureEach { - javaLauncher.set( - javaToolchains.launcherFor { - languageVersion = projectJavaVersion - } - ) -} - -processResources -{ - // this will ensure that this task is redone when the versions change. - inputs.property "version", project.version - inputs.property "mcversion", project.minecraft.version - - // replace stuff in mcmod.info, nothing else - from(sourceSets.main.resources.srcDirs) { - include 'mcmod.info' - - // replace version and mcversion - expand "minecraftVersion": project.minecraft.version, - "modVersion": versionDetails().lastTag, - "modId": modId, - "modName": modName - } - - if(usesMixins.toBoolean()) { - from refMap - } - - // copy everything else, thats not the mcmod.info - from(sourceSets.main.resources.srcDirs) { - exclude 'mcmod.info' - } -} - -def getManifestAttributes() { - def manifestAttributes = [:] - if(containsMixinsAndOrCoreModOnly.toBoolean() == false && (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() == false - ] - } - return manifestAttributes -} - -task sourcesJar(type: Jar) { - from (sourceSets.main.allJava) - from (file("$projectDir/LICENSE")) - getArchiveClassifier().set('sources') -} - -task shadowDevJar(type: ShadowJar) { - project.configurations.shadeCompile.each { dep -> - from(project.zipTree(dep)) { - exclude 'META-INF', 'META-INF/**' - } - } - - from sourceSets.main.output - getArchiveClassifier().set("dev") - - manifest { - attributes(getManifestAttributes()) - } - - minimize() // This will only allow shading for actually used classes - configurations = [project.configurations.shadowImplementation, project.configurations.shadowCompile] -} - -task relocateShadowDevJar(type: ConfigureShadowRelocation) { - target = tasks.shadowDevJar - prefix = modGroup + ".shadow" -} - -task circularResolverJar(type: Jar) { - dependsOn(relocateShadowDevJar) - dependsOn(shadowDevJar) - enabled = false -} - -task devJar(type: Jar) { - project.configurations.shadeCompile.each { dep -> - from(project.zipTree(dep)) { - exclude 'META-INF', 'META-INF/**' - } - } - - from sourceSets.main.output - getArchiveClassifier().set("dev") - - manifest { - attributes(getManifestAttributes()) - } - - if(usesShadowedDependencies.toBoolean()) { - dependsOn(circularResolverJar) - enabled = false - } -} - -task apiJar(type: Jar) { - from (sourceSets.main.allJava) { - include modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/") + '/**' - } - - from (sourceSets.main.output) { - include modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/") + '/**' - } - - from (sourceSets.main.resources.srcDirs) { - include("LICENSE") - } - - getArchiveClassifier().set('api') -} - -artifacts { - if(!noPublishedSources) { - archives sourcesJar - } - archives devJar - if(apiPackage) { - archives apiJar - } -} - -// publishing -publishing { - publications { - maven(MavenPublication) { - artifact source: usesShadowedDependencies.toBoolean() ? shadowJar : jar, classifier: "" - if(!noPublishedSources) { - artifact source: sourcesJar, classifier: "src" - } - artifact source: usesShadowedDependencies.toBoolean() ? shadowDevJar : devJar, classifier: "dev" - if (apiPackage) { - artifact source: apiJar, classifier: "api" - } - - groupId = System.getenv("ARTIFACT_GROUP_ID") ?: "com.github.GTNewHorizons" - 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" - credentials { - username = System.getenv("MAVEN_USER") ?: "NONE" - password = System.getenv("MAVEN_PASSWORD") ?: "NONE" - } - } - } -} - -// Updating -task updateBuildScript { - doLast { - if (performBuildScriptUpdate(projectDir.toString())) return - - print("Build script already up-to-date!") - } -} - -if (isNewBuildScriptVersionAvailable(projectDir.toString())) { - if (autoUpdateBuildScript.toBoolean()) { - performBuildScriptUpdate(projectDir.toString()) - } else { - println("Build script update available! Run 'gradle updateBuildScript'") - } -} - -static URL availableBuildScriptUrl() { - new URL("https://raw.githubusercontent.com/GTNewHorizons/ExampleMod1.7.10/main/build.gradle") -} - -boolean performBuildScriptUpdate(String projectDir) { - if (isNewBuildScriptVersionAvailable(projectDir)) { - def buildscriptFile = getFile("build.gradle") - availableBuildScriptUrl().withInputStream { i -> buildscriptFile.withOutputStream { it << i } } - print("Build script updated. Please REIMPORT the project or RESTART your IDE!") - return true - } - return false -} - -boolean isNewBuildScriptVersionAvailable(String projectDir) { - 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 "" -} - -configure(updateBuildScript) { - group = 'forgegradle' - description = 'Updates the build script to the latest version' -} - -// Helper methods - -def checkPropertyExists(String propertyName) { - if (project.hasProperty(propertyName) == false) { - 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 getFile(String relativePath) { - return new File(projectDir, relativePath) -} diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000000..29a4f8b6de --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,292 @@ +import net.minecraftforge.gradle.user.UserExtension +import java.io.FileInputStream +import java.util.* +import java.io.* + +buildscript { + repositories { + mavenCentral() + maven("https://gregtech.overminddl1.com/") + maven("https://jitpack.io") + + } + dependencies { + classpath("com.github.GTNH2:ForgeGradle:FG_1.2-SNAPSHOT"){ + isChanging = true + } + } +} + +plugins { + idea + java + signing +} + +apply(plugin = "forge") + +//Downloads Javadocs and sources by default +idea { + module { + this.isDownloadJavadoc = true + this.isDownloadSources = true + } +} + +//Set Java to version 1.8 +java { + this.sourceCompatibility = JavaVersion.VERSION_1_8 + this.targetCompatibility = JavaVersion.VERSION_1_8 +} + +//Set standard encoding +tasks.withType<JavaCompile> { + options.encoding = "UTF-8" +} + +//Add extra sources here +sourceSets.getByName("main") { + java.srcDir("src/main/java") + java.srcDir("AVRcore/src") +} + +//Load Minecraft Version +val Project.minecraft: UserExtension + get() = extensions.getByName<UserExtension>("minecraft") + +//TODO Delete this! This exists to load the configs from the real properties file, which is needed for Jenkins to build +//Gradle will load gradle.properties from it's home, it's install, and the project folder. Clearly whoever setup the +//Jenkins jar signing needs to be reminded of this! +val prop = Properties() +prop.load(FileInputStream("real.gradle.properties")) +val propSign = Properties() +propSign.load(FileInputStream("gradle.properties")) + +//TODO Delete +val projectVersion: String = prop.getProperty("projectVersion") +//TODO Uncomment +//val projectVersion: String by project + +//Generates a hash for each new commit to differentiate versions +var commitHash = Runtime + .getRuntime() + .exec("git rev-parse --short HEAD") + .let { process -> + process.waitFor() + val output = process.inputStream.use { + it.bufferedReader().use(BufferedReader::readText) + } + process.destroy() + output.trim() + } + +minecraft.version = "1.7.10-10.13.4.1614-1.7.10" +version = "$projectVersion-$commitHash" +group = "com.github.technus" + +//Minecraft Block +configure<UserExtension> { + //Replaces version inside the mod + this.includes.addAll( + arrayOf( + "Reference.java" + ) + ) + this.replacements.putAll( + mapOf( + Pair("GRADLETOKEN_VERSION", project.version) + ) + ) + + //This is sometimes called 'eclipse' instead + this.runDir = "run" +} + +repositories { + mavenLocal() + maven("https://gregtech.overminddl1.com/") { this.name = "GT6Maven" } + maven("http://maven.ic2.player.to/") { this.name = "ic2" } + maven("http://jenkins.usrv.eu:8081/nexus/content/repositories/releases/") { this.name = "UsrvDE/GTNH" } + ivy { + this.name = "gtnh_download_source_underscores" + this.artifactPattern("http://downloads.gtnewhorizons.com/Mods_for_Jenkins/[module]_[revision].[ext]") + } + ivy { + this.name = "gtnh_download_source" + this.artifactPattern("http://downloads.gtnewhorizons.com/Mods_for_Jenkins/[module]-[revision].[ext]") + } + ivy { + this.name = "BuildCraft" + this.artifactPattern("http://www.mod-buildcraft.com/releases/BuildCraft/[revision]/[module]-[revision](-[classifier]).[ext]") + } + maven("http://maven.cil.li/") { this.name = "OpenComputers" } + maven("http://default.mobiusstrip.eu/maven") { this.name = "Jabba" } + maven("http://chickenbones.net/maven/") { this.name = "CodeChicken" } + maven("http://www.ryanliptak.com/maven/") { this.name = "appleCore" } + maven("https://jitpack.io") +} + +dependencies { + //Local Libraries + compile(fileTree("libs") { this.include("*.jar") }) + + //TODO Uncomment + //Versions from properties + //val ic2Version: String by project + //val gt5uVersion: String by project + //val yamcoreVersion: String by project + //val opencomputersVersion: String by project + //val computercraftVersion: String by project + //val baublesVersion: String by project + //val thaumcraftVersion: String by project + //val codechickenlibVersion: String by project + //val codechickencoreVersion: String by project + //val neiVersion: String by project + //val wailaVersion: String by project + //val galacticraftVersion: String by project + //val galacticGregVersion: String by project + //val buildcraftVersion: String by project + //val forestryVersion: String by project + //val enderioVersion: String by project + //val enderCoreVersion: String by project + + //TODO Delete + val ic2Version: String = prop.getProperty("ic2Version") + val gt5uVersion: String = prop.getProperty("gt5uVersion") + val yamcoreVersion: String = prop.getProperty("yamcoreVersion") + val opencomputersVersion: String = prop.getProperty("opencomputersVersion") + val computercraftVersion: String = prop.getProperty("computercraftVersion") + val baublesVersion: String = prop.getProperty("baublesVersion") + val thaumcraftVersion: String = prop.getProperty("thaumcraftVersion") + val codechickenlibVersion: String = prop.getProperty("codechickenlibVersion") + val codechickencoreVersion: String = prop.getProperty("codechickencoreVersion") + val neiVersion: String = prop.getProperty("neiVersion") + val wailaVersion: String = prop.getProperty("wailaVersion") + val galacticraftVersion: String = prop.getProperty("galacticraftVersion") + val galacticGregVersion: String = prop.getProperty("galacticGregVersion") + val buildcraftVersion: String = prop.getProperty("buildcraftVersion") + val forestryVersion: String = prop.getProperty("forestryVersion") + val enderioVersion: String = prop.getProperty("enderioVersion") + val enderCoreVersion: String = prop.getProperty("enderCoreVersion") + + //Hard Dependencies + compile("net.industrial-craft:industrialcraft-2:$ic2Version:dev") + compile("com.github.GTNewHorizons:StructureLib:1.0.9:deobf") + compile("com.github.GTNewHorizons:GT5-Unofficial:$gt5uVersion:dev"){ + exclude("net.industrial-craft", "industrialcraft-2") + isChanging = true + } + compile("eu.usrv:YAMCore:$yamcoreVersion:deobf") + + //Compile Dependencies + compileOnly("li.cil.oc:OpenComputers:$opencomputersVersion:dev") + compileOnly("dan200.computercraft:ComputerCraft:$computercraftVersion") + compile("com.azanor.baubles:Baubles:$baublesVersion:deobf") + compile("thaumcraft:Thaumcraft:$thaumcraftVersion:dev") + compile("codechicken:CodeChickenLib:$codechickenlibVersion:dev") + compile("codechicken:CodeChickenCore:$codechickencoreVersion:dev") + compile("codechicken:NotEnoughItems:$neiVersion:dev") + + //Optional Libraries for Testing + runtimeOnly("mcp.mobius.waila:Waila:$wailaVersion") + + //runtimeOnly("micdoodle8.mods:MicdoodleCore:$galacticraftVersion:Dev") + //runtimeOnly("micdoodle8.mods:GalacticraftCore:$galacticraftVersion:Dev") + //runtimeOnly("micdoodle8.mods:Galacticraft-Planets:$galacticraftVersion:Dev") + //runtimeOnly("com.github.GTNewHorizons:GalacticGregGT5:$galacticGregVersion") + //runtimeOnly("com.mod-buildcraft:buildcraft:$buildcraftVersion:dev") + //runtimeOnly("net.sengir.forestry:forestry_1.7.10:$forestryVersion:dev") + //runtimeOnly("com.enderio.core:EnderCore:$enderCoreVersion:dev") + //runtimeOnly("com.enderio:EnderIO:$enderioVersion:dev"){ + // exclude("com.enderio.core", "EnderCore") + // exclude("mcp.mobius.waila", "Waila") + //} + + configurations.all { + resolutionStrategy.cacheDynamicVersionsFor(30, "seconds") + } +} + + + + +tasks.withType<Jar> { + //Mark as outdated if versions change + this.inputs.properties += "version" to project.version + this.inputs.properties += "mcversion" to project.minecraft.version + this.archiveBaseName.set("TecTech-${project.minecraft.version}") + + //Replace versions in mcmod.info + this.filesMatching("/mcmod.info") { + this.expand( + mapOf( + "version" to project.version, + "mcversion" to project.minecraft.version + ) + ) + } +} + +//Load AVRcore +val submodulesUpdate by tasks.creating(Exec::class) { + this.description = "Updates (and inits) git submodules" + this.group = "Build Setup" + this.commandLine("git", "submodule", "update", "--init", "--recursive", "--remote") +} +tasks.named("setupCIWorkspace") { + dependsOn(":submodulesUpdate") +} +tasks.named("setupDevWorkspace") { + dependsOn(":submodulesUpdate") +} +tasks.named("setupDecompWorkspace") { + dependsOn(":submodulesUpdate") +} +tasks.named("compileJava") { + dependsOn(":submodulesUpdate") +} +tasks.named("sourceMainJava") { + dependsOn(":submodulesUpdate") +} + +tasks.jar { + //Needed for access transformer which allows nerfing hardness of blocks + this.manifest.attributes( + mapOf( + Pair("FMLAT", "tectech_at.cfg") + ) + ) +} + +val sourcesJar by tasks.creating(Jar::class) { + this.from(sourceSets.main.get().allSource) + this.archiveClassifier.set("sources") +} + +val devJar by tasks.creating(Jar::class) { + this.from(sourceSets.main.get().output) + this.archiveClassifier.set("dev") +} + +artifacts { + this.archives(sourcesJar) + this.archives(devJar) +} + +tasks.register("signJar") { + dependsOn("reobf") +} + +//TODO Fix, but technically it was never fully implemented +//signing { +// sign(tasks["jar"]) +//} +// +//tasks.named("signJar") { +// allprojects { +// extra["signing.keyId"] = propSign.getProperty("keyStoreAlias") +// extra["signing.secretKeyRingFile"] = propSign.getProperty("keyStore") +// extra["signing.password"] = propSign.getProperty("keyStorePass") +// } +// dependsOn(":reobf") +//} diff --git a/dependencies.gradle b/dependencies.gradle deleted file mode 100644 index 73d58c8479..0000000000 --- a/dependencies.gradle +++ /dev/null @@ -1,27 +0,0 @@ -// Add your dependencies here - -dependencies { - shadowImplementation("com.github.GTNewHorizons:AVRcore:master-SNAPSHOT") - - compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.40.18:dev") - compile("com.github.GTNewHorizons:Yamcl:0.5.82:dev") - compile("com.github.GTNewHorizons:NotEnoughItems:2.1.22-GTNH:dev") - compile("com.github.GTNewHorizons:CodeChickenLib:1.1.5.1:dev") - compile("com.github.GTNewHorizons:CodeChickenCore:1.1.3:dev") - compile("com.github.GTNewHorizons:StructureLib:1.0.14:dev") - compile("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev") - - compile("com.github.GTNewHorizons:GTplusplus:1.7.24:dev") - - compileOnly("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-70-GTNH:dev") { - transitive = false - } - - compile("dan200.computercraft:ComputerCraft:1.75") - compile("li.cil.oc:OpenComputers:MC1.7.10-1.7.5.1356:dev") - compile("curse.maven:cofh-core-69162:2388751") - compile("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") - compile("com.github.GTNewHorizons:Baubles:1.0.1.14:dev") - - compile files("dependencies/OpenModularTurrets-1.7.10-2.2.10-237-deobf.jar") -} diff --git a/gradle.properties b/gradle.properties index 3d49d30e98..7fc32d532c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,64 +1,6 @@ -modName = TecTech - Tec Technology! - -# This is a case-sensitive string to identify your mod. Convention is to use lower case. -modId = tectech - -modGroup = com.github.technus.tectech - -# 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 - -# Select a username for testing your mod with breakpoints. You may leave this empty for a random user name 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" - -# Define a source file of your project with: -# public static final String VERSION = "GRADLETOKEN_VERSION"; -# The string's content will be replaced with your mods 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 = Reference.java -gradleTokenModId = -gradleTokenModName = -gradleTokenVersion = GRADLETOKEN_VERSION -gradleTokenGroupName = - -# 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. I must be placed into /src/main/resources/META-INF/ -# Example value: mymodid_at.cfg -accessTransformersFile = tectech_at.cfg - -# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled! -usesMixins = 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 compatability 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 - -# If enabled, you may use 'shadowImplementation' for dependencies. They will be integrated in your jar. It is your -# responsibility check the licence and request permission for distribution, if required. -usesShadowedDependencies = true - -# 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 = TecTech +#Dummy File, replaced in Jenkins +systemProp.org.gradle.internal.http.connectionTimeout=120000 +systemProp.org.gradle.internal.http.socketTimeout=120000 +keyStoreAlias=w +keyStore=w +keyStorePass=w diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar Binary files differindex 5c2d1cf016..758de960ec 100644 --- a/gradle/wrapper/gradle-wrapper.jar +++ b/gradle/wrapper/gradle-wrapper.jar diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 3ab0b725ef..5028f28f8e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists @@ -1,21 +1,5 @@ #!/usr/bin/env sh -# -# Copyright 2015 the original author or 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 UN*X @@ -44,7 +28,7 @@ APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` # 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"' +DEFAULT_JVM_OPTS="" # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" @@ -125,8 +109,8 @@ if $darwin; then GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" fi -# For Cygwin or MSYS, switch paths to Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` JAVACMD=`cygpath --unix "$JAVACMD"` diff --git a/gradlew.bat b/gradlew.bat index 9618d8d960..f9553162f1 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,19 +1,3 @@ -@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 @@ -30,7 +14,7 @@ set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @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" +set DEFAULT_JVM_OPTS= @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome diff --git a/libs/CoFHCore-[1.7.10]3.1.4-329-dev.jar b/libs/CoFHCore-[1.7.10]3.1.4-329-dev.jar Binary files differnew file mode 100644 index 0000000000..7a53464d53 --- /dev/null +++ b/libs/CoFHCore-[1.7.10]3.1.4-329-dev.jar diff --git a/libs/GT-PlusPlus-1.7.0-prerelease-8-final.jar b/libs/GT-PlusPlus-1.7.0-prerelease-8-final.jar Binary files differnew file mode 100644 index 0000000000..181475fc38 --- /dev/null +++ b/libs/GT-PlusPlus-1.7.0-prerelease-8-final.jar diff --git a/dependencies/OpenModularTurrets-1.7.10-2.2.10-237-deobf.jar b/libs/OpenModularTurrets-1.7.10-2.2.10-237-deobf.jar Binary files differindex e854bf7df9..e854bf7df9 100644 --- a/dependencies/OpenModularTurrets-1.7.10-2.2.10-237-deobf.jar +++ b/libs/OpenModularTurrets-1.7.10-2.2.10-237-deobf.jar diff --git a/real.gradle.properties b/real.gradle.properties new file mode 100644 index 0000000000..5cf1722acc --- /dev/null +++ b/real.gradle.properties @@ -0,0 +1,20 @@ +systemProp.org.gradle.internal.http.connectionTimeout=120000 +systemProp.org.gradle.internal.http.socketTimeout=120000 +projectVersion=4.10.8 +ic2Version=2.2.828-experimental +gt5uVersion=experimental-SNAPSHOT +yamcoreVersion=1.7.10-0.5.79 +opencomputersVersion=MC1.7.10-1.7.5.1291 +computercraftVersion=1.75 +baublesVersion=1.7.10-1.0.1.10 +thaumcraftVersion=1.7.10-4.2.3.5 +codechickenlibVersion=1.7.10-1.1.3.140 +codechickencoreVersion=1.7.10-1.0.7.47 +neiVersion=1.7.10-1.0.5.120 +wailaVersion=1.5.10_1.7.10 +galacticraftVersion=1.7-3.0.12.504 +galacticGregVersion=master-SNAPSHOT +buildcraftVersion=7.1.23 +forestryVersion=4.4.0.0 +enderioVersion=1.7.10-2.3.0.429_beta +enderCoreVersion=1.7.10-0.2.0.39_beta diff --git a/repositories.gradle b/repositories.gradle deleted file mode 100644 index a161653e0f..0000000000 --- a/repositories.gradle +++ /dev/null @@ -1,30 +0,0 @@ -// Add any additional repositories for your dependencies here - -repositories { - maven { - name = "GTNH Maven" - url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/" - } - maven { - name "OpenComputers Repo" - url = "http://maven.cil.li/" - } - maven { - name = "sponge" - url = "https://repo.spongepowered.org/repository/maven-public" - } - maven { - name = "ic2" - url = "http://maven.ic2.player.to/" - metadataSources { - mavenPom() - artifact() - } - } - maven { - url "https://cursemaven.com" - } - maven { - url = "https://jitpack.io" - } -} diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java index b061281daa..3278aa812b 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java @@ -1,6 +1,5 @@ package com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi; -import com.github.technus.tectech.TecTech; import com.github.technus.tectech.mechanics.elementalMatter.core.maps.EMInstanceStackMap; import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.EMInstanceStack; import com.github.technus.tectech.thing.block.QuantumGlassBlock; @@ -29,7 +28,9 @@ import static com.github.technus.tectech.mechanics.elementalMatter.core.transfor import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; import static com.github.technus.tectech.util.CommonValues.V; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofTileAdder; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; import static net.minecraft.util.StatCollector.translateToLocal; @@ -39,24 +40,6 @@ import static net.minecraft.util.StatCollector.translateToLocal; public class GT_MetaTileEntity_EM_essentiaDequantizer extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { //region structure //use multi A energy inputs, use less power the longer it runs - private static final IStructureDefinition<GT_MetaTileEntity_EM_essentiaDequantizer> STRUCTURE_DEFINITION = IStructureDefinition - .<GT_MetaTileEntity_EM_essentiaDequantizer>builder() - .addShape("main", new String[][]{ - {"&&&", "&~&", "&&&",}, - {"0 0", " * ", "0 0",}, - {"121", "232", "121",}, - {"$$$", "$2$", "$$$",}, - {"202", "0!0", "202",},}) - .addElement('0', ofBlockAnyMeta(QuantumGlassBlock.INSTANCE)) - .addElement('1', ofBlock(sBlockCasingsTT, 0)) - .addElement('2', ofBlock(sBlockCasingsTT, 4)) - .addElement('3', ofBlock(sBlockCasingsTT, 8)) - .addElement('&', ofHatchAdderOptional(GT_MetaTileEntity_EM_essentiaDequantizer::addClassicToMachineList, textureOffset, 1, sBlockCasingsTT, 0)) - .addElement('!', ofHatchAdderOptional(GT_MetaTileEntity_EM_essentiaDequantizer::addElementalInputToMachineList, textureOffset + 4, 2, sBlockCasingsTT, 4)) - .addElement('$', ofHatchAdderOptional(GT_MetaTileEntity_EM_essentiaDequantizer::addElementalMufflerToMachineList, textureOffset + 4, 2, sBlockCasingsTT, 4)) - .addElement('*', ofTileAdder(essentiaContainerCompat::check, StructureLibAPI.getBlockHint(),12)) - .build(); - private static final String[] description = new String[]{ EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":", translateToLocal("gt.blockmachines.multimachine.em.emtoessentia.hint.0"),//1 - Classic Hatches or High Power Casing @@ -65,6 +48,25 @@ public class GT_MetaTileEntity_EM_essentiaDequantizer extends GT_MetaTileEntity_ translateToLocal("gt.blockmachines.multimachine.em.emtoessentia.hint.3"),//General - Some sort of Essentia Storage }; + private static final IStructureDefinition<GT_MetaTileEntity_EM_essentiaDequantizer> STRUCTURE_DEFINITION = + IStructureDefinition.<GT_MetaTileEntity_EM_essentiaDequantizer>builder() + .addShape("main", new String[][]{ + {"DDD", "D~D", "DDD"}, + {"E E", " * ", "E E"}, + {"ABA", "BCB", "ABA"}, + {"FFF", "FBF", "FFF"}, + {"BEB", "EGE", "BEB"} + }) + .addElement('A', ofBlock(sBlockCasingsTT, 0)) + .addElement('B', ofBlock(sBlockCasingsTT, 4)) + .addElement('C', ofBlock(sBlockCasingsTT, 8)) + .addElement('D', ofHatchAdderOptional(GT_MetaTileEntity_EM_essentiaDequantizer::addClassicToMachineList, textureOffset, 1, sBlockCasingsTT, 0)) + .addElement('E', ofBlock(QuantumGlassBlock.INSTANCE, 0)) + .addElement('F', ofHatchAdderOptional(GT_MetaTileEntity_EM_essentiaDequantizer::addElementalMufflerToMachineList, textureOffset + 4, 3, sBlockCasingsTT, 4)) + .addElement('G', ofHatchAdder(GT_MetaTileEntity_EM_essentiaDequantizer::addElementalInputToMachineList, textureOffset + 4, 2)) + .addElement('*', ofTileAdder(essentiaContainerCompat::check, StructureLibAPI.getBlockHint(),12)) + .build(); + private String outputEssentiaName; //endregion @@ -130,8 +132,8 @@ public class GT_MetaTileEntity_EM_essentiaDequantizer extends GT_MetaTileEntity_ TileEntity container = essentiaContainerCompat.getContainer(this); if (container == null) { stopMachine(); - } else { - if (!essentiaContainerCompat.putInContainer(container, outputEssentiaName)) { + }else{ + if(!essentiaContainerCompat.putInContainer(container,outputEssentiaName)){ stopMachine(); } } @@ -156,11 +158,11 @@ public class GT_MetaTileEntity_EM_essentiaDequantizer extends GT_MetaTileEntity_ @Override public void construct(ItemStack stackSize, boolean hintsOnly) { IGregTechTileEntity iGregTechTileEntity = getBaseMetaTileEntity(); - int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX; - int yDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetY; - int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ; + int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX; + int yDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetY; + int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ; if (hintsOnly) { - TecTech.proxy.hint_particle(iGregTechTileEntity.getWorld(), + StructureLibAPI.hintParticle(iGregTechTileEntity.getWorld(), iGregTechTileEntity.getXCoord() + xDir, iGregTechTileEntity.getYCoord() + yDir, iGregTechTileEntity.getZCoord() + zDir, @@ -185,7 +187,7 @@ public class GT_MetaTileEntity_EM_essentiaDequantizer extends GT_MetaTileEntity_ @Override public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); - aNBT.setString("eOutputEssentia", outputEssentiaName); + aNBT.setString("eOutputEssentia",outputEssentiaName); } @Override @@ -193,4 +195,9 @@ public class GT_MetaTileEntity_EM_essentiaDequantizer extends GT_MetaTileEntity_ super.loadNBTData(aNBT); outputEssentiaName = aNBT.getString("eOutputEssentia"); } -}
\ No newline at end of file + + @Override + public IStructureDefinition<? extends GT_MetaTileEntity_MultiblockBase_EM> getStructure_EM() { + return STRUCTURE_DEFINITION; + } +} diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java index 6d315fa30a..debbcd2ae0 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java @@ -1,6 +1,5 @@ package com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi; -import com.github.technus.tectech.TecTech; import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.EMPrimalAspectDefinition; import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.IEMDefinition; import com.github.technus.tectech.mechanics.elementalMatter.core.maps.EMInstanceStackMap; @@ -27,7 +26,9 @@ import static com.github.technus.tectech.mechanics.elementalMatter.core.transfor import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; import static com.github.technus.tectech.util.CommonValues.V; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofTileAdder; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; import static net.minecraft.util.StatCollector.translateToLocal; @@ -37,24 +38,6 @@ import static net.minecraft.util.StatCollector.translateToLocal; public class GT_MetaTileEntity_EM_essentiaQuantizer extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { //region structure //use multi A energy inputs, use less power the longer it runs - private static final IStructureDefinition<GT_MetaTileEntity_EM_essentiaQuantizer> STRUCTURE_DEFINITION = IStructureDefinition - .<GT_MetaTileEntity_EM_essentiaQuantizer>builder() - .addShape("main", new String[][]{ - {"&&&", "&~&", "&&&",}, - {"0 0", " * ", "0 0",}, - {"121", "232", "121",}, - {"$$$", "$1$", "$$$",}, - {"010", "1!1", "010",},}) - .addElement('0', ofBlockAnyMeta(QuantumGlassBlock.INSTANCE)) - .addElement('1', ofBlock(sBlockCasingsTT, 4)) - .addElement('2', ofBlock(sBlockCasingsTT, 0)) - .addElement('3', ofBlock(sBlockCasingsTT, 8)) - .addElement('&', ofHatchAdderOptional(GT_MetaTileEntity_EM_essentiaQuantizer::addClassicToMachineList, textureOffset, 1, sBlockCasingsTT, 0)) - .addElement('!', ofHatchAdderOptional(GT_MetaTileEntity_EM_essentiaQuantizer::addElementalOutputToMachineList, textureOffset + 4, 2, sBlockCasingsTT, 4)) - .addElement('$', ofHatchAdderOptional(GT_MetaTileEntity_EM_essentiaQuantizer::addElementalMufflerToMachineList, textureOffset + 4, 2, sBlockCasingsTT, 4)) - .addElement('*', ofTileAdder(essentiaContainerCompat::check, StructureLibAPI.getBlockHint(),12)) - .build(); - private static final String[] description = new String[]{ EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":", translateToLocal("gt.blockmachines.multimachine.em.essentiatoem.hint.0"),//1 - Classic Hatches or High Power Casing @@ -62,6 +45,25 @@ public class GT_MetaTileEntity_EM_essentiaQuantizer extends GT_MetaTileEntity_Mu translateToLocal("gt.blockmachines.multimachine.em.essentiatoem.hint.2"),//3 - Elemental Overflow Hatches or Elemental Casing translateToLocal("gt.blockmachines.multimachine.em.essentiatoem.hint.3"),//General - Some sort of Essentia Storage }; + + private static final IStructureDefinition<GT_MetaTileEntity_EM_essentiaQuantizer> STRUCTURE_DEFINITION = + IStructureDefinition.<GT_MetaTileEntity_EM_essentiaQuantizer>builder() + .addShape("main", new String[][]{ + {"FFF", "F~F", "FFF"}, + {"E E", " * ", "E E"}, + {"BAB", "ACA", "BAB"}, + {"DDD", "DBD", "DDD"}, + {"EBE", "BGB", "EBE"} + }) + .addElement('A', ofBlock(sBlockCasingsTT, 0)) + .addElement('B', ofBlock(sBlockCasingsTT, 4)) + .addElement('C', ofBlock(sBlockCasingsTT, 8)) + .addElement('D', ofHatchAdderOptional(GT_MetaTileEntity_EM_essentiaQuantizer::addElementalMufflerToMachineList, textureOffset + 4, 3, sBlockCasingsTT, 4)) + .addElement('E', ofBlock(QuantumGlassBlock.INSTANCE, 0)) + .addElement('F', ofHatchAdderOptional(GT_MetaTileEntity_EM_essentiaQuantizer::addClassicToMachineList, textureOffset, 1, sBlockCasingsTT, 0)) + .addElement('G', ofHatchAdder(GT_MetaTileEntity_EM_essentiaQuantizer::addElementalOutputToMachineList, textureOffset + 4, 2)) + .addElement('*', ofTileAdder(essentiaContainerCompat::check, StructureLibAPI.getBlockHint(),12)) + .build(); //endregion public GT_MetaTileEntity_EM_essentiaQuantizer(int aID, String aName, String aNameRegional) { @@ -134,7 +136,7 @@ public class GT_MetaTileEntity_EM_essentiaQuantizer extends GT_MetaTileEntity_Mu int yDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetY; int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ; if (hintsOnly) { - TecTech.proxy.hint_particle(iGregTechTileEntity.getWorld(), + StructureLibAPI.hintParticle(iGregTechTileEntity.getWorld(), iGregTechTileEntity.getXCoord() + xDir, iGregTechTileEntity.getYCoord() + yDir, iGregTechTileEntity.getZCoord() + zDir, @@ -152,7 +154,12 @@ public class GT_MetaTileEntity_EM_essentiaQuantizer extends GT_MetaTileEntity_Mu } @Override + public IStructureDefinition<GT_MetaTileEntity_EM_essentiaQuantizer> getStructure_EM() { + return STRUCTURE_DEFINITION; + } + + @Override public String[] getStructureDescription(ItemStack stackSize) { return description; } -}
\ No newline at end of file +} diff --git a/src/main/java/com/github/technus/tectech/entity/fx/WeightlessParticleFX.java b/src/main/java/com/github/technus/tectech/entity/fx/WeightlessParticleFX.java deleted file mode 100644 index d1d2ed611c..0000000000 --- a/src/main/java/com/github/technus/tectech/entity/fx/WeightlessParticleFX.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.github.technus.tectech.entity.fx; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.client.particle.EntityFX; -import net.minecraft.world.World; - -@SideOnly(Side.CLIENT) -public class WeightlessParticleFX extends EntityFX -{ - public WeightlessParticleFX(World p_i1205_1_, double p_i1205_2_, double p_i1205_4_, double p_i1205_6_, double p_i1205_8_, double p_i1205_10_, double p_i1205_12_) - { - super(p_i1205_1_, p_i1205_2_, p_i1205_4_, p_i1205_6_, p_i1205_8_, p_i1205_10_, p_i1205_12_); - this.motionX = p_i1205_8_ + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.05F); - this.motionY = p_i1205_10_ + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.05F); - this.motionZ = p_i1205_12_ + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.05F); - this.particleRed = this.particleGreen = this.particleBlue = this.rand.nextFloat() * 0.3F + 0.7F; - this.particleScale = this.rand.nextFloat() * this.rand.nextFloat() * 6.0F + 1.0F; - this.particleMaxAge = (int)(16.0D / ((double)this.rand.nextFloat() * 0.8D + 0.2D)) + 2; - this.noClip=true; - } - - /** - * Called to update the entity's position/logic. - */ - public void onUpdate() - { - this.prevPosX = this.posX; - this.prevPosY = this.posY; - this.prevPosZ = this.posZ; - - if (this.particleAge++ >= this.particleMaxAge) - { - this.setDead(); - } - - this.setParticleTextureIndex(7 - this.particleAge * 8 / this.particleMaxAge); - //this.motionY += 0.004D; - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= 0.8999999761581421D; - this.motionY *= 0.8999999761581421D; - this.motionZ *= 0.8999999761581421D; - } -} diff --git a/src/main/java/com/github/technus/tectech/loader/MainLoader.java b/src/main/java/com/github/technus/tectech/loader/MainLoader.java index fd638aba6d..3b99cd987b 100644 --- a/src/main/java/com/github/technus/tectech/loader/MainLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/MainLoader.java @@ -75,11 +75,11 @@ public final class MainLoader { } } - public static void load(EMDefinitionsRegistry registry) { + public static void load(EMDefinitionsRegistry definitionsRegistry) { ProgressManager.ProgressBar progressBarLoad = ProgressManager.push("TecTech Loader", 9); progressBarLoad.step("Elemental Things"); - new ElementalLoader().run(registry); + new ElementalLoader().run(definitionsRegistry); LOGGER.info("Elemental Init Done"); progressBarLoad.step("Thaumcraft Compatibility"); @@ -124,8 +124,8 @@ public final class MainLoader { ProgressManager.pop(progressBarLoad); } - public static void postLoad(EMDefinitionsRegistry registry, EMTransformationRegistry transformationInfo) { - ProgressManager.ProgressBar progressBarPostLoad = ProgressManager.push("TecTech Post Loader", 5); + public static void postLoad(EMDefinitionsRegistry definitionsRegistry, EMTransformationRegistry transformationInfo) { + ProgressManager.ProgressBar progressBarPostLoad = ProgressManager.push("TecTech Post Loader", 4); progressBarPostLoad.step("Dreamcraft Compatibility"); if(Loader.isModLoaded(Reference.DREAMCRAFT)){ @@ -142,16 +142,21 @@ public final class MainLoader { } progressBarPostLoad.step("Thaumcraft Compatibility"); - aspectDefinitionCompat = Loader.isModLoaded(Reference.THAUMCRAFT) ? new AspectDefinitionCompatEnabled() : new AspectDefinitionCompat(); - aspectDefinitionCompat.run(registry); + if (Loader.isModLoaded(Reference.THAUMCRAFT)) { + aspectDefinitionCompat = new AspectDefinitionCompatEnabled(); + aspectDefinitionCompat.run(definitionsRegistry); + } else { + aspectDefinitionCompat = new AspectDefinitionCompat(); + } progressBarPostLoad.step("Recipes"); new BaseRecipeLoader().run(transformationInfo); TecTech.LOGGER.info("Recipe Init Done"); - progressBarPostLoad.step("Register Extra Hazmat Suits"); - registerExtraHazmats(); - TecTech.LOGGER.info("Hazmat additions done"); + //Hazmat moved to GT5U + //progressBarPostLoad.step("Register Extra Hazmat Suits"); + //registerExtraHazmats(); + //TecTech.LOGGER.info("Hazmat additions done"); if (!configTecTech.DISABLE_BLOCK_HARDNESS_NERF) { progressBarPostLoad.step("Nerf blocks blast resistance"); diff --git a/src/main/java/com/github/technus/tectech/loader/recipe/BaseRecipeLoader.java b/src/main/java/com/github/technus/tectech/loader/recipe/BaseRecipeLoader.java index c6c71ae630..20f58b739b 100644 --- a/src/main/java/com/github/technus/tectech/loader/recipe/BaseRecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/recipe/BaseRecipeLoader.java @@ -28,8 +28,8 @@ import static gregtech.api.enums.GT_Values.RA; * Created by danie_000 on 16.11.2016. */ public class BaseRecipeLoader { - public static Materials getOrDefault(String name,Materials def){ - Materials mat=Materials.get(name); + public static Materials getOrDefault(String name, Materials def) { + Materials mat = Materials.get(name); return mat == Materials._NULL || mat == null ? def : mat; } @@ -51,6 +51,20 @@ public class BaseRecipeLoader { new ItemStack(StructureLibAPI.getBlockHint(), 1, i), 32, 120); } + //Scrench +// GT_ModHandler.addCraftingRecipe(new ItemStack(FrontRotationTriggerItem.INSTANCE,1), +// GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, +// new Object[]{"fPR", " RP", "S h", +// 'P', OrePrefixes.plate.get(Materials.Cobalt), +// 'R', OrePrefixes.stick.get(Materials.Cobalt), +// 'S', OrePrefixes.stick.get(Materials.Wood),}); + + //BLUEprint +// GT_ModHandler.addShapelessCraftingRecipe(new ItemStack(ConstructableTriggerItem.INSTANCE, 1), +// GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, +// new Object[]{Dyes.dyeBlue, OrePrefixes.plate.get(Materials.Paper), Dyes.dyeBlue, Dyes.dyeWhite}); + + //GT EU reader GT_ModHandler.addCraftingRecipe(new ItemStack(EuMeterGT.INSTANCE,1), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, diff --git a/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java b/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java index f8dc6a2d74..d7baec4ef5 100644 --- a/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java +++ b/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java @@ -2,7 +2,6 @@ package com.github.technus.tectech.proxy; import com.github.technus.tectech.Reference; import com.github.technus.tectech.compatibility.openmodularturrets.TT_turret_loader; -import com.github.technus.tectech.entity.fx.WeightlessParticleFX; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.block.QuantumGlassRender; import com.github.technus.tectech.thing.block.QuantumStuffBlock; @@ -10,6 +9,7 @@ import com.github.technus.tectech.thing.block.QuantumStuffRender; import com.github.technus.tectech.thing.item.DebugElementalInstanceContainer_EM; import com.github.technus.tectech.thing.item.ElementalDefinitionContainer_EM; import com.github.technus.tectech.thing.item.renderElemental.RenderElementalName; +import com.gtnewhorizon.structurelib.entity.fx.WeightlessParticleFX; import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.common.Loader; diff --git a/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java b/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java index 490cdf1092..0fbe8d890e 100644 --- a/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java +++ b/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java @@ -2,22 +2,16 @@ package com.github.technus.tectech.proxy; import cpw.mods.fml.common.network.IGuiHandler; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.server.MinecraftServer; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.ChatComponentText; -import net.minecraft.util.IIcon; import net.minecraft.world.World; import net.minecraft.world.WorldServer; public class CommonProxy implements IGuiHandler { public void registerRenderInfo() {} - public void hint_particle_tinted(World w,int x, int y, int z, IIcon[] icons,short[] RGBa){} - public void hint_particle_tinted(World w,int x, int y, int z, Block block, int meta,short[] RGBa){} - public void hint_particle(World w,int x, int y, int z, IIcon[] icons){} - public void hint_particle(World w,int x, int y, int z, Block block, int meta){} public void em_particle(IGregTechTileEntity aMuffler, byte facing) {}//CUTE! public void pollutor_particle(IGregTechTileEntity aPollutor, byte facing) {}//CUTE! public void em_particle(World w,double x, double y, double z){} diff --git a/src/main/java/com/github/technus/tectech/thing/casing/GT_Item_HintTT.java b/src/main/java/com/github/technus/tectech/thing/casing/GT_Item_HintTT.java deleted file mode 100644 index 426e7d569b..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/casing/GT_Item_HintTT.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.github.technus.tectech.thing.casing; - -import gregtech.common.blocks.GT_Item_Casings_Abstract; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; - -import java.util.List; - -import static com.github.technus.tectech.util.CommonValues.TEC_MARK_GENERAL; -import static net.minecraft.util.StatCollector.translateToLocal; - -/** - * Created by danie_000 on 03.10.2016. - */ -public class GT_Item_HintTT extends GT_Item_Casings_Abstract { - public GT_Item_HintTT(Block par1) { - super(par1); - } - - @Override - public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { - aList.add(TEC_MARK_GENERAL); - aList.add(translateToLocal("gt.blockhintTT.desc.0"));//Helps while building - switch (aStack.getItemDamage()) { - case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 11: - aList.add(EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + translateToLocal("gt.blockhintTT.desc.1"));//Placeholder for a certain group. - break; - case 12: - aList.add(EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + translateToLocal("gt.blockhintTT.desc.2"));//General placeholder. - break; - case 13: - aList.add(EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + translateToLocal("gt.blockhintTT.desc.3"));//Make sure it contains Air material. - break; - case 14: - aList.add(EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + translateToLocal("gt.blockhintTT.desc.4"));//Make sure it does not contain Air material. - break; - case 15: - aList.add(EnumChatFormatting.BLUE.toString() + translateToLocal("gt.blockhintTT.desc.5"));//ERROR, what did u expect? - break; - default://WTF? - aList.add("Damn son where did you get that!?"); - aList.add(EnumChatFormatting.BLUE.toString() + "From outer space... I guess..."); - } - } -} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java index 4580c545af..ba3bfe728d 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java @@ -6,7 +6,6 @@ import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_Rend import com.github.technus.tectech.util.CommonValues; import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; -import com.gtnewhorizon.structurelib.structure.StructureDefinition; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; @@ -41,7 +40,7 @@ public class GT_MetaTileEntity_EM_annihilation extends GT_MetaTileEntity_Multibl //region structure private static final IStructureDefinition<GT_MetaTileEntity_EM_annihilation> STRUCTURE_DEFINITION = - StructureDefinition.<GT_MetaTileEntity_EM_annihilation>builder() + IStructureDefinition.<GT_MetaTileEntity_EM_annihilation>builder() .addShape("main", transpose(new String[][]{ {" "," AB BA "," AB BA "," BBB "," A A A ","AA F AA"," A A A "," BBB "," AB BA "," AB BA "," "}, {" "," AB BA "," EECEEECEE "," EGGEEEGGE ","ACGGGEGGGCA","AEGGGDGGGEA","ACGGGEGGGCA"," EGGEEEGGE "," EECEEECEE "," AB BA "," "}, @@ -123,4 +122,4 @@ public class GT_MetaTileEntity_EM_annihilation extends GT_MetaTileEntity_Multibl public String[] getStructureDescription(ItemStack stackSize) { return description; } -}
\ No newline at end of file +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java index 363f184ebc..5f177ef859 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java @@ -6,7 +6,6 @@ import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_Rend import com.github.technus.tectech.util.CommonValues; import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; -import com.gtnewhorizon.structurelib.structure.StructureDefinition; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; @@ -50,7 +49,7 @@ public class GT_MetaTileEntity_EM_bhg extends GT_MetaTileEntity_MultiblockBase_E //region structure actual private static final IStructureDefinition<GT_MetaTileEntity_EM_bhg> STRUCTURE_DEFINITION= - StructureDefinition.<GT_MetaTileEntity_EM_bhg>builder() + IStructureDefinition.<GT_MetaTileEntity_EM_bhg>builder() .addShape("main_t1", transpose(new String[][]{ {" "," "," "," "," "," "," "," "," "," "," "," "," C C "," C C "," C C "," CCCCCCCCC "," C C "," CCCCCCCCC "," C C "," C C "," C C "," "," "," "," "," "," "," "," "," "," "," "," "}, {" "," "," "," "," "," "," "," "," "," C C "," C C "," C C "," C C "," DDDDD "," DDCDCDD "," CCCCDCCDCCDCCCC "," DDDDDDD "," CCCCDCCDCCDCCCC "," DDCDCDD "," DDDDD "," C C "," C C "," C C "," C C "," "," "," "," "," "," "," "," "," "}, @@ -318,4 +317,4 @@ public class GT_MetaTileEntity_EM_bhg extends GT_MetaTileEntity_MultiblockBase_E public String[] getStructureDescription(ItemStack stackSize) { return description; } -}
\ No newline at end of file +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java index 3e2b029bba..faa48d39de 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java @@ -11,7 +11,6 @@ import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.util.Util; import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; -import com.gtnewhorizon.structurelib.structure.StructureDefinition; import com.gtnewhorizon.structurelib.util.Vec3Impl; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -59,7 +58,7 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB }; private static final IStructureDefinition<GT_MetaTileEntity_EM_computer> STRUCTURE_DEFINITION = - StructureDefinition.<GT_MetaTileEntity_EM_computer>builder() + IStructureDefinition.<GT_MetaTileEntity_EM_computer>builder() .addShape("front", transpose(new String[][]{ {" AA"}, {" AA"}, diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafting.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafting.java index 22e4ea5eea..65870f9e76 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafting.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafting.java @@ -6,7 +6,6 @@ import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_Rend import com.github.technus.tectech.util.CommonValues; import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; -import com.gtnewhorizon.structurelib.structure.StructureDefinition; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; @@ -43,8 +42,8 @@ public class GT_MetaTileEntity_EM_crafting extends GT_MetaTileEntity_MultiblockB translateToLocal("gt.blockmachines.multimachine.em.crafter.hint.1"),//2 - Elemental Hatches or Molecular Casing }; - private static final IStructureDefinition<GT_MetaTileEntity_EM_crafting> STRUCTURE_DEFINITION= StructureDefinition - .<GT_MetaTileEntity_EM_crafting>builder() + private static final IStructureDefinition<GT_MetaTileEntity_EM_crafting> STRUCTURE_DEFINITION= + IStructureDefinition.<GT_MetaTileEntity_EM_crafting>builder() .addShape("main", transpose(new String[][]{ {" AAA ","AAAAA","A A","BBBBB","BGCGB","BGGGB","BGCGB","BBBBB","A A","AAAAA"," AAA "}, {"AHHHA","AAAAA"," FFF ","BBBBB","GGGGG","GGGGG","GGGGG","BBBBB"," FFF ","AAAAA","AHHHA"}, @@ -120,4 +119,4 @@ public class GT_MetaTileEntity_EM_crafting extends GT_MetaTileEntity_MultiblockB public String[] getStructureDescription(ItemStack stackSize) { return description; } -}
\ No newline at end of file +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java index cccdbbd2d9..84e6026448 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java @@ -11,7 +11,6 @@ import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_Rend import com.github.technus.tectech.util.CommonValues; import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; -import com.gtnewhorizon.structurelib.structure.StructureDefinition; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; @@ -51,7 +50,7 @@ public class GT_MetaTileEntity_EM_dataBank extends GT_MetaTileEntity_MultiblockB }; private static final IStructureDefinition<GT_MetaTileEntity_EM_dataBank> STRUCTURE_DEFINITION = - StructureDefinition.<GT_MetaTileEntity_EM_dataBank>builder() + IStructureDefinition.<GT_MetaTileEntity_EM_dataBank>builder() .addShape("main", transpose(new String[][]{ {"BCCCB","BDDDB","BDDDB"}, {"BC~CB","BAAAB","BDDDB"}, @@ -187,4 +186,4 @@ public class GT_MetaTileEntity_EM_dataBank extends GT_MetaTileEntity_MultiblockB public String[] getStructureDescription(ItemStack stackSize) { return description; } -}
\ No newline at end of file +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java index 0da76c2fce..0b8a521581 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java @@ -20,6 +20,7 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import gregtech.api.util.GT_Utility; import ic2.core.init.MainConfig; import ic2.core.util.ConfigUtil; import net.minecraft.client.renderer.texture.IIconRegister; @@ -37,6 +38,7 @@ import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStat import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.STATUS_TOO_LOW; import static com.github.technus.tectech.util.CommonValues.VN; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; import static net.minecraft.util.StatCollector.translateToLocal; import static net.minecraft.util.StatCollector.translateToLocalFormatted; @@ -57,32 +59,28 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase //endregion //region structure - public static final IStructureDefinition<GT_MetaTileEntity_EM_decay> STRUCTURE_DEFINITION=IStructureDefinition - .<GT_MetaTileEntity_EM_decay>builder() - .addShape("main",new String[][]{ - {"0 0", " &&& ", " &~& ", " &&& ", "0 0",}, - {"00000", "00000", "00000", "00000", "00000",}, - {"0 0", " !!! ", " !0! ", " !!! ", "0 0",}, - {"01110", "12221", "12221", "12221", "01110",}, - {"01310", "12221", "32223", "12221", "01310",}, - {"01110", "12221", "12221", "12221", "01110",}, - {"0 0", " !!! ", " !0! ", " !!! ", "0 0",}, - {"00000", "00000", "00000", "00000", "00000",}, - {"0 0", " &&& ", " &&& ", " &&& ", "0 0",}, - }) - .addElement('0', ofBlock(sBlockCasingsTT,4)) - .addElement('1', ofBlock(sBlockCasingsTT,5)) - .addElement('2',ofBlock(sBlockCasingsTT,8)) - .addElement('3',ofBlock(sBlockCasingsTT,6)) - .addElement('&', ofHatchAdderOptional(GT_MetaTileEntity_EM_decay::addClassicToMachineList,textureOffset,1,sBlockCasingsTT,0)) - .addElement('!', ofHatchAdderOptional(GT_MetaTileEntity_EM_decay::addElementalToMachineList,textureOffset+4,2,sBlockCasingsTT,4)) - .build(); - private static final String[] description = new String[]{ EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":", translateToLocal("gt.blockmachines.multimachine.em.decay.hint.0"),//1 - Classic Hatches or High Power Casing translateToLocal("gt.blockmachines.multimachine.em.decay.hint.1"),//2 - Elemental Hatches or Molecular Casing }; + + private static final IStructureDefinition<GT_MetaTileEntity_EM_decay> STRUCTURE_DEFINITION = + IStructureDefinition.<GT_MetaTileEntity_EM_decay>builder() + .addShape("main",transpose(new String[][]{ + {"A A","AAAAA","A A","ABBBA","ABCBA","ABBBA","A A","AAAAA","A A"}, + {" FFF ","AAAAA"," EEE ","BDDDB","BDDDB","BDDDB"," EEE ","AAAAA"," FFF "}, + {" F~F ","AAAAA"," EAE ","BDDDB","CDDDC","BDDDB"," EAE ","AAAAA"," FFF "}, + {" FFF ","AAAAA"," EEE ","BDDDB","BDDDB","BDDDB"," EEE ","AAAAA"," FFF "}, + {"A A","AAAAA","A A","ABBBA","ABCBA","ABBBA","A A","AAAAA","A A"} + })) + .addElement('A', ofBlock(sBlockCasingsTT, 4)) + .addElement('B', ofBlock(sBlockCasingsTT, 5)) + .addElement('C', ofBlock(sBlockCasingsTT, 6)) + .addElement('D', ofBlock(sBlockCasingsTT, 8)) + .addElement('E', ofHatchAdderOptional(GT_MetaTileEntity_EM_decay::addElementalToMachineList, textureOffset + 4, 2, sBlockCasingsTT, 4)) + .addElement('F', ofHatchAdderOptional(GT_MetaTileEntity_EM_decay::addClassicToMachineList, textureOffset, 1, sBlockCasingsTT, 0)) + .build(); //endregion //region parameters @@ -190,21 +188,30 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase return new String[]{ translateToLocalFormatted("tt.keyword.Progress", clientLocale) + ":", - EnumChatFormatting.GREEN + Integer.toString(mProgresstime / 20) + EnumChatFormatting.RESET + " s / " + - EnumChatFormatting.YELLOW + mMaxProgresstime / 20 + EnumChatFormatting.RESET + " s", + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(mProgresstime / 20) + EnumChatFormatting.RESET + " s / " + + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(mMaxProgresstime / 20) + EnumChatFormatting.RESET + " s", translateToLocalFormatted("tt.keyphrase.Energy_Hatches", clientLocale) + ":", - EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET + " EU / " + - EnumChatFormatting.YELLOW + maxEnergy + EnumChatFormatting.RESET + " EU", + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(storedEnergy) + EnumChatFormatting.RESET + " EU / " + + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(maxEnergy) + EnumChatFormatting.RESET + " EU", (mEUt <= 0 ? translateToLocalFormatted("tt.keyphrase.Probably_uses", clientLocale) + ": " : translateToLocalFormatted("tt.keyphrase.Probably_makes", clientLocale) + ": ") + - EnumChatFormatting.RED + Math.abs(mEUt) + EnumChatFormatting.RESET + " EU/t at " + - EnumChatFormatting.RED + eAmpereFlow + EnumChatFormatting.RESET + " A", - translateToLocalFormatted("tt.keyphrase.Tier_Rating", clientLocale) + ": " + EnumChatFormatting.YELLOW + VN[getMaxEnergyInputTier_EM()] + EnumChatFormatting.RESET + " / " + EnumChatFormatting.GREEN + VN[getMinEnergyInputTier_EM()] + EnumChatFormatting.RESET + - " " + translateToLocalFormatted("tt.keyphrase.Amp_Rating", clientLocale) + ": " + EnumChatFormatting.GREEN + eMaxAmpereFlow + EnumChatFormatting.RESET + " A", - translateToLocalFormatted("tt.keyword.Problems", clientLocale) + ": " + EnumChatFormatting.RED + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET + - " " + translateToLocalFormatted("tt.keyword.Efficiency", clientLocale) + ": " + EnumChatFormatting.YELLOW + mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", - translateToLocalFormatted("tt.keyword.PowerPass", clientLocale) + ": " + EnumChatFormatting.BLUE + ePowerPass + EnumChatFormatting.RESET + - " " + translateToLocalFormatted("tt.keyword.SafeVoid", clientLocale) + ": " + EnumChatFormatting.BLUE + eSafeVoid, - translateToLocalFormatted("tt.keyword.Computation", clientLocale) + ": " + EnumChatFormatting.GREEN + eAvailableData + EnumChatFormatting.RESET + " / " + EnumChatFormatting.YELLOW + eRequiredData + EnumChatFormatting.RESET, + EnumChatFormatting.RED + GT_Utility.formatNumbers(Math.abs(mEUt)) + EnumChatFormatting.RESET + " EU/t at " + + EnumChatFormatting.RED + GT_Utility.formatNumbers(eAmpereFlow) + EnumChatFormatting.RESET + " A", + translateToLocalFormatted("tt.keyphrase.Tier_Rating", clientLocale) + ": " + + EnumChatFormatting.YELLOW + VN[getMaxEnergyInputTier_EM()] + EnumChatFormatting.RESET + " / " + + EnumChatFormatting.GREEN + VN[getMinEnergyInputTier_EM()] + EnumChatFormatting.RESET + " " + + translateToLocalFormatted("tt.keyphrase.Amp_Rating", clientLocale) + ": " + + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(eMaxAmpereFlow) + EnumChatFormatting.RESET + " A", + translateToLocalFormatted("tt.keyword.Problems", clientLocale) + ": " + + EnumChatFormatting.RED + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET + " " + + translateToLocalFormatted("tt.keyword.Efficiency", clientLocale) + ": " + + EnumChatFormatting.YELLOW + mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", + translateToLocalFormatted("tt.keyword.PowerPass", clientLocale) + ": " + + EnumChatFormatting.BLUE + ePowerPass + EnumChatFormatting.RESET + " " + + translateToLocalFormatted("tt.keyword.SafeVoid", clientLocale) + ": " + + EnumChatFormatting.BLUE + eSafeVoid, + translateToLocalFormatted("tt.keyword.Computation", clientLocale) + ": " + + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(eAvailableData) + EnumChatFormatting.RESET + " / " + + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(eRequiredData) + EnumChatFormatting.RESET, }; } @@ -253,7 +260,12 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase } @Override + public IStructureDefinition<GT_MetaTileEntity_EM_decay> getStructure_EM() { + return STRUCTURE_DEFINITION; + } + + @Override public String[] getStructureDescription(ItemStack stackSize) { return description; } -}
\ No newline at end of file +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java index 02a049290d..ba1ac8b298 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java @@ -31,7 +31,7 @@ import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texture import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; import static com.github.technus.tectech.util.CommonValues.V; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlockAnyMeta; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; import static net.minecraft.util.StatCollector.translateToLocal; @@ -42,21 +42,21 @@ import static net.minecraft.util.StatCollector.translateToLocal; public class GT_MetaTileEntity_EM_dequantizer extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { //region structure //use multi A energy inputs, use less power the longer it runs - private static final IStructureDefinition<GT_MetaTileEntity_EM_dequantizer> STRUCTURE_DEFINITION = IStructureDefinition - .<GT_MetaTileEntity_EM_dequantizer>builder() - .addShape("main", new String[][]{ - {"&&&", "&~&", "&&&",}, - {"010", "111", "010",}, - {"$$$", "$1$", "$$$",}, - {"121", "2!2", "121",}, - }) - .addElement('0', ofBlock(sBlockCasingsTT, 0)) - .addElement('1', ofBlock(sBlockCasingsTT, 4)) - .addElement('2', ofBlockAnyMeta(QuantumGlassBlock.INSTANCE)) - .addElement('&', ofHatchAdderOptional(GT_MetaTileEntity_EM_dequantizer::addClassicToMachineList, textureOffset, 1, sBlockCasingsTT, 0)) - .addElement('!', ofHatchAdder(GT_MetaTileEntity_EM_dequantizer::addElementalInputToMachineList, textureOffset + 4, 2)) - .addElement('$', ofHatchAdderOptional(GT_MetaTileEntity_EM_dequantizer::addElementalMufflerToMachineList, textureOffset + 4, 3,sBlockCasingsTT,4)) - .build(); + + private static final IStructureDefinition<GT_MetaTileEntity_EM_dequantizer> STRUCTURE_DEFINITION = + IStructureDefinition.<GT_MetaTileEntity_EM_dequantizer>builder() + .addShape("main", transpose(new String[][]{ + {"CCC", "ABA", "EEE", "BDB"}, + {"C~C", "BBB", "EBE", "DFD"}, + {"CCC", "ABA", "EEE", "BDB"} + })) + .addElement('A', ofBlock(sBlockCasingsTT, 0)) + .addElement('B', ofBlock(sBlockCasingsTT, 4)) + .addElement('D', ofBlock(QuantumGlassBlock.INSTANCE, 0)) + .addElement('C', ofHatchAdderOptional(GT_MetaTileEntity_EM_dequantizer::addClassicToMachineList, textureOffset, 1, sBlockCasingsTT, 0)) + .addElement('F', ofHatchAdder(GT_MetaTileEntity_EM_dequantizer::addElementalInputToMachineList, textureOffset + 4, 2)) + .addElement('E', ofHatchAdderOptional(GT_MetaTileEntity_EM_dequantizer::addElementalMufflerToMachineList, textureOffset + 4, 3, sBlockCasingsTT, 4)) + .build(); private static final String[] description = new String[]{ EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":", @@ -77,7 +77,7 @@ public class GT_MetaTileEntity_EM_dequantizer extends GT_MetaTileEntity_Multiblo private void startRecipe(IEMStack from, long energy) { mMaxProgresstime = 20; mEfficiencyIncrease = 10000; - double mass = from.getMass(); + double mass = from.getMass(); double euMult = Math.abs(mass / refMass); eAmpereFlow = (int) Math.ceil(Math.sqrt(Math.sqrt(euMult))); if (mass > refUnstableMass || from.getDefinition().getRawTimeSpan(energy) < STABLE_RAW_LIFE_TIME) { @@ -103,13 +103,13 @@ public class GT_MetaTileEntity_EM_dequantizer extends GT_MetaTileEntity_Multiblo EMInstanceStackMap map = in.getContentHandler(); for (EMInstanceStack stack : map.valuesToArray()) { EMDequantizationInfo emDequantizationInfo = TecTech.transformationInfo.getInfoMap().get(stack.getDefinition()); - if(emDequantizationInfo!=null && emDequantizationInfo.getStack()!=null && map.removeAllAmounts(emDequantizationInfo.getInput())){ - Object out=emDequantizationInfo.getStack(); - if(out instanceof ItemStack){ - mOutputItems=new ItemStack[]{emDequantizationInfo.getItem()}; - }else if(out instanceof FluidStack){ - mOutputFluids=new FluidStack[]{emDequantizationInfo.getFluid()}; - }else if(out instanceof OreDictionaryStack){ + if (emDequantizationInfo != null && emDequantizationInfo.getStack() != null && map.removeAllAmounts(emDequantizationInfo.getInput())) { + Object out = emDequantizationInfo.getStack(); + if (out instanceof ItemStack) { + mOutputItems = new ItemStack[]{emDequantizationInfo.getItem()}; + } else if (out instanceof FluidStack) { + mOutputFluids = new FluidStack[]{emDequantizationInfo.getFluid()}; + } else if (out instanceof OreDictionaryStack) { ArrayList<ItemStack> items = OreDictionary.getOres(OreDictionary.getOreName(emDequantizationInfo.getOre().getOreId())); if (items != null && !items.isEmpty()) { mOutputItems = new ItemStack[]{items.get(0)}; @@ -144,7 +144,12 @@ public class GT_MetaTileEntity_EM_dequantizer extends GT_MetaTileEntity_Multiblo } @Override + public IStructureDefinition<GT_MetaTileEntity_EM_dequantizer> getStructure_EM() { + return STRUCTURE_DEFINITION; + } + + @Override public String[] getStructureDescription(ItemStack stackSize) { return description; } -}
\ No newline at end of file +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java index 2e9a07071e..207768323b 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java @@ -9,7 +9,6 @@ import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEnt import com.github.technus.tectech.util.CommonValues; import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; -import com.gtnewhorizon.structurelib.structure.StructureDefinition; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -42,7 +41,7 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa }; private static final IStructureDefinition<GT_MetaTileEntity_EM_infuser> STRUCTURE_DEFINITION = - StructureDefinition.<GT_MetaTileEntity_EM_infuser>builder() + IStructureDefinition.<GT_MetaTileEntity_EM_infuser>builder() .addShape("main", transpose(new String[][]{ {"CCC","CCC","CCC"}, {"BBB","BAB","BBB"}, @@ -200,4 +199,4 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa public String[] getStructureDescription(ItemStack stackSize) { return description; } -}
\ No newline at end of file +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java index fc465f063a..a3944c6e31 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java @@ -9,7 +9,6 @@ import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters; import com.github.technus.tectech.util.CommonValues; import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; -import com.gtnewhorizon.structurelib.structure.StructureDefinition; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.util.GT_Utility; @@ -37,7 +36,7 @@ public class GT_MetaTileEntity_EM_junction extends GT_MetaTileEntity_MultiblockB }; private static final IStructureDefinition<GT_MetaTileEntity_EM_junction> STRUCTURE_DEFINITION = - StructureDefinition.<GT_MetaTileEntity_EM_junction>builder() + IStructureDefinition.<GT_MetaTileEntity_EM_junction>builder() .addShape("main", new String[][]{ {"CCC", "C~C", "CCC"}, {"AAA", "AAA", "AAA"}, @@ -192,4 +191,4 @@ public class GT_MetaTileEntity_EM_junction extends GT_MetaTileEntity_MultiblockB public String[] getStructureDescription(ItemStack stackSize) { return description; } -}
\ No newline at end of file +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java index 6a840dcf0e..64bce35ca0 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java @@ -38,7 +38,7 @@ import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBloc import static com.github.technus.tectech.util.CommonValues.V; import static com.github.technus.tectech.util.Util.isInputEqual; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlockAnyMeta; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; import static net.minecraft.util.StatCollector.translateToLocal; @@ -49,23 +49,22 @@ import static net.minecraft.util.StatCollector.translateToLocal; public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { //region structure //use multi A energy inputs, use less power the longer it runs - private static final IStructureDefinition<GT_MetaTileEntity_EM_quantizer> STRUCTURE_DEFINITION = IStructureDefinition - .<GT_MetaTileEntity_EM_quantizer>builder() - .addShape("main", new String[][]{ - {"&&&", "&~&", "&&&",}, - {"010", "101", "010",}, - {"$$$", "$0$", "$$$",}, - {"202", "0!0", "202",}, - }) - .addElement('0', ofBlock(sBlockCasingsTT, 4)) - .addElement('1', ofBlock(sBlockCasingsTT, 0)) - .addElement('2', ofBlockAnyMeta(QuantumGlassBlock.INSTANCE)) - .addElement('&', ofHatchAdderOptional(GT_MetaTileEntity_EM_quantizer::addClassicToMachineList, textureOffset, 1, sBlockCasingsTT, 0)) - .addElement('!', ofHatchAdder(GT_MetaTileEntity_EM_quantizer::addElementalOutputToMachineList, textureOffset + 4, 2)) - .addElement('$', ofHatchAdderOptional(GT_MetaTileEntity_EM_quantizer::addElementalMufflerToMachineList, textureOffset + 4, 3,sBlockCasingsTT,4)) + private static final IStructureDefinition<GT_MetaTileEntity_EM_quantizer> STRUCTURE_DEFINITION = + IStructureDefinition.<GT_MetaTileEntity_EM_quantizer>builder() + .addShape("main", transpose(new String[][]{ + {"CCC","BAB","EEE","DBD"}, + {"C~C","ABA","EBE","BFB"}, + {"CCC","BAB","EEE","DBD"} + })) + .addElement('A', ofBlock(sBlockCasingsTT, 0)) + .addElement('B', ofBlock(sBlockCasingsTT, 4)) + .addElement('C', ofHatchAdderOptional(GT_MetaTileEntity_EM_quantizer::addClassicToMachineList, textureOffset, 1, sBlockCasingsTT, 0)) + .addElement('D', ofBlock(QuantumGlassBlock.INSTANCE, 0)) + .addElement('E', ofHatchAdderOptional(GT_MetaTileEntity_EM_quantizer::addElementalMufflerToMachineList, textureOffset + 4, 3, sBlockCasingsTT, 4)) + .addElement('F', ofHatchAdder(GT_MetaTileEntity_EM_quantizer::addElementalOutputToMachineList,textureOffset + 4, 2)) .build(); - private static final String[] description = new String[]{ + private static final String[] description = new String[]{ EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":", translateToLocal("gt.blockmachines.multimachine.em.mattertoem.hint.0"),//1 - Classic Hatches or High Power Casing translateToLocal("gt.blockmachines.multimachine.em.mattertoem.hint.1"),//2 - Elemental Output Hatch @@ -95,7 +94,7 @@ public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_Multiblock public boolean checkRecipe_EM(ItemStack itemStack) {//TODO implement instance quantization if (GregTech_API.sPostloadFinished) { ArrayList<ItemStack> storedInputs = getStoredInputs(); - ItemStack[] inI = storedInputs.toArray(nullItem); + ItemStack[] inI = storedInputs.toArray(nullItem); if (inI.length > 0) { for (ItemStack is : inI) { //ITEM STACK quantization @@ -134,7 +133,7 @@ public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_Multiblock } } ArrayList<FluidStack> storedFluids = getStoredFluids(); - FluidStack[] inF = storedFluids.toArray(nullFluid); + FluidStack[] inF = storedFluids.toArray(nullFluid); if (inF.length > 0) { for (FluidStack fs : inF) { EMFluidQuantizationInfo aFQI = TecTech.transformationInfo.getFluidQuantization().get(fs.getFluid().getID()); @@ -156,7 +155,7 @@ public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_Multiblock private void startRecipe(IEMStack into) { mMaxProgresstime = 20; mEfficiencyIncrease = 10000; - double mass = into.getMass(); + double mass = into.getMass(); double euMult = Math.abs(mass / refMass); eAmpereFlow = (int) Math.ceil(Math.sqrt(Math.sqrt(euMult))); if (mass > refUnstableMass || into.getDefinition().getRawTimeSpan(DEFAULT_ENERGY_LEVEL) < STABLE_RAW_LIFE_TIME) { @@ -204,7 +203,12 @@ public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_Multiblock } @Override + public IStructureDefinition<GT_MetaTileEntity_EM_quantizer> getStructure_EM() { + return STRUCTURE_DEFINITION; + } + + @Override public String[] getStructureDescription(ItemStack stackSize) { return description; } -}
\ No newline at end of file +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java index 4b0294bf4d..33660d838f 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java @@ -8,7 +8,6 @@ import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_Rend import com.github.technus.tectech.util.CommonValues; import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; -import com.gtnewhorizon.structurelib.structure.StructureDefinition; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.ItemList; import gregtech.api.enums.Textures; @@ -75,7 +74,7 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB //region structure private static final IStructureDefinition<GT_MetaTileEntity_EM_research> STRUCTURE_DEFINITION = - StructureDefinition.<GT_MetaTileEntity_EM_research>builder() + IStructureDefinition.<GT_MetaTileEntity_EM_research>builder() .addShape("main", transpose(new String[][]{ {" ", " A ", " A ", "AAA", "AAA", "AAA", "AAA"}, {"AAA", "ACA", "ACA", "ACA", "BCB", "BCB", "BBB"}, diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java index f47926b449..68e7519950 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java @@ -5,6 +5,7 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.EMException; import com.github.technus.tectech.mechanics.elementalMatter.core.maps.EMInstanceStackMap; import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.EMDefinitionStack; import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.EMInstanceStack; +import com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.EMPrimitiveDefinition; import com.github.technus.tectech.recipe.TT_recipe; import com.github.technus.tectech.thing.CustomItemList; import com.github.technus.tectech.thing.block.QuantumGlassBlock; @@ -22,6 +23,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; @@ -34,7 +36,6 @@ import net.minecraftforge.common.util.ForgeDirection; import org.apache.commons.lang3.reflect.FieldUtils; import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; -import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.EMPrimitiveDefinition.nbtE__; import static com.github.technus.tectech.recipe.TT_recipe.E_RECIPE_ID; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; @@ -43,7 +44,8 @@ import static com.github.technus.tectech.thing.metaTileEntity.multi.em_machine.G import static com.github.technus.tectech.util.CommonValues.V; import static com.github.technus.tectech.util.CommonValues.VN; import static com.github.technus.tectech.util.Util.areBitsSet; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; import static net.minecraft.util.StatCollector.translateToLocal; @@ -55,42 +57,21 @@ import static net.minecraft.util.StatCollector.translateToLocalFormatted; public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { //region variables public static final int SCAN_DO_NOTHING = 0, - SCAN_GET_NOMENCLATURE = 1, SCAN_GET_DEPTH_LEVEL = 2, SCAN_GET_AMOUNT = 4, SCAN_GET_CHARGE = 8, - SCAN_GET_MASS = 16, SCAN_GET_ENERGY_LEVEL = 32, SCAN_GET_TIMESPAN_INFO = 64, SCAN_GET_ENERGY_STATES = 128, - SCAN_GET_COLOR = 256, SCAN_GET_AGE = 512, SCAN_GET_TIMESPAN_MULT = 1024, SCAN_GET_CLASS_TYPE = 2048; + SCAN_GET_NOMENCLATURE = 1, SCAN_GET_DEPTH_LEVEL = 2, SCAN_GET_AMOUNT = 4, SCAN_GET_CHARGE = 8, + SCAN_GET_MASS = 16, SCAN_GET_ENERGY_LEVEL = 32, SCAN_GET_TIMESPAN_INFO = 64, SCAN_GET_ENERGY_STATES = 128, + SCAN_GET_COLOR = 256, SCAN_GET_AGE = 512, SCAN_GET_TIMESPAN_MULT = 1024, SCAN_GET_CLASS_TYPE = 2048; private TT_recipe.TT_EMRecipe.TT_EMRecipe eRecipe; private EMDefinitionStack objectResearched; private EMInstanceStackMap objectsScanned; - private String machineType; - private long computationRemaining, computationRequired; + private String machineType; + private long computationRemaining, computationRequired; private int[] scanComplexity; private String clientLocale = "en_US"; //endregion //region structure - private static final IStructureDefinition<GT_MetaTileEntity_EM_scanner> STRUCTURE_DEFINITION = IStructureDefinition - .<GT_MetaTileEntity_EM_scanner>builder() - .addShape("main", new String[][]{ - {" 222 ", "2&&&2", "2&~&2", "2&&&2", " 222 ",}, - {"00000", "00000", "00000", "00000", "00000",}, - {"00100", "01110", "11111", "01110", "00100",}, - {"01110", "1---1", "1---1", "1---1", "01110",}, - {"01110", "1---1", "1-A-1", "1---1", "01110",}, - {"01110", "1---1", "1---1", "1---1", "01110",}, - {"00100", "01110", "11$11", "01110", "00100",}, - {"#####", "#000#", "#0!0#", "#000#", "#####",},}) - .addElement('0', ofBlock(sBlockCasingsTT, 4)) - .addElement('1', ofBlockAnyMeta(QuantumGlassBlock.INSTANCE)) - .addElement('2', ofBlock(sBlockCasingsTT, 0)) - .addElement('&', ofHatchAdderOptional(GT_MetaTileEntity_EM_scanner::addClassicToMachineList, textureOffset, 1, sBlockCasingsTT, 0)) - .addElement('!', ofHatchAdder(GT_MetaTileEntity_EM_scanner::addElementalInputToMachineList, textureOffset + 4, 2)) - .addElement('$', ofHatchAdder(GT_MetaTileEntity_EM_scanner::addElementalOutputToMachineList, textureOffset + 4, 3)) - .addElement('#', ofHatchAdderOptional(GT_MetaTileEntity_EM_scanner::addElementalMufflerToMachineList, textureOffset + 4, 4, sBlockCasingsTT, 4)) - .addElement('A', ofChain(ofBlockAnyMeta(QuantumStuffBlock.INSTANCE),isAir())) - .build(); - private static final String[] description = new String[]{ EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":", translateToLocal("gt.blockmachines.multimachine.em.scanner.hint.0"),//1 - Classic Hatches or High Power Casing @@ -98,10 +79,28 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa translateToLocal("gt.blockmachines.multimachine.em.scanner.hint.2"),//3 - Elemental Output Hatches or Molecular Casing translateToLocal("gt.blockmachines.multimachine.em.scanner.hint.3"),//4 - Elemental Overflow Hatches or Molecular Casing }; + + private static final IStructureDefinition<GT_MetaTileEntity_EM_scanner> STRUCTURE_DEFINITION = + IStructureDefinition.<GT_MetaTileEntity_EM_scanner>builder() + .addShape("main", transpose(new String[][]{ + {"CCCCC","BBBBB","BBDBB","BDDDB","BDDDB","BDDDB","BBDBB","EEEEE"}, + {"CAAAC","BBBBB","BDDDB","D---D","D---D","D---D","BDDDB","EBBBE"}, + {"CA~AC","BBBBB","DDDDD","D---D","D---D","D---D","DDGDD","EBFBE"}, + {"CAAAC","BBBBB","BDDDB","D---D","D---D","D---D","BDDDB","EBBBE"}, + {"CCCCC","BBBBB","BBDBB","BDDDB","BDDDB","BDDDB","BBDBB","EEEEE"} + })) + .addElement('A', ofBlock(sBlockCasingsTT, 0)) + .addElement('B', ofBlock(sBlockCasingsTT, 4)) + .addElement('C', ofHatchAdderOptional(GT_MetaTileEntity_EM_scanner::addClassicToMachineList, textureOffset, 1, sBlockCasingsTT, 0)) + .addElement('D', ofBlock(QuantumGlassBlock.INSTANCE, 0)) + .addElement('E', ofHatchAdderOptional(GT_MetaTileEntity_EM_scanner::addElementalMufflerToMachineList, textureOffset + 4, 4, sBlockCasingsTT, 4)) + .addElement('F', ofHatchAdder(GT_MetaTileEntity_EM_scanner::addElementalInputToMachineList, textureOffset + 4, 2)) + .addElement('G', ofHatchAdder(GT_MetaTileEntity_EM_scanner::addElementalOutputToMachineList, textureOffset + 4, 3)) + .build(); //endregion //region parameters - private static final INameFunction<GT_MetaTileEntity_EM_scanner> CONFIG_NAME = + private static final INameFunction<GT_MetaTileEntity_EM_scanner> CONFIG_NAME = (base, p) -> "Config at Depth: " + (p.hatchId() * 2 + p.parameterId()); private static final IStatusFunction<GT_MetaTileEntity_EM_scanner> CONFIG_STATUS = (base, p) -> { @@ -115,7 +114,7 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa if (v < 0) return LedStatus.STATUS_TOO_LOW; return LedStatus.STATUS_OK; }; - protected Parameters.Group.ParameterIn[] scanConfiguration; + protected Parameters.Group.ParameterIn[] scanConfiguration; //endregion public GT_MetaTileEntity_EM_scanner(int aID, String aName, String aNameRegional) { @@ -131,9 +130,9 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa private void quantumStuff(boolean shouldExist) { IGregTechTileEntity base = getBaseMetaTileEntity(); if (base != null && base.getWorld() != null) { - int xDir = ForgeDirection.getOrientation(base.getBackFacing()).offsetX * 4 + base.getXCoord(); - int yDir = ForgeDirection.getOrientation(base.getBackFacing()).offsetY * 4 + base.getYCoord(); - int zDir = ForgeDirection.getOrientation(base.getBackFacing()).offsetZ * 4 + base.getZCoord(); + int xDir = ForgeDirection.getOrientation(base.getBackFacing()).offsetX * 4 + base.getXCoord(); + int yDir = ForgeDirection.getOrientation(base.getBackFacing()).offsetY * 4 + base.getYCoord(); + int zDir = ForgeDirection.getOrientation(base.getBackFacing()).offsetZ * 4 + base.getZCoord(); Block block = base.getWorld().getBlock(xDir, yDir, zDir); if (shouldExist) { if (block != null && block.getMaterial() == Material.air) { @@ -333,7 +332,7 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa @Override public String[] getInfoData() { long storedEnergy = 0; - long maxEnergy = 0; + long maxEnergy = 0; for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) { if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU(); @@ -349,21 +348,31 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa return new String[]{ translateToLocalFormatted("tt.keyphrase.Energy_Hatches", clientLocale) + ":", - EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET + " EU / " + - EnumChatFormatting.YELLOW + maxEnergy + EnumChatFormatting.RESET + " EU", + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(storedEnergy) + EnumChatFormatting.RESET + " EU / " + + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(maxEnergy) + EnumChatFormatting.RESET + " EU", (mEUt <= 0 ? translateToLocalFormatted("tt.keyphrase.Probably_uses", clientLocale) + ": " : translateToLocalFormatted("tt.keyphrase.Probably_makes", clientLocale) + ": ") + - EnumChatFormatting.RED + Math.abs(mEUt) + EnumChatFormatting.RESET + " EU/t " + translateToLocalFormatted("tt.keyword.at", clientLocale) + " " + - EnumChatFormatting.RED + eAmpereFlow + EnumChatFormatting.RESET + " A", - translateToLocalFormatted("tt.keyphrase.Tier_Rating", clientLocale) + ": " + EnumChatFormatting.YELLOW + VN[getMaxEnergyInputTier_EM()] + EnumChatFormatting.RESET + " / " + EnumChatFormatting.GREEN + VN[getMinEnergyInputTier_EM()] + EnumChatFormatting.RESET + - " " + translateToLocalFormatted("tt.keyphrase.Amp_Rating", clientLocale) + ": " + EnumChatFormatting.GREEN + eMaxAmpereFlow + EnumChatFormatting.RESET + " A", - translateToLocalFormatted("tt.keyword.Problems", clientLocale) + ": " + EnumChatFormatting.RED + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET + - " " + translateToLocalFormatted("tt.keyword.Efficiency", clientLocale) + ": " + EnumChatFormatting.YELLOW + mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", - translateToLocalFormatted("tt.keyword.PowerPass", clientLocale) + ": " + EnumChatFormatting.BLUE + ePowerPass + EnumChatFormatting.RESET + - " " + translateToLocalFormatted("tt.keyword.SafeVoid", clientLocale) + ": " + EnumChatFormatting.BLUE + eSafeVoid, - translateToLocalFormatted("tt.keyphrase.Computation_Available", clientLocale) + ": " + EnumChatFormatting.GREEN + eAvailableData + EnumChatFormatting.RESET + " / " + EnumChatFormatting.YELLOW + eRequiredData + EnumChatFormatting.RESET, + EnumChatFormatting.RED + GT_Utility.formatNumbers(Math.abs(mEUt)) + EnumChatFormatting.RESET + " EU/t " + + translateToLocalFormatted("tt.keyword.at", clientLocale) + " " + + EnumChatFormatting.RED + GT_Utility.formatNumbers(eAmpereFlow) + EnumChatFormatting.RESET + " A", + translateToLocalFormatted("tt.keyphrase.Tier_Rating", clientLocale) + ": " + + EnumChatFormatting.YELLOW + VN[getMaxEnergyInputTier_EM()] + EnumChatFormatting.RESET + " / " + + EnumChatFormatting.GREEN + VN[getMinEnergyInputTier_EM()] + EnumChatFormatting.RESET + " " + + translateToLocalFormatted("tt.keyphrase.Amp_Rating", clientLocale) + ": " + + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(eMaxAmpereFlow) + EnumChatFormatting.RESET + " A", + translateToLocalFormatted("tt.keyword.Problems", clientLocale) + ": " + + EnumChatFormatting.RED + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET + " " + + translateToLocalFormatted("tt.keyword.Efficiency", clientLocale) + ": " + + EnumChatFormatting.YELLOW + mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", + translateToLocalFormatted("tt.keyword.PowerPass", clientLocale) + ": " + + EnumChatFormatting.BLUE + ePowerPass + EnumChatFormatting.RESET + " " + + translateToLocalFormatted("tt.keyword.SafeVoid", clientLocale) + ": " + + EnumChatFormatting.BLUE + eSafeVoid, + translateToLocalFormatted("tt.keyphrase.Computation_Available", clientLocale) + ": " + + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(eAvailableData) + EnumChatFormatting.RESET + " / " + + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(eRequiredData) + EnumChatFormatting.RESET, translateToLocalFormatted("tt.keyphrase.Computation_Remaining", clientLocale) + ":", - EnumChatFormatting.GREEN + Long.toString(computationRemaining / 20L) + EnumChatFormatting.RESET + " / " + - EnumChatFormatting.YELLOW + computationRequired / 20L + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(computationRemaining / 20L) + EnumChatFormatting.RESET + " / " + + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(computationRequired / 20L) }; } @@ -411,8 +420,8 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa computationRemaining = aNBT.getLong("eComputationRemaining"); computationRequired = aNBT.getLong("eComputationRequired"); if (aNBT.hasKey("eObject")) { - objectResearched = EMDefinitionStack.fromNBT(TecTech.definitionsRegistry, aNBT.getCompoundTag("eObject")); - if (objectResearched.getDefinition() == nbtE__) { + objectResearched = EMDefinitionStack.fromNBT(TecTech.definitionsRegistry,aNBT.getCompoundTag("eObject")); + if (objectResearched.getDefinition() == EMPrimitiveDefinition.nbtE__) { objectResearched = null; } } else { @@ -425,7 +434,7 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa } try { if (aNBT.hasKey("eScanObjects")) { - objectsScanned = EMInstanceStackMap.fromNBT(TecTech.definitionsRegistry, aNBT.getCompoundTag("eScanObjects")); + objectsScanned = EMInstanceStackMap.fromNBT(TecTech.definitionsRegistry,aNBT.getCompoundTag("eScanObjects")); } } catch (EMException e) { objectsScanned = new EMInstanceStackMap(); @@ -522,7 +531,12 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa } @Override + public IStructureDefinition<GT_MetaTileEntity_EM_scanner> getStructure_EM() { + return STRUCTURE_DEFINITION; + } + + @Override public String[] getStructureDescription(ItemStack stackSize) { return description; } -}
\ No newline at end of file +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java index 1ecd92af74..6bedce3ede 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java @@ -5,7 +5,6 @@ import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEnt import com.github.technus.tectech.util.CommonValues; import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; -import com.gtnewhorizon.structurelib.structure.StructureDefinition; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.item.ItemStack; @@ -30,7 +29,7 @@ public class GT_MetaTileEntity_EM_stabilizer extends GT_MetaTileEntity_Multibloc }; private static final IStructureDefinition<GT_MetaTileEntity_EM_stabilizer> STRUCTURE_DEFINITION = - StructureDefinition.<GT_MetaTileEntity_EM_stabilizer>builder() + IStructureDefinition.<GT_MetaTileEntity_EM_stabilizer>builder() .addShape("main", transpose(new String[][]{ {" AFA ","BCBCB","FBGBF","BCBCB"," AFA "}, {"AEEEA","CBBBC","BBDBB","CBBBC","AEEEA"}, @@ -89,4 +88,4 @@ public class GT_MetaTileEntity_EM_stabilizer extends GT_MetaTileEntity_Multibloc public String[] getStructureDescription(ItemStack stackSize) { return description; } -}
\ No newline at end of file +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java index f4e02085f4..bd38a46b7f 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java @@ -12,7 +12,6 @@ import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_Rend import com.github.technus.tectech.util.CommonValues; import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; -import com.gtnewhorizon.structurelib.structure.StructureDefinition; import com.gtnewhorizon.structurelib.util.Vec3Impl; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -45,7 +44,7 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas }; private static final IStructureDefinition<GT_MetaTileEntity_EM_switch> STRUCTURE_DEFINITION = - StructureDefinition.<GT_MetaTileEntity_EM_switch>builder() + IStructureDefinition.<GT_MetaTileEntity_EM_switch>builder() .addShape("main", transpose(new String[][]{ {"BBB","BBB","BBB"}, {"B~B","BAB","BBB"}, @@ -238,4 +237,4 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas public String[] getStructureDescription(ItemStack stackSize) { return description; } -}
\ No newline at end of file +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java index 450a8ba610..208d33c610 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java @@ -8,7 +8,6 @@ import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_Rend import com.github.technus.tectech.util.CommonValues; import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; -import com.gtnewhorizon.structurelib.structure.StructureDefinition; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; @@ -38,7 +37,7 @@ public class GT_MetaTileEntity_EM_transformer extends GT_MetaTileEntity_Multiblo translateToLocal("gt.blockmachines.multimachine.em.transformer.hint"),//1 - Energy IO Hatches or High Power Casing }; private static final IStructureDefinition<GT_MetaTileEntity_EM_transformer> STRUCTURE_DEFINITION = - StructureDefinition.<GT_MetaTileEntity_EM_transformer>builder() + IStructureDefinition.<GT_MetaTileEntity_EM_transformer>builder() .addShape("main",new String[][]{ {"111", "1~1", "111",}, {"111", "101", "111",}, @@ -167,4 +166,4 @@ public class GT_MetaTileEntity_EM_transformer extends GT_MetaTileEntity_Multiblo public String[] getStructureDescription(ItemStack stackSize) { return description; } -}
\ No newline at end of file +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java index 98be43139b..502a300bb3 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java @@ -6,7 +6,6 @@ import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_Rend import com.github.technus.tectech.util.CommonValues; import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; -import com.gtnewhorizon.structurelib.structure.StructureDefinition; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; @@ -42,7 +41,7 @@ public class GT_MetaTileEntity_EM_wormhole extends GT_MetaTileEntity_MultiblockB }; private static final IStructureDefinition<GT_MetaTileEntity_EM_wormhole> STRUCTURE_DEFINITION = - StructureDefinition.<GT_MetaTileEntity_EM_wormhole>builder() + IStructureDefinition.<GT_MetaTileEntity_EM_wormhole>builder() .addShape("main", transpose(new String[][]{ {" "," "," "," "," "," D "," DDDDD "," DGGGD "," DGGGD "," DGGGD "," DDDDD "}, {" "," "," "," D "," D "," D "," DDAAADD "," EABBBAE "," EABBBAE "," EABBBAE "," DDAAADD "}, @@ -121,4 +120,4 @@ public class GT_MetaTileEntity_EM_wormhole extends GT_MetaTileEntity_MultiblockB public String[] getStructureDescription(ItemStack stackSize) { return description; } -}
\ No newline at end of file +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java index 7dd4d0067c..3df25033ca 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java @@ -6,7 +6,6 @@ import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_Rend import com.github.technus.tectech.util.CommonValues; import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; -import com.gtnewhorizon.structurelib.structure.StructureDefinition; import com.gtnewhorizon.structurelib.util.Vec3Impl; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; @@ -52,7 +51,7 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock }; private static final IStructureDefinition<GT_MetaTileEntity_TM_microwave> STRUCTURE_DEFINITION = - StructureDefinition.<GT_MetaTileEntity_TM_microwave>builder() + IStructureDefinition.<GT_MetaTileEntity_TM_microwave>builder() .addShape("main", transpose(new String[][]{ {"AAAAA","A---A","A---A","A---A","AAAAA"}, {"AAAAA","A---A","A---A","A---A","AAAAA"}, @@ -259,4 +258,4 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock public String[] getStructureDescription(ItemStack stackSize) { return description; } -}
\ No newline at end of file +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_proccessingStack.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_proccessingStack.java index 427f448e2a..ba0af2d349 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_proccessingStack.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_proccessingStack.java @@ -2,6 +2,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable; +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.item.ItemStack; @@ -13,6 +14,11 @@ public class GT_MetaTileEntity_TM_proccessingStack extends GT_MetaTileEntity_Mul } @Override + public IStructureDefinition<? extends GT_MetaTileEntity_MultiblockBase_EM> getStructure_EM() { + return null; + } + + @Override public void construct(ItemStack stackSize, boolean hintsOnly) { } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java index 61e912e8d1..c4d1de75fe 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java @@ -20,7 +20,6 @@ import com.google.common.collect.Multimap; import com.google.common.collect.MultimapBuilder; import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; -import com.gtnewhorizon.structurelib.structure.StructureDefinition; import com.gtnewhorizon.structurelib.util.Vec3Impl; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -46,7 +45,8 @@ import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBloc import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.*; import static com.github.technus.tectech.util.CommonValues.V; import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static gregtech.api.util.GT_StructureUtility.*; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; import static java.lang.Math.min; import static net.minecraft.util.StatCollector.translateToLocal; @@ -105,7 +105,7 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock }; private static final IStructureDefinition<GT_MetaTileEntity_TM_teslaCoil> STRUCTURE_DEFINITION = - StructureDefinition.<GT_MetaTileEntity_TM_teslaCoil>builder() + IStructureDefinition.<GT_MetaTileEntity_TM_teslaCoil>builder() .addShape("main", transpose(new String[][]{ {" "," "," BBB "," BBB "," BBB "," "," "}, {" "," BBB "," BBBBB "," BBBBB "," BBBBB "," BBB "," "}, @@ -130,7 +130,7 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock .addElement('C', ofBlock(sBlockCasingsBA0, 8)) .addElement('D', defer(t -> ofBlock(sBlockCasingsBA0, t.getCoilWindingMeta()))) .addElement('E', ofHatchAdderOptional(GT_MetaTileEntity_TM_teslaCoil::addCapacitorToMachineList, textureOffset + 16 + 6, 1, sBlockCasingsBA0, 6)) - .addElement('F', ofFrame(Materials.get("Titanium"))) + .addElement('F', ofHatchAdder(GT_MetaTileEntity_TM_teslaCoil::addFrameToMachineList, 0, 2)) .build(); public int getCoilWindingMeta() { diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java index be1f0e699b..3a019de78c 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java @@ -12,11 +12,13 @@ import com.github.technus.tectech.util.Util; import com.gtnewhorizon.structurelib.StructureLibAPI; import com.gtnewhorizon.structurelib.alignment.IAlignment; import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; +import com.gtnewhorizon.structurelib.alignment.IAlignmentProvider; import com.gtnewhorizon.structurelib.alignment.enumerable.ExtendedFacing; import com.gtnewhorizon.structurelib.alignment.enumerable.Flip; import com.gtnewhorizon.structurelib.alignment.enumerable.Rotation; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.util.Vec3Impl; +import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; @@ -140,7 +142,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt //front rotation val private IAlignmentLimits alignmentLimits = IAlignmentLimits.UNLIMITED; - private ExtendedFacing extendedFacing = ExtendedFacing.DEFAULT; + private ExtendedFacing extendedFacing = ExtendedFacing.DEFAULT; //endregion protected GT_MetaTileEntity_MultiblockBase_EM(int aID, String aName, String aNameRegional) { @@ -159,6 +161,11 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt //region SUPER STRUCT @Override + public IAlignmentLimits getAlignmentLimits() { + return alignmentLimits; + } + + @Override public ExtendedFacing getExtendedFacing() { return extendedFacing; } @@ -170,7 +177,12 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt IGregTechTileEntity base = getBaseMetaTileEntity(); mMachine = false; if (getBaseMetaTileEntity().isServerSide()) { - StructureLibAPI.sendAlignment(this,getBaseMetaTileEntity().getWorld()); + //NetworkDispatcher.INSTANCE.sendToAllAround(new AlignmentMessage.AlignmentData(this), + // base.getWorld().provider.dimensionId, + // base.getXCoord(), base.getYCoord(), base.getZCoord(), 512); + StructureLibAPI.sendAlignment((IAlignmentProvider) base, + new NetworkRegistry.TargetPoint(base.getWorld().provider.dimensionId, + base.getXCoord(), base.getYCoord(), base.getZCoord(), 512)); }else{ base.issueTextureUpdate(); } @@ -178,11 +190,6 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } @Override - public IAlignmentLimits getAlignmentLimits() { - return alignmentLimits; - } - - @Override public boolean isFacingValid(byte aFacing) { return canSetToDirectionAny(ForgeDirection.getOrientation(aFacing)); } @@ -196,9 +203,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt * Gets structure * @return STATIC INSTANCE OF STRUCTURE */ - public IStructureDefinition<? extends GT_MetaTileEntity_MultiblockBase_EM> getStructure_EM(){ - throw new NoSuchMethodError("Implement it as STATIC INSTANCE"); - } + public abstract IStructureDefinition<? extends GT_MetaTileEntity_MultiblockBase_EM> getStructure_EM(); @SuppressWarnings("unchecked") private IStructureDefinition<GT_MetaTileEntity_MultiblockBase_EM> getStructure_EM_Internal(){ @@ -218,7 +223,6 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt getExtendedFacing(), baseMetaTileEntity.getXCoord(), baseMetaTileEntity.getYCoord(), baseMetaTileEntity.getZCoord(), horizontalOffset, verticalOffset, depthOffset, hintsOnly); } - //endregion //region METHODS TO OVERRIDE - general functionality, recipe check, output @@ -360,21 +364,23 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt return new String[]{ "Progress:", - EnumChatFormatting.GREEN + Integer.toString(mProgresstime / 20) + EnumChatFormatting.RESET + " s / " + - EnumChatFormatting.YELLOW + mMaxProgresstime / 20 + EnumChatFormatting.RESET + " s", + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(mProgresstime / 20) + EnumChatFormatting.RESET + " s / " + + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(mMaxProgresstime / 20) + EnumChatFormatting.RESET + " s", "Energy Hatches:", - EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET + " EU / " + - EnumChatFormatting.YELLOW + maxEnergy + EnumChatFormatting.RESET + " EU", + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(storedEnergy) + EnumChatFormatting.RESET + " EU / " + + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(maxEnergy) + EnumChatFormatting.RESET + " EU", (mEUt * eAmpereFlow <= 0 ? "Probably uses: " : "Probably makes: ") + - EnumChatFormatting.RED + Math.abs(mEUt) + EnumChatFormatting.RESET + " EU/t at " + - EnumChatFormatting.RED + eAmpereFlow + EnumChatFormatting.RESET + " A", - "Tier Rating: " + EnumChatFormatting.YELLOW + VN[getMaxEnergyInputTier_EM()] + EnumChatFormatting.RESET + " / " + EnumChatFormatting.GREEN + VN[getMinEnergyInputTier_EM()] + EnumChatFormatting.RESET + - " Amp Rating: " + EnumChatFormatting.GREEN + eMaxAmpereFlow + EnumChatFormatting.RESET + " A", + EnumChatFormatting.RED + GT_Utility.formatNumbers(Math.abs(mEUt)) + EnumChatFormatting.RESET + " EU/t at " + + EnumChatFormatting.RED + GT_Utility.formatNumbers(eAmpereFlow) + EnumChatFormatting.RESET + " A", + "Tier Rating: " + EnumChatFormatting.YELLOW + VN[getMaxEnergyInputTier_EM()] + EnumChatFormatting.RESET + " / " + + EnumChatFormatting.GREEN + VN[getMinEnergyInputTier_EM()] + EnumChatFormatting.RESET + + " Amp Rating: " + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(eMaxAmpereFlow) + EnumChatFormatting.RESET + " A", "Problems: " + EnumChatFormatting.RED + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET + " Efficiency: " + EnumChatFormatting.YELLOW + mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", "PowerPass: " + EnumChatFormatting.BLUE + ePowerPass + EnumChatFormatting.RESET + " SafeVoid: " + EnumChatFormatting.BLUE + eSafeVoid, - "Computation: " + EnumChatFormatting.GREEN + eAvailableData + EnumChatFormatting.RESET + " / " + EnumChatFormatting.YELLOW + eRequiredData + EnumChatFormatting.RESET + "Computation: " + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(eAvailableData) + EnumChatFormatting.RESET + " / " + + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(eRequiredData) + EnumChatFormatting.RESET }; } @@ -622,7 +628,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt protected long getAvailableData_EM() { long result = 0; IGregTechTileEntity baseMetaTileEntity = getBaseMetaTileEntity(); - Vec3Impl pos = new Vec3Impl(baseMetaTileEntity.getXCoord(),baseMetaTileEntity.getYCoord(),baseMetaTileEntity.getZCoord()); + Vec3Impl pos = new Vec3Impl(baseMetaTileEntity.getXCoord(),baseMetaTileEntity.getYCoord(),baseMetaTileEntity.getZCoord()); for (GT_MetaTileEntity_Hatch_InputData in : eInputData) { if (in.q != null) { Long value = in.q.contentIfNotInTrace(pos); @@ -1069,7 +1075,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt public final void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { isFacingValid(aBaseMetaTileEntity.getFrontFacing()); if (getBaseMetaTileEntity().isClientSide()) { - StructureLibAPI.queryAlignment(this); + StructureLibAPI.queryAlignment((IAlignmentProvider) aBaseMetaTileEntity); } onFirstTick_EM(aBaseMetaTileEntity); } @@ -1649,7 +1655,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt addEnergyOutput_EM((long) mEUt * (long) mEfficiency / getMaxEfficiency(aStack), eAmpereFlow); } else if (euFlow < 0) { if (!drainEnergyInput_EM(mEUt, (long) mEUt * getMaxEfficiency(aStack) / Math.max(1000L, mEfficiency), eAmpereFlow)) { - stopMachine(); + criticalStopMachine(); return false; } } @@ -1662,7 +1668,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt addEnergyOutput_EM((long) mEUt * (long) mEfficiency / getMaxEfficiency(aStack), eAmpereFlow); } else if (euFlow < 0) { if (!drainEnergyInput((long) mEUt * getMaxEfficiency(aStack) / Math.max(1000L, mEfficiency), eAmpereFlow)) { - stopMachine(); + criticalStopMachine(); return false; } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_collider/GT_MetaTileEntity_EM_collider.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_collider/GT_MetaTileEntity_EM_collider.java index f7f37729d3..b7db310d12 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_collider/GT_MetaTileEntity_EM_collider.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_collider/GT_MetaTileEntity_EM_collider.java @@ -59,7 +59,7 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB protected static final byte FUSE_MODE = 0, COLLIDE_MODE = 1; private static double MASS_TO_EU_INSTANT; - private static int STARTUP_COST, KEEPUP_COST; + private static int STARTUP_COST, KEEPUP_COST; protected byte eTier = 0; protected EMInstanceStack stack; @@ -69,7 +69,7 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB //endregion //region collision handlers - public static final HashMap<Long, IColliderHandler> FUSE_HANDLERS = new HashMap<>(); + public static final HashMap<Long, IColliderHandler> FUSE_HANDLERS = new HashMap<>(); public static final HashMap<String, IPrimitiveColliderHandler> PRIMITIVE_FUSE_HANDLERS = new HashMap<>(); static { @@ -263,7 +263,7 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB //endregion //region parameters - protected Parameters.Group.ParameterIn mode; + protected Parameters.Group.ParameterIn mode; private static final IStatusFunction<GT_MetaTileEntity_EM_collider> MODE_STATUS = (base_EM, p) -> { if (base_EM.isMaster()) { double mode = p.get(); @@ -278,7 +278,7 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB } return STATUS_OK; }; - private static final INameFunction<GT_MetaTileEntity_EM_collider> MODE_NAME = (base_EM, p) -> { + private static final INameFunction<GT_MetaTileEntity_EM_collider> MODE_NAME = (base_EM, p) -> { if (base_EM.isMaster()) { double mode = p.get(); if (mode == FUSE_MODE) { @@ -294,50 +294,7 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB //region structure //use multi A energy inputs, use less power the longer it runs - private static final IStructureDefinition<GT_MetaTileEntity_EM_collider> STRUCTURE_DEFINITION = IStructureDefinition - .<GT_MetaTileEntity_EM_collider>builder() - .addShape("main", new String[][]{ - {" 0 0 0 ", " 00000 ", " 0 0 0 ",}, - {" 0000000 ", " 001111100 ", " 0000000 ",}, - {" 22223332222 ", " 41155555114 ", " 22223332222 ",}, - {" 2000000000002 ", " 4155111115514 ", " 2000000000002 ",}, - {" 20000 00002 ", " 41511 11514 ", " 20000 00002 ",}, - {" 2000 0002 ", " 4151 1514 ", " 2000 0002 ",}, - {" 2000 0002 ", " 4151 1514 ", " 2000 0002 ",}, - {" 200 002 ", " 0151 1510 ", " 200 002 ",}, - {" 0200 0020 ", " 0151 1510 ", " 0200 0020 ",}, - {"0020 0200", "0151 1510", "0020 0200",}, - {" 030 030 ", "0151 1510", " 030 030 ",}, - {"0030 0300", "0151 1510", "0030 0300",}, - {" 030 030 ", "0151 1510", " 030 030 ",}, - {"0020 0200", "0151 1510", "0020 0200",}, - {" 0200 0020 ", " 0151 1510 ", " 0200 0020 ",}, - {" 200 002 ", " 0151 1510 ", " 200 002 ",}, - {" 2000 0002 ", " 4151 1514 ", " 2000 0002 ",}, - {" 2000 0002 ", " 4151 1514 ", " 2000 0002 ",}, - {" 200002&&&200002 ", " 415112&~&211514 ", " 200002&&&200002 ",}, - {" 20!!22222!!02 ", " 4155111115514 ", " 20!!22222!!02 ",}, - {" 2222#$#2222 ", " 41155555114 ", " 2222#$#2222 ",}, - }) - .addElement('0', ofBlock(sBlockCasingsTT, 4)) - .addElement('1', ofBlock(sBlockCasingsTT, 7)) - .addElement('2', defer(t -> (int) t.eTier, (t, item) -> 2 - (item.stackSize & 1), - error(), ofBlock(sBlockCasingsTT, 4), ofBlock(sBlockCasingsTT, 5))) - .addElement('3', ofBlock(QuantumGlassBlock.INSTANCE, 0)) - .addElement('4', defer(t -> (int) t.eTier, (t, item) -> 2 - (item.stackSize & 1), - error(), ofBlock(sBlockCasingsTT, 4), ofBlock(sBlockCasingsTT, 6))) - .addElement('5', defer(t -> (int) t.eTier, (t, item) -> 2 - (item.stackSize & 1), - error(), ofBlock(sBlockCasingsTT, 8), ofBlock(sBlockCasingsTT, 9))) - .addElement('&', ofHatchAdderOptional(GT_MetaTileEntity_EM_collider::addClassicToMachineList, - textureOffset, 1, sBlockCasingsTT, 0)) - .addElement('!', ofHatchAdderOptional(GT_MetaTileEntity_EM_collider::addElementalInputToMachineList, - textureOffset + 4, 2, sBlockCasingsTT, 4)) - .addElement('$', ofHatchAdderOptional(GT_MetaTileEntity_EM_collider::addElementalOutputToMachineList, - textureOffset + 4, 3, sBlockCasingsTT, 4)) - .addElement('#', ofHatchAdderOptional(GT_MetaTileEntity_EM_collider::addElementalMufflerToMachineList, - textureOffset + 4, 4, sBlockCasingsTT, 4)) - .build(); - private static final String[] description = new String[]{ + private static final String[] description = new String[]{ EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":", translateToLocal("gt.blockmachines.multimachine.em.collider.hint.0"),//1 - Classic Hatches or High Power Casing translateToLocal("gt.blockmachines.multimachine.em.collider.hint.1"),//2 - Elemental Input Hatches or Molecular Casing @@ -346,8 +303,27 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB translateToLocal("gt.blockmachines.multimachine.em.collider.hint.4"),//General - Another Controller facing opposite direction }; + private static final IStructureDefinition<GT_MetaTileEntity_EM_collider> STRUCTURE_DEFINITION = + IStructureDefinition.<GT_MetaTileEntity_EM_collider>builder() + .addShape("main", transpose(new String[][]{ + {" A A A "," AAAAAAA "," BBBBIIIBBBB "," BAAAAAAAAAAAB "," BAAAA AAAAB "," BAAA AAAB "," BAAA AAAB "," BAA AAB "," ABAA AABA ","AABA ABAA"," AIA AIA ","AAIA AIAA"," AIA AIA ","AABA ABAA"," ABAA AABA "," BAA AAB "," BAAA AAAB "," BAAA AAAB "," BAAAABJJJBAAAAB "," BAHHBBBBBHHAB "," BBBBGFGBBBB "}, + {" AAAAA "," AADDDDDAA "," CDDEEEEEDDC "," CDEEDDDDDEEDC "," CDEDD DDEDC "," CDED DEDC "," CDED DEDC "," ADED DEDA "," ADED DEDA ","ADED DEDA","ADED DEDA","ADED DEDA","ADED DEDA","ADED DEDA"," ADED DEDA "," ADED DEDA "," CDED DEDC "," CDED DEDC "," CDEDDBJ~JBDDEDC "," CDEEDDDDDEEDC "," CDDEEEEEDDC "}, + {" A A A "," AAAAAAA "," BBBBIIIBBBB "," BAAAAAAAAAAAB "," BAAAA AAAAB "," BAAA AAAB "," BAAA AAAB "," BAA AAB "," ABAA AABA ","AABA ABAA"," AIA AIA ","AAIA AIAA"," AIA AIA ","AABA ABAA"," ABAA AABA "," BAA AAB "," BAAA AAAB "," BAAA AAAB "," BAAAABJJJBAAAAB "," BAHHBBBBBHHAB "," BBBBGFGBBBB "} + })) + .addElement('A', ofBlock(sBlockCasingsTT, 4)) + .addElement('B', defer(t -> (int) t.eTier, (t, item) -> 2 - (item.stackSize & 1), error(), ofBlock(sBlockCasingsTT, 4), ofBlock(sBlockCasingsTT, 5))) + .addElement('C', defer(t -> (int) t.eTier, (t, item) -> 2 - (item.stackSize & 1), error(), ofBlock(sBlockCasingsTT, 4), ofBlock(sBlockCasingsTT, 6))) + .addElement('D', ofBlock(sBlockCasingsTT, 7)) + .addElement('E', defer(t -> (int) t.eTier, (t, item) -> 2 - (item.stackSize & 1), error(), ofBlock(sBlockCasingsTT, 8), ofBlock(sBlockCasingsTT, 9))) + .addElement('F', ofHatchAdderOptional(GT_MetaTileEntity_EM_collider::addElementalOutputToMachineList, textureOffset + 4, 3, sBlockCasingsTT, 4)) + .addElement('G', ofHatchAdderOptional(GT_MetaTileEntity_EM_collider::addElementalMufflerToMachineList, textureOffset + 4, 4, sBlockCasingsTT, 4)) + .addElement('H', ofHatchAdderOptional(GT_MetaTileEntity_EM_collider::addElementalInputToMachineList, textureOffset + 4, 2, sBlockCasingsTT, 4)) + .addElement('I', ofBlock(QuantumGlassBlock.INSTANCE, 0)) + .addElement('J', ofHatchAdderOptional(GT_MetaTileEntity_EM_collider::addClassicToMachineList, textureOffset, 1, sBlockCasingsTT, 0)) + .build(); + @Override - public IStructureDefinition<? extends GT_MetaTileEntity_MultiblockBase_EM> getStructure_EM() { + public IStructureDefinition<GT_MetaTileEntity_EM_collider> getStructure_EM() { return STRUCTURE_DEFINITION; } @@ -362,7 +338,7 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB } public static void setValues(int heliumPlasmaValue) { - double MASS_TO_EU_PARTIAL = heliumPlasmaValue / (1.75893000478707E07 * EM_COUNT_PER_MATERIAL_AMOUNT);//mass diff + double MASS_TO_EU_PARTIAL = heliumPlasmaValue / (1.75893000478707E07* EM_COUNT_PER_MATERIAL_AMOUNT);//mass diff MASS_TO_EU_INSTANT = MASS_TO_EU_PARTIAL * 20; STARTUP_COST = -heliumPlasmaValue * 10000; KEEPUP_COST = -heliumPlasmaValue; @@ -374,7 +350,7 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB partner.stack.getDefinition().fusionMakesEnergy(partner.stack.getEnergy()); EMInstanceStack stack2 = partner.stack; - double preMass = add(stack2.getMass(), stack.getMass()); + double preMass = add(stack2.getMass(),stack.getMass()); //System.out.println("preMass = " + preMass); EMInstanceStackMap map = new EMInstanceStackMap(); @@ -438,10 +414,10 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB } protected GT_MetaTileEntity_EM_collider getPartner() { - IGregTechTileEntity iGregTechTileEntity = getBaseMetaTileEntity(); - int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX * 4; - int yDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetY * 4; - int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ * 4; + IGregTechTileEntity iGregTechTileEntity = getBaseMetaTileEntity(); + int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX * 4; + int yDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetY * 4; + int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ * 4; IGregTechTileEntity gregTechBaseTileEntity = iGregTechTileEntity.getIGregTechTileEntityOffset(xDir, yDir, zDir); if (gregTechBaseTileEntity != null) { IMetaTileEntity gregTechMetaTileEntity = gregTechBaseTileEntity.getMetaTileEntity(); @@ -652,7 +628,7 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB eTier = aNBT.getByte("eTier");//collider tier started = aNBT.getBoolean("eStarted"); if (aNBT.hasKey("eStack")) { - stack = EMInstanceStack.fromNBT(TecTech.definitionsRegistry, aNBT.getCompoundTag("eStack")); + stack = EMInstanceStack.fromNBT(TecTech.definitionsRegistry,aNBT.getCompoundTag("eStack")); } plasmaEnergy = aNBT.getLong("ePlasmaEnergy"); } @@ -689,11 +665,11 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB @Override public void construct(ItemStack stackSize, boolean hintsOnly) { IGregTechTileEntity iGregTechTileEntity = getBaseMetaTileEntity(); - int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX * 4; - int yDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetY * 4; - int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ * 4; + int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX * 4; + int yDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetY * 4; + int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ * 4; if (hintsOnly) { - TecTech.proxy.hint_particle(iGregTechTileEntity.getWorld(), + StructureLibAPI.hintParticle(iGregTechTileEntity.getWorld(), iGregTechTileEntity.getXCoord() + xDir, iGregTechTileEntity.getYCoord() + yDir, iGregTechTileEntity.getZCoord() + zDir, @@ -706,4 +682,4 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB public String[] getStructureDescription(ItemStack stackSize) { return description; } -}
\ No newline at end of file +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java index 2735f207e4..3b0e8ba91d 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java @@ -25,8 +25,7 @@ import java.util.function.Supplier; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.*; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.isAir; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; import static net.minecraft.util.StatCollector.translateToLocal; @@ -42,29 +41,28 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa //endregion //region structure - private static final IStructureDefinition<GT_MetaTileEntity_EM_machine> STRUCTURE_DEFINITION=IStructureDefinition - .<GT_MetaTileEntity_EM_machine>builder() - .addShape("main",new String[][]{ - {" 0 ", " &&& ", "0& &0", " &&& ", " 0" ,}, - {" 000 ", "00000", "00~00", "00000", " 000 ",}, - {" 121 ", "1---1", "2---2", "1---1", " 121 ",}, - {" 131 ", "1---1", "3-A-3", "1---1", " 131 ",}, - {" 121 ", "1---1", "2---2", "1---1", " 121 ",}, - {" 000 ", "00000", "00-00", "00000", " 000" ,}, - {" 0 ", " !!! ", "0!!!0", " !!! ", " 0 ",},}) - .addElement('0', ofBlock(sBlockCasingsTT,4)) - .addElement('1',ofBlockAnyMeta(QuantumGlassBlock.INSTANCE)) - .addElement('2',ofBlock(sBlockCasingsTT,5)) - .addElement('3',ofBlock(sBlockCasingsTT,6)) - .addElement('&', ofHatchAdderOptional(GT_MetaTileEntity_EM_machine::addClassicToMachineList,textureOffset,1,sBlockCasingsTT,0)) - .addElement('!', ofHatchAdderOptional(GT_MetaTileEntity_EM_machine::addElementalToMachineList,textureOffset+4,2,sBlockCasingsTT,4)) - .addElement('A', ofChain(ofBlockAnyMeta(QuantumStuffBlock.INSTANCE),isAir())) - .build(); - private static final String[] description = new String[]{ EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":", translateToLocal("gt.blockmachines.multimachine.em.processing.hint.0"),//1 - Classic Hatches or High Power Casing - translateToLocal("gt.blockmachines.multimachine.em.processing.hint.1"),};//2 - Elemental Hatches or Molecular Casing + translateToLocal("gt.blockmachines.multimachine.em.processing.hint.1"),//2 - Elemental Hatches or Molecular Casing + }; + + private static final IStructureDefinition<GT_MetaTileEntity_EM_machine> STRUCTURE_DEFINITION = + IStructureDefinition.<GT_MetaTileEntity_EM_machine>builder() + .addShape("main", new String[][]{ + {" A "," AAA "," EBE "," ECE "," EBE "," AAA "," A "}, + {" DDD ","AAAAA","E---E","E---E","E---E","AAAAA"," FFF "}, + {"AD-DA","AA~AA","B---B","C---C","B---B","AA-AA","AFFFA"}, + {" DDD ","AAAAA","E---E","E---E","E---E","AAAAA"," FFF "}, + {" A "," AAA "," EBE "," ECE "," EBE "," AAA "," A "} + }) + .addElement('A', ofBlock(sBlockCasingsTT, 4)) + .addElement('B', ofBlock(sBlockCasingsTT, 5)) + .addElement('C', ofBlock(sBlockCasingsTT, 6)) + .addElement('D', ofHatchAdderOptional(GT_MetaTileEntity_EM_machine::addClassicToMachineList, textureOffset, 1, sBlockCasingsTT, 0)) + .addElement('E', ofBlock(QuantumGlassBlock.INSTANCE, 0)) + .addElement('F', ofHatchAdderOptional(GT_MetaTileEntity_EM_machine::addElementalToMachineList, textureOffset + 4, 2, sBlockCasingsTT, 4)) + .build(); //endregion //region parameters @@ -362,7 +360,12 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa } @Override + public IStructureDefinition<GT_MetaTileEntity_EM_machine> getStructure_EM() { + return STRUCTURE_DEFINITION; + } + + @Override public String[] getStructureDescription(ItemStack stackSize) { return description; } -}
\ No newline at end of file +} diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index 21ecee23f8..f7fc68f278 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -1,10 +1,10 @@ [ { - "modid": "${modId}", - "name": "${modName}", + "modid": "tectech", + "name": "TecTech", "description": "TecTech - Tec Technology Interdimensional! Replace UUMatter with something overly complicated and annoying! (GT5u Addon)", - "version": "${modVersion}", - "mcversion": "${minecraftVersion}", + "version": "${version}", + "mcversion": "${mcversion}", "url": "", "updateUrl": "", "authorList": ["_Technus_"], |