aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/scripts/test-no-error-reports.sh27
-rw-r--r--.github/workflows/build-and-test.yml45
-rw-r--r--.github/workflows/release-tags.yml51
-rw-r--r--.gitignore61
-rw-r--r--.gitmodules3
m---------AVRcore0
-rw-r--r--CODEOWNERS3
-rw-r--r--build.gradle594
-rw-r--r--build.gradle.kts292
-rw-r--r--dependencies.gradle35
-rw-r--r--dependencies/OpenModularTurrets-1.7.10-2.2.10-237-deobf.jarbin988221 -> 0 bytes
-rw-r--r--gradle.properties70
-rw-r--r--gradle/wrapper/gradle-wrapper.jarbin55616 -> 54417 bytes
-rw-r--r--gradle/wrapper/gradle-wrapper.properties2
-rw-r--r--gradlew22
-rw-r--r--gradlew.bat18
-rw-r--r--jitpack.yml2
-rw-r--r--libs/CoFHCore-[1.7.10]3.1.4-329-dev.jarbin0 -> 1213993 bytes
-rw-r--r--libs/GT-PlusPlus-1.7.0-prerelease-8-final.jarbin0 -> 4458558 bytes
-rw-r--r--real.gradle.properties20
-rw-r--r--repositories.gradle30
-rw-r--r--src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java63
-rw-r--r--src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java60
-rw-r--r--src/main/java/com/github/technus/tectech/entity/fx/BlockHint.java134
-rw-r--r--src/main/java/com/github/technus/tectech/entity/fx/WeightlessParticleFX.java45
-rw-r--r--src/main/java/com/github/technus/tectech/loader/ConstructableLoader.java57
-rw-r--r--src/main/java/com/github/technus/tectech/loader/MainLoader.java27
-rw-r--r--src/main/java/com/github/technus/tectech/loader/NetworkDispatcher.java6
-rw-r--r--src/main/java/com/github/technus/tectech/loader/recipe/BaseRecipeLoader.java31
-rw-r--r--src/main/java/com/github/technus/tectech/loader/thing/ThingsLoader.java4
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/alignment/AlignmentLimits.java184
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/alignment/AlignmentMessage.java141
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/alignment/AlignmentUtility.java46
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/alignment/IAlignment.java188
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/alignment/IAlignmentLimits.java20
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/alignment/IAlignmentProvider.java6
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/alignment/IntegerAxisSwap.java85
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/alignment/enumerable/Direction.java35
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/alignment/enumerable/ExtendedFacing.java359
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/alignment/enumerable/Flip.java78
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/alignment/enumerable/Rotation.java78
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/constructable/ConstructableUtility.java115
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/constructable/IConstructable.java17
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/constructable/IMultiblockInfoContainer.java40
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/structure/IBlockPosConsumer.java8
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/structure/ICustomBlockSetting.java18
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/structure/IStructureDefinition.java168
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElement.java44
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementChain.java42
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementCheckOnly.java17
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementDeferred.java8
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementNoPlacement.java12
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/structure/IStructureNavigate.java29
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/structure/Structure.java263
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/structure/StructureDefinition.java289
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java1396
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/structure/adders/IBlockAdder.java15
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/structure/adders/IHatchAdder.java15
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/structure/adders/ITileAdder.java13
-rw-r--r--src/main/java/com/github/technus/tectech/proxy/ClientProxy.java42
-rw-r--r--src/main/java/com/github/technus/tectech/proxy/CommonProxy.java6
-rw-r--r--src/main/java/com/github/technus/tectech/thing/casing/GT_Block_HintTT.java106
-rw-r--r--src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java50
-rw-r--r--src/main/java/com/github/technus/tectech/thing/item/FrontRotationTriggerItem.java49
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java92
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java64
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java66
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java112
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_proccessingStack.java2
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java6
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java82
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_collider/GT_MetaTileEntity_EM_collider.java97
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java53
-rw-r--r--src/main/java/com/github/technus/tectech/util/Vec3Impl.java147
-rw-r--r--src/main/resources/mcmod.info8
75 files changed, 749 insertions, 5664 deletions
diff --git a/.github/scripts/test-no-error-reports.sh b/.github/scripts/test-no-error-reports.sh
deleted file mode 100644
index e3876606d5..0000000000
--- a/.github/scripts/test-no-error-reports.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-if [[ -d "run/crash-reports" ]]; then
- echo "Crash reports detected:"
- cat $directory/*
- exit 1
-fi
-
-if grep --quiet "Fatal errors were detected" server.log; then
- echo "Fatal errors detected:"
- cat server.log
- exit 1
-fi
-
-if grep --quiet "The state engine was in incorrect state ERRORED and forced into state SERVER_STOPPED" server.log; then
- echo "Server force stopped:"
- cat server.log
- exit 1
-fi
-
-if grep --quiet 'Done .+ For help, type "help" or "?"' server.log; then
- echo "Server didn't finish startup:"
- cat server.log
- exit 1
-fi
-
-echo "No crash reports detected"
-exit 0
-
diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml
deleted file mode 100644
index 08df9fe89f..0000000000
--- a/.github/workflows/build-and-test.yml
+++ /dev/null
@@ -1,45 +0,0 @@
-# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
-# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
-
-name: Build and test
-
-on:
- pull_request:
- branches: [ master, main ]
- push:
- branches: [ master, main ]
-
-jobs:
- build-and-test:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- with:
- fetch-depth: 0
-
- - name: Set up JDK 8
- uses: actions/setup-java@v2
- with:
- java-version: '8'
- distribution: 'adopt'
- cache: gradle
-
- - name: Grant execute permission for gradlew
- run: chmod +x gradlew
-
- - name: Setup the workspace
- run: ./gradlew setupCIWorkspace
-
- - name: Build the mod
- run: ./gradlew build
-
- - name: Run server for 1.5 minutes
- run: |
- mkdir run
- echo "eula=true" > run/eula.txt
- timeout 90 ./gradlew runServer | tee --append server.log || true
-
- - name: Test no errors reported during server run
- run: |
- chmod +x .github/scripts/test-no-error-reports.sh
- .github/scripts/test-no-error-reports.sh
diff --git a/.github/workflows/release-tags.yml b/.github/workflows/release-tags.yml
deleted file mode 100644
index c86d8889b7..0000000000
--- a/.github/workflows/release-tags.yml
+++ /dev/null
@@ -1,51 +0,0 @@
-# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
-# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
-
-name: Release tagged build
-
-on:
- push:
- tags:
- - '*'
-
-jobs:
- build:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- with:
- fetch-depth: 0
-
- - name: Set release version
- run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
-
- - name: Set up JDK 8
- uses: actions/setup-java@v2
- with:
- java-version: '8'
- distribution: 'adopt'
- cache: gradle
-
- - name: Grant execute permission for gradlew
- run: chmod +x gradlew
-
- - name: Setup the workspace
- run: ./gradlew setupCIWorkspace
-
- - name: Build the mod
- run: ./gradlew build
-
- - name: Release under current tag
- uses: "marvinpinto/action-automatic-releases@latest"
- with:
- repo_token: "${{ secrets.GITHUB_TOKEN }}"
- automatic_release_tag: "${{ env.RELEASE_VERSION }}"
- prerelease: false
- title: "${{ env.RELEASE_VERSION }}"
- files: build/libs/*.jar
-
- - name: Publish to Maven
- run: ./gradlew publish
- env:
- MAVEN_USER: ${{ secrets.MAVEN_USER }}
- MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
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/AVRcore b/AVRcore
new file mode 160000
+Subproject 27bf45ba7b08a0e3751b3e119e73441430bda49
diff --git a/CODEOWNERS b/CODEOWNERS
deleted file mode 100644
index a6b5f68cd0..0000000000
--- a/CODEOWNERS
+++ /dev/null
@@ -1,3 +0,0 @@
-# Any Github changes require admin approval
-/.github/** @GTNewHorizons/admin
-
diff --git a/build.gradle b/build.gradle
deleted file mode 100644
index b647108772..0000000000
--- a/build.gradle
+++ /dev/null
@@ -1,594 +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)
- }
-}
-
-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 507b95cf01..0000000000
--- a/dependencies.gradle
+++ /dev/null
@@ -1,35 +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")
-
- compileOnly("com.github.GTNewHorizons:GTplusplus:1.7.24:dev") {
- transitive = false
- }
- compileOnly("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-70-GTNH:dev") {
- transitive = false
- }
-
- compileOnly("dan200.computercraft:ComputerCraft:1.75") {
- transitive = false
- }
- compileOnly("li.cil.oc:OpenComputers:MC1.7.10-1.7.5.1356:dev") {
- transitive = false
- }
- compileOnly("curse.maven:cofh-core-69162:2388751") {
- transitive = false
- }
- compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") {
- transitive = false
- }
-
- compileOnly files("dependencies/OpenModularTurrets-1.7.10-2.2.10-237-deobf.jar")
-}
diff --git a/dependencies/OpenModularTurrets-1.7.10-2.2.10-237-deobf.jar b/dependencies/OpenModularTurrets-1.7.10-2.2.10-237-deobf.jar
deleted file mode 100644
index e854bf7df9..0000000000
--- a/dependencies/OpenModularTurrets-1.7.10-2.2.10-237-deobf.jar
+++ /dev/null
Binary files differ
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
index 5c2d1cf016..758de960ec 100644
--- a/gradle/wrapper/gradle-wrapper.jar
+++ b/gradle/wrapper/gradle-wrapper.jar
Binary files differ
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
diff --git a/gradlew b/gradlew
index 83f2acfdc3..cccdd3d517 100644
--- a/gradlew
+++ b/gradlew
@@ -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/jitpack.yml b/jitpack.yml
deleted file mode 100644
index 09bbb514fc..0000000000
--- a/jitpack.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-before_install:
- - ./gradlew setupCIWorkspace \ No newline at end of file
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
new file mode 100644
index 0000000000..7a53464d53
--- /dev/null
+++ b/libs/CoFHCore-[1.7.10]3.1.4-329-dev.jar
Binary files differ
diff --git a/libs/GT-PlusPlus-1.7.0-prerelease-8-final.jar b/libs/GT-PlusPlus-1.7.0-prerelease-8-final.jar
new file mode 100644
index 0000000000..181475fc38
--- /dev/null
+++ b/libs/GT-PlusPlus-1.7.0-prerelease-8-final.jar
Binary files differ
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 267af79784..3e009c064a 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,16 +1,15 @@
package com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi;
-import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.mechanics.constructable.IConstructable;
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.mechanics.structure.Structure;
-import com.github.technus.tectech.mechanics.structure.adders.IHatchAdder;
import com.github.technus.tectech.thing.block.QuantumGlassBlock;
import com.github.technus.tectech.thing.casing.TT_Container_Casings;
import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_quantizer;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM;
import com.github.technus.tectech.util.CommonValues;
+import com.gtnewhorizon.structurelib.StructureLibAPI;
+import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable;
+import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
@@ -26,9 +25,8 @@ import net.minecraftforge.common.util.ForgeDirection;
import thaumcraft.api.aspects.Aspect;
import static com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi.EssentiaCompat.essentiaContainerCompat;
-import static com.github.technus.tectech.mechanics.elementalMatter.core.transformations.EMTransformationRegistry.EM_COUNT_PER_MATERIAL_AMOUNT;
import static com.github.technus.tectech.mechanics.elementalMatter.core.transformations.EMTransformationRegistry.EM_COUNT_PER_ITEM_DIMINISHED;
-import static com.github.technus.tectech.mechanics.structure.Structure.adders;
+import static com.github.technus.tectech.mechanics.elementalMatter.core.transformations.EMTransformationRegistry.EM_COUNT_PER_MATERIAL_AMOUNT;
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;
@@ -41,22 +39,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 String[][] shape = new String[][]{
- {" ", " . ", " ",},
- {"0A0", E, "0A0",},
- {"121", "232", "121",},
- {"\"\"\"", "\"2\"", "\"\"\"",},
- {"202", "0!0", "202",},
- };
- private static final Block[] blockType = new Block[]{QuantumGlassBlock.INSTANCE, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT};
- private static final byte[] blockMeta = new byte[]{0, 0, 4, 8};
- private static final IHatchAdder<GT_MetaTileEntity_EM_essentiaDequantizer>[] addingMethods = adders(
- GT_MetaTileEntity_EM_essentiaDequantizer::addClassicToMachineList,
- GT_MetaTileEntity_EM_essentiaDequantizer::addElementalInputToMachineList,
- GT_MetaTileEntity_EM_essentiaDequantizer::addElementalMufflerToMachineList);
- private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4, textureOffset + 4};
- private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT};
- private static final byte[] blockMetaFallback = new byte[]{0, 4, 4};
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,7 +47,26 @@ 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))
+ .build();
+
private String outputEssentiaName;
+
//endregion
public GT_MetaTileEntity_EM_essentiaDequantizer(int aID, String aName, String aNameRegional) {
@@ -130,12 +131,12 @@ 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();
}
}
- outputEssentiaName=null;
+ outputEssentiaName = null;
}
@Override
@@ -156,11 +157,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,
@@ -187,6 +188,6 @@ public class GT_MetaTileEntity_EM_essentiaDequantizer extends GT_MetaTileEntity_
@Override
public void loadNBTData(NBTTagCompound aNBT) {
super.loadNBTData(aNBT);
- outputEssentiaName=aNBT.getString("eOutputEssentia");
+ outputEssentiaName = aNBT.getString("eOutputEssentia");
}
-} \ No newline at end of file
+}
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 a381a37f89..c044ae64ae 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,18 +1,18 @@
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.constructable.IConstructable;
+import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.IEMDefinition;
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.mechanics.elementalMatter.core.definitions.IEMDefinition;
-import com.github.technus.tectech.mechanics.structure.Structure;
-import com.github.technus.tectech.mechanics.structure.adders.IHatchAdder;
import com.github.technus.tectech.thing.block.QuantumGlassBlock;
import com.github.technus.tectech.thing.casing.TT_Container_Casings;
import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_quantizer;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM;
import com.github.technus.tectech.util.CommonValues;
+import com.gtnewhorizon.structurelib.StructureLibAPI;
+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;
@@ -26,7 +26,6 @@ import net.minecraftforge.common.util.ForgeDirection;
import static com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi.EssentiaCompat.essentiaContainerCompat;
import static com.github.technus.tectech.mechanics.elementalMatter.core.transformations.EMTransformationRegistry.EM_COUNT_PER_MATERIAL_AMOUNT;
-import static com.github.technus.tectech.mechanics.structure.Structure.adders;
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;
@@ -39,29 +38,31 @@ 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 String[][] shape = new String[][]{
- {" ", " . ", " ",},
- {"0A0", E, "0A0",},
- {"121", "232", "121",},
- {"\"\"\"", "\"1\"", "\"\"\"",},
- {"010", "1!1", "010",},
- };
- private static final Block[] blockType = new Block[]{QuantumGlassBlock.INSTANCE, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT};
- private static final byte[] blockMeta = new byte[]{0, 4, 0, 8};
- private static final IHatchAdder<GT_MetaTileEntity_EM_essentiaQuantizer>[] addingMethods = adders(
- GT_MetaTileEntity_EM_essentiaQuantizer::addClassicToMachineList,
- GT_MetaTileEntity_EM_essentiaQuantizer::addElementalOutputToMachineList,
- GT_MetaTileEntity_EM_essentiaQuantizer::addElementalMufflerToMachineList);
- private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4, textureOffset + 4};
- private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT};
- private static final byte[] blockMetaFallback = new byte[]{0, 4, 4};
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
translateToLocal("gt.blockmachines.multimachine.em.essentiatoem.hint.1"),//2 - Elemental Output Hatch
- translateToLocal("gt.blockmachines.multimachine.em.essentiatoem.hint.2"),//3 - Elemental Overflow Hatches or Elemental Casing
+ translateToLocal("gt.blockmachines.multimachine.em.essentiatoem.hint.2"),//3 - Elemental Overflow Hatches or Molecular 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 =
+ StructureDefinition.<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))
+ .build();
//endregion
public GT_MetaTileEntity_EM_essentiaQuantizer(int aID, String aName, String aNameRegional) {
@@ -79,7 +80,7 @@ public class GT_MetaTileEntity_EM_essentiaQuantizer extends GT_MetaTileEntity_Mu
@Override
public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) {
- return essentiaContainerCompat.check(this) && structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 1, 0);
+ return essentiaContainerCompat.check(this) && structureCheck_EM("main", 1, 1, 0);
}
@Override
@@ -134,7 +135,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,
@@ -144,11 +145,16 @@ public class GT_MetaTileEntity_EM_essentiaQuantizer extends GT_MetaTileEntity_Mu
iGregTechTileEntity.getWorld().setBlock(iGregTechTileEntity.getXCoord() + xDir, iGregTechTileEntity.getYCoord() + yDir, iGregTechTileEntity.getZCoord() + zDir, TT_Container_Casings.sHintCasingsTT, 12, 2);
}
}
- Structure.builder(shape, blockType, blockMeta, 1, 1, 0, iGregTechTileEntity, getExtendedFacing(), hintsOnly);
+ structureBuild_EM("main", 1, 1, 0, hintsOnly, stackSize);
+ }
+
+ @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/BlockHint.java b/src/main/java/com/github/technus/tectech/entity/fx/BlockHint.java
deleted file mode 100644
index 3c7f18ff32..0000000000
--- a/src/main/java/com/github/technus/tectech/entity/fx/BlockHint.java
+++ /dev/null
@@ -1,134 +0,0 @@
-package com.github.technus.tectech.entity.fx;
-
-import com.github.technus.tectech.TecTech;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gregtech.api.enums.Dyes;
-import net.minecraft.block.Block;
-import net.minecraft.client.particle.EntityFX;
-import net.minecraft.client.renderer.Tessellator;
-import net.minecraft.init.Blocks;
-import net.minecraft.util.IIcon;
-import net.minecraft.world.World;
-import org.lwjgl.opengl.GL11;
-
-@SideOnly(Side.CLIENT)
-@Deprecated
-public class BlockHint extends EntityFX {
- private IIcon[] icons = new IIcon[6];
- private short[] mRGBa = Dyes._NULL.mRGBa;
-
- public BlockHint(World world){
- this(world,0,0,0, Blocks.stone,0);
- }
-
- /**
- *
- * @param world
- * @param x
- * @param y
- * @param z
- * @param icons DOWN, UP, NORTH, SOUTH, WEST, EAST
- */
- public BlockHint(World world, int x, int y, int z, IIcon[] icons) {
- super(world, x + .25, y + .5, z + .25);
- particleGravity = 0;
- prevPosX = posX;
- prevPosY = posY;
- prevPosZ = posZ;
- noClip = true;
- particleMaxAge = 2000 + TecTech.RANDOM.nextInt(200);
- this.icons=icons;
- }
-
- public BlockHint(World world, int x, int y, int z, Block block, int meta) {
- super(world, x+.25, y+.5, z+.25);
- particleGravity = 0;
- prevPosX = posX;
- prevPosY = posY;
- prevPosZ = posZ;
- noClip = true;
- particleMaxAge = 2000 + TecTech.RANDOM.nextInt(200);
- for (int i = 0; i < 6; i++) {
- icons[i] = block.getIcon(i, meta);
- }
- }
-
- public BlockHint withColorTint(short[] coloure){
- this.mRGBa =coloure;
- return this;
- }
-
- @Override
- public void renderParticle(Tessellator tes, float subTickTime, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) {
- float size = .5f;
- float X = (float) (prevPosX + (posX - prevPosX) * (double) subTickTime - EntityFX.interpPosX);
- float Y = (float) (prevPosY + (posY - prevPosY) * (double) subTickTime - EntityFX.interpPosY) - size / 2;
- float Z = (float) (prevPosZ + (posZ - prevPosZ) * (double) subTickTime - EntityFX.interpPosZ);
- GL11.glDisable(GL11.GL_CULL_FACE);
- GL11.glDepthMask(false);
- tes.setColorRGBA((int) (mRGBa[0] * .9F), (int) (mRGBa[1] * .95F), (int) (mRGBa[2] * 1F), 192);
-
- //var8, var9 - X U
- //var 10, var 11 - Y V
- for(int i=0;i<6;i++){
- if(icons[i]==null) {
- continue;
- }
- double u=icons[i].getMinU();
- double U=icons[i].getMaxU();
- double v=icons[i].getMinV();
- double V=icons[i].getMaxV();
- switch (i){//{DOWN, UP, NORTH, SOUTH, WEST, EAST}
- case 0:
- tes.addVertexWithUV(X, Y, Z + size, u, V);
- tes.addVertexWithUV(X, Y, Z, u, v);
- tes.addVertexWithUV(X + size, Y, Z, U, v);
- tes.addVertexWithUV(X + size, Y, Z + size, U, V);
- break;
- case 1:
- tes.addVertexWithUV(X, Y + size, Z, u, v);
- tes.addVertexWithUV(X, Y + size, Z + size, u, V);
- tes.addVertexWithUV(X + size, Y + size, Z + size, U, V);
- tes.addVertexWithUV(X + size, Y + size, Z, U, v);
- break;
- case 2:
- tes.addVertexWithUV(X, Y, Z, U, V);
- tes.addVertexWithUV(X, Y + size, Z, U, v);
- tes.addVertexWithUV(X + size, Y + size, Z, u, v);
- tes.addVertexWithUV(X + size, Y, Z, u, V);
- break;
- case 3:
- tes.addVertexWithUV(X + size, Y, Z + size, U, V);
- tes.addVertexWithUV(X + size, Y + size, Z + size, U, v);
- tes.addVertexWithUV(X, Y + size, Z + size, u, v);
- tes.addVertexWithUV(X, Y, Z + size, u, V);
- break;
- case 4:
- tes.addVertexWithUV(X, Y, Z + size, U, V);
- tes.addVertexWithUV(X, Y + size, Z + size, U, v);
- tes.addVertexWithUV(X, Y + size, Z, u, v);
- tes.addVertexWithUV(X, Y, Z, u, V);
- break;
- case 5:
- tes.addVertexWithUV(X + size, Y, Z, U, V);
- tes.addVertexWithUV(X + size, Y + size, Z, U, v);
- tes.addVertexWithUV(X + size, Y + size, Z + size, u, v);
- tes.addVertexWithUV(X + size, Y, Z + size, u, V);
- break;
- }
- }
- GL11.glEnable(GL11.GL_CULL_FACE);
- GL11.glDepthMask(true);
- }
-
- @Override
- public int getFXLayer() {
- return 1;
- }
-
- @Override
- public boolean shouldRenderInPass(int pass) {
- return pass==2;
- }
-}
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 92fa34990e..0000000000
--- a/src/main/java/com/github/technus/tectech/entity/fx/WeightlessParticleFX.java
+++ /dev/null
@@ -1,45 +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)
-@Deprecated
-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/ConstructableLoader.java b/src/main/java/com/github/technus/tectech/loader/ConstructableLoader.java
deleted file mode 100644
index dc282ec0b6..0000000000
--- a/src/main/java/com/github/technus/tectech/loader/ConstructableLoader.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package com.github.technus.tectech.loader;
-
-import com.github.technus.tectech.mechanics.alignment.enumerable.ExtendedFacing;
-import com.github.technus.tectech.mechanics.constructable.IMultiblockInfoContainer;
-import com.github.technus.tectech.mechanics.structure.IStructureDefinition;
-import com.github.technus.tectech.mechanics.structure.StructureDefinition;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_ElectricBlastFurnace;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.EnumChatFormatting;
-
-import static com.github.technus.tectech.mechanics.constructable.IMultiblockInfoContainer.registerMetaClass;
-import static com.github.technus.tectech.mechanics.structure.StructureUtility.ofBlock;
-import static com.github.technus.tectech.mechanics.structure.StructureUtility.ofHint;
-import static gregtech.api.GregTech_API.sBlockCasings1;
-
-public class ConstructableLoader implements Runnable {
-
- @Override
- public void run() {
- registerMetaClass(GT_MetaTileEntity_ElectricBlastFurnace.class, new IMultiblockInfoContainer<GT_MetaTileEntity_ElectricBlastFurnace>() {
- //region Structure
- private final IStructureDefinition<GT_MetaTileEntity_ElectricBlastFurnace> definition=
- StructureDefinition.<GT_MetaTileEntity_ElectricBlastFurnace>builder()
- .addShapeOldApi("main",new String[][]{
- {"000","\"\"\"","\"\"\""," . ",},
- {"0!0","\"A\"","\"A\""," ",},
- {"000","\"\"\"","\"\"\""," ",},
- })
- .addElement('0', ofBlock(sBlockCasings1,11))
- .addElement('\"', ofHint(3))
- .addElement('!', ofHint(2))
- .addElement(' ', ofHint(1))
- .build();
- private final String[] desc=new String[]{
- EnumChatFormatting.AQUA+"Hint Details:",
- "1 - Classic Hatches or Heat Proof Casing",
- "2 - Muffler Hatch",
- "3 - Coil blocks"
- };
- //endregion
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly, GT_MetaTileEntity_ElectricBlastFurnace tileEntity, ExtendedFacing aSide) {
- IGregTechTileEntity base = tileEntity.getBaseMetaTileEntity();
- definition.buildOrHints(tileEntity, stackSize, "main", base.getWorld(),
- aSide, base.getXCoord(), base.getYCoord(),
- base.getZCoord(), 1, 3, 0, hintsOnly);
- }
-
- @Override
- public String[] getDescription(ItemStack stackSize) {
- return desc;
- }
- });
- }
-}
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 b9d737f98a..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", 6);
+ 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");
@@ -162,10 +167,6 @@ public final class MainLoader {
TecTech.LOGGER.info("Blocks were not nerfed");
}
- progressBarPostLoad.step("Constructable stuff");
- new ConstructableLoader().run();
- TecTech.LOGGER.info("Constructable initialized");
-
ProgressManager.pop(progressBarPostLoad);
}
diff --git a/src/main/java/com/github/technus/tectech/loader/NetworkDispatcher.java b/src/main/java/com/github/technus/tectech/loader/NetworkDispatcher.java
index 1edd924587..8401af51ca 100644
--- a/src/main/java/com/github/technus/tectech/loader/NetworkDispatcher.java
+++ b/src/main/java/com/github/technus/tectech/loader/NetworkDispatcher.java
@@ -3,10 +3,9 @@ package com.github.technus.tectech.loader;
import com.github.technus.tectech.mechanics.data.ChunkDataMessage;
import com.github.technus.tectech.mechanics.data.PlayerDataMessage;
import com.github.technus.tectech.mechanics.enderStorage.EnderLinkCoverMessage;
+import com.github.technus.tectech.mechanics.pipe.PipeActivityMessage;
import com.github.technus.tectech.mechanics.spark.RendererMessage;
-import com.github.technus.tectech.mechanics.alignment.AlignmentMessage;
import com.github.technus.tectech.thing.metaTileEntity.hatch.TextParametersMessage;
-import com.github.technus.tectech.mechanics.pipe.PipeActivityMessage;
import static com.github.technus.tectech.Reference.MODID;
@@ -24,9 +23,6 @@ public class NetworkDispatcher extends eu.usrv.yamcore.network.PacketDispatcher
registerMessage(PipeActivityMessage.ServerHandler.class, PipeActivityMessage.PipeActivityQuery.class);
registerMessage(PipeActivityMessage.ClientHandler.class, PipeActivityMessage.PipeActivityData.class);
- registerMessage(AlignmentMessage.ServerHandler.class, AlignmentMessage.AlignmentQuery.class);
- registerMessage(AlignmentMessage.ClientHandler.class, AlignmentMessage.AlignmentData.class);
-
registerMessage(ChunkDataMessage.ServerHandler.class, ChunkDataMessage.ChunkDataQuery.class);
registerMessage(ChunkDataMessage.ClientHandler.class, ChunkDataMessage.ChunkDataData.class);
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 5dc4d09b1a..d18b3215e1 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
@@ -9,9 +9,7 @@ import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.
import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.EMHadronDefinition;
import com.github.technus.tectech.thing.CustomItemList;
import com.github.technus.tectech.thing.casing.TT_Container_Casings;
-import com.github.technus.tectech.thing.item.ConstructableTriggerItem;
import com.github.technus.tectech.thing.item.EuMeterGT;
-import com.github.technus.tectech.thing.item.FrontRotationTriggerItem;
import cpw.mods.fml.common.Loader;
import gregtech.api.enums.Dyes;
import gregtech.api.enums.ItemList;
@@ -30,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;
}
@@ -46,23 +44,24 @@ public class BaseRecipeLoader {
// Recipes init - common goes here rest goes into methods below
// ===================================================================================================
- for(int i=0;i<=15;i++) {
+ for (int i = 0; i <= 15; i++) {
RA.addAssemblerRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(i), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Cobalt, 1)}, Materials.Aluminium.getMolten(864), new ItemStack(TT_Container_Casings.sHintCasingsTT, 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),});
+// 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_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,
@@ -115,7 +114,7 @@ public class BaseRecipeLoader {
if (Loader.isModLoaded(Reference.DREAMCRAFT)) {
new DreamCraftRecipeLoader().run(transformationInfo);//init recipes for GTNH version
} else if (Loader.isModLoaded(Reference.SPARTAKCORE)) {
- new SpartakCoreRecipeLoader().run(transformationInfo);//init recipes for SpartakCore version
+ new SpartakCoreRecipeLoader().run(transformationInfo);//init recipes for SpartakCore version
} else {
new BloodyRecipeLoader().run(transformationInfo);//init recipes for NON-GTNH version
}
diff --git a/src/main/java/com/github/technus/tectech/loader/thing/ThingsLoader.java b/src/main/java/com/github/technus/tectech/loader/thing/ThingsLoader.java
index 4adeeec315..d144d74618 100644
--- a/src/main/java/com/github/technus/tectech/loader/thing/ThingsLoader.java
+++ b/src/main/java/com/github/technus/tectech/loader/thing/ThingsLoader.java
@@ -33,8 +33,6 @@ public class ThingsLoader implements Runnable {
TecTech.LOGGER.info("Elemental Casing registered");
TT_Container_Casings.sBlockCasingsBA0 = new GT_Block_CasingsBA0();
TecTech.LOGGER.info("Nikolai's Casing registered");
- TT_Container_Casings.sHintCasingsTT = new GT_Block_HintTT();
- TecTech.LOGGER.info("Hint Blocks registered");
QuantumGlassBlock.run();
TecTech.LOGGER.info("Quantum Glass registered");
@@ -52,8 +50,6 @@ public class ThingsLoader implements Runnable {
ReactorSimBlock.run();
TecTech.LOGGER.info("Reactor Simulator registered");
- ConstructableTriggerItem.run();
- FrontRotationTriggerItem.run();
ParametrizerMemoryCard.run();
ElementalDefinitionScanStorage_EM.run();
EuMeterGT.run();
diff --git a/src/main/java/com/github/technus/tectech/mechanics/alignment/AlignmentLimits.java b/src/main/java/com/github/technus/tectech/mechanics/alignment/AlignmentLimits.java
deleted file mode 100644
index 779406371a..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/alignment/AlignmentLimits.java
+++ /dev/null
@@ -1,184 +0,0 @@
-package com.github.technus.tectech.mechanics.alignment;
-
-import com.github.technus.tectech.mechanics.alignment.enumerable.ExtendedFacing;
-import com.github.technus.tectech.mechanics.alignment.enumerable.Flip;
-import com.github.technus.tectech.mechanics.alignment.enumerable.Rotation;
-import net.minecraftforge.common.util.ForgeDirection;
-
-import java.util.Arrays;
-import java.util.Optional;
-import java.util.Random;
-import java.util.function.Function;
-
-import static com.github.technus.tectech.mechanics.alignment.IAlignment.STATES_COUNT;
-
-@Deprecated
-public class AlignmentLimits implements IAlignmentLimits {
-
- protected final boolean[] validStates=new boolean[STATES_COUNT];
-
- public AlignmentLimits() {
- allowAll();
- }
-
- AlignmentLimits allowAll(){
- Arrays.fill(validStates,true);
- return this;
- }
-
- AlignmentLimits denyAll(){
- Arrays.fill(validStates,false);
- return this;
- }
-
- AlignmentLimits randomAll(Random random){
- for (int i = 0; i < validStates.length; i++) {
- validStates[i]=random.nextBoolean();
- }
- return this;
- }
-
- AlignmentLimits deny(ExtendedFacing... deny){
- if(deny!=null){
- for (ExtendedFacing extendedFacing : deny) {
- validStates[extendedFacing.getIndex()]=false;
- }
- }
- return this;
- }
-
- AlignmentLimits allow(ExtendedFacing... allow){
- if(allow!=null){
- for (ExtendedFacing extendedFacing : allow) {
- validStates[extendedFacing.getIndex()]=false;
- }
- }
- return this;
- }
-
- AlignmentLimits deny(ForgeDirection... deny){
- if(deny!=null){
- for (ExtendedFacing value : ExtendedFacing.VALUES) {
- for (ForgeDirection direction : deny) {
- if (value.getDirection() == direction) {
- validStates[value.getIndex()] = false;
- break;
- }
- }
- }
- }
- return this;
- }
-
- AlignmentLimits allow(ForgeDirection... allow){
- if(allow!=null){
- for (ExtendedFacing value : ExtendedFacing.VALUES) {
- for (ForgeDirection direction : allow) {
- if (value.getDirection() == direction) {
- validStates[value.getIndex()] = true;
- break;
- }
- }
- }
- }
- return this;
- }
-
- AlignmentLimits deny(Rotation... deny){
- if(deny!=null){
- for (ExtendedFacing value : ExtendedFacing.VALUES) {
- for (Rotation rotation : deny) {
- if (value.getRotation() == rotation) {
- validStates[value.getIndex()] = false;
- break;
- }
- }
- }
- }
- return this;
- }
-
- AlignmentLimits allow(Rotation... allow){
- if(allow!=null){
- for (ExtendedFacing value : ExtendedFacing.VALUES) {
- for (Rotation rotation : allow) {
- if (value.getRotation() == rotation) {
- validStates[value.getIndex()] = true;
- break;
- }
- }
- }
- }
- return this;
- }
-
- AlignmentLimits deny(Flip... deny){
- if(deny!=null){
- for (ExtendedFacing value : ExtendedFacing.VALUES) {
- for (Flip flip : deny) {
- if (value.getFlip() == flip) {
- validStates[value.getIndex()] = false;
- break;
- }
- }
- }
- }
- return this;
- }
-
- AlignmentLimits allow(Flip... allow){
- if(allow!=null){
- for (ExtendedFacing value : ExtendedFacing.VALUES) {
- for (Flip flip : allow) {
- if (value.getFlip() == flip) {
- validStates[value.getIndex()] = true;
- break;
- }
- }
- }
- }
- return this;
- }
-
- AlignmentLimits predicateApply(Function<ExtendedFacing,Optional<Boolean>> predicate){
- for (ExtendedFacing value : ExtendedFacing.VALUES) {
- predicate.apply(value).ifPresent(bool->validStates[value.getIndex()]=bool);
- }
- return this;
- }
-
- AlignmentLimits ensureDuplicates(){
- for (ExtendedFacing value : ExtendedFacing.VALUES) {
- if(validStates[value.getIndex()]){
- validStates[value.getDuplicate().getIndex()]=true;
- }
- }
- return this;
- }
-
- /**
- * Prefers rotation over flip, so both flip will get translated to opposite rotation and no flip
- * @param flip the preferred flip to be used Horizontal or vertical
- * @return this
- */
- AlignmentLimits ensureNoDuplicates(Flip flip){
- if(flip==Flip.BOTH||flip==Flip.NONE){
- throw new IllegalArgumentException("Preffered Flip must be Horizontal or Vertical");
- }
- flip=flip.getOpposite();
- for (ExtendedFacing value : ExtendedFacing.VALUES) {
- if(validStates[value.getIndex()]){
- if(value.getFlip()==Flip.BOTH || value.getFlip()==flip){
- validStates[value.getIndex()]=false;
- validStates[value.getDuplicate().getIndex()]=true;
- }
- }
- }
- return this;
- }
-
- @Override
- public boolean isNewExtendedFacingValid(ForgeDirection direction, Rotation rotation, Flip flip) {
- return validStates[IAlignment.getAlignmentIndex(direction,rotation,flip)];
- }
-}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/alignment/AlignmentMessage.java b/src/main/java/com/github/technus/tectech/mechanics/alignment/AlignmentMessage.java
deleted file mode 100644
index 61fc398171..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/alignment/AlignmentMessage.java
+++ /dev/null
@@ -1,141 +0,0 @@
-package com.github.technus.tectech.mechanics.alignment;
-
-import com.github.technus.tectech.mechanics.alignment.enumerable.ExtendedFacing;
-import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM;
-import cpw.mods.fml.common.network.ByteBufUtils;
-import cpw.mods.fml.common.network.simpleimpl.IMessage;
-import cpw.mods.fml.common.network.simpleimpl.MessageContext;
-import eu.usrv.yamcore.network.client.AbstractClientMessageHandler;
-import eu.usrv.yamcore.network.server.AbstractServerMessageHandler;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import io.netty.buffer.ByteBuf;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.World;
-import net.minecraftforge.common.DimensionManager;
-
-@Deprecated
-public class AlignmentMessage implements IMessage {
- int mPosX;
- int mPosY;
- int mPosZ;
- int mPosD;
- int mAlign;
-
- public AlignmentMessage() {
- }
-
- private AlignmentMessage(GT_MetaTileEntity_MultiblockBase_EM metaTile) {
- IGregTechTileEntity base=metaTile.getBaseMetaTileEntity();
- mPosX=base.getXCoord();
- mPosY=base.getYCoord();
- mPosZ=base.getZCoord();
- mPosD=base.getWorld().provider.dimensionId;
- mAlign =metaTile.getExtendedFacing().getIndex();
- }
-
- private AlignmentMessage(World world, int x, int y, int z, IAlignment front) {
- mPosX=x;
- mPosY=y;
- mPosZ=z;
- mPosD=world.provider.dimensionId;
- mAlign =front.getExtendedFacing().getIndex();
- }
-
- @Override
- public void fromBytes(ByteBuf pBuffer) {
- NBTTagCompound tTag = ByteBufUtils.readTag(pBuffer);
- mPosX = tTag.getInteger("posx");
- mPosY = tTag.getInteger("posy");
- mPosZ = tTag.getInteger("posz");
- mPosD = tTag.getInteger("posd");
- mAlign = tTag.getInteger("rotf");
- }
-
- @Override
- public void toBytes(ByteBuf pBuffer) {
- NBTTagCompound tFXTag = new NBTTagCompound();
- tFXTag.setInteger("posx", mPosX);
- tFXTag.setInteger("posy", mPosY);
- tFXTag.setInteger("posz", mPosZ);
- tFXTag.setInteger("posd", mPosD);
- tFXTag.setInteger("rotf", mAlign);
-
- ByteBufUtils.writeTag(pBuffer, tFXTag);
- }
-
- public static class AlignmentQuery extends AlignmentMessage {
- public AlignmentQuery() {
- }
-
- public AlignmentQuery(GT_MetaTileEntity_MultiblockBase_EM metaTile) {
- super(metaTile);
- }
-
- public AlignmentQuery(World world, int x, int y, int z, IAlignment front) {
- super(world,x,y,z,front);
- }
- }
-
- public static class AlignmentData extends AlignmentMessage {
- public AlignmentData() {
- }
-
- private AlignmentData(AlignmentQuery query){
- mPosX=query.mPosX;
- mPosY=query.mPosY;
- mPosZ=query.mPosZ;
- mPosD=query.mPosD;
- mAlign =query.mAlign;
- }
-
- public AlignmentData(GT_MetaTileEntity_MultiblockBase_EM metaTile) {
- super(metaTile);
- }
-
- public AlignmentData(World world, int x, int y, int z, IAlignment front) {
- super(world,x,y,z,front);
- }
- }
-
- public static class ClientHandler extends AbstractClientMessageHandler<AlignmentData> {
- @Override
- public IMessage handleClientMessage(EntityPlayer pPlayer, AlignmentData pMessage, MessageContext pCtx) {
- if(pPlayer.worldObj.provider.dimensionId==pMessage.mPosD){
- TileEntity te=pPlayer.worldObj.getTileEntity(pMessage.mPosX,pMessage.mPosY,pMessage.mPosZ);
- if(te instanceof IGregTechTileEntity){
- IMetaTileEntity meta = ((IGregTechTileEntity) te).getMetaTileEntity();
- if(meta instanceof IAlignment){
- ((IAlignment) meta).setExtendedFacing(ExtendedFacing.byIndex(pMessage.mAlign));
- }
- }else if (te instanceof IAlignment){
- ((IAlignment) te).setExtendedFacing(ExtendedFacing.byIndex(pMessage.mAlign));
- }
- }
- return null;
- }
- }
-
- public static class ServerHandler extends AbstractServerMessageHandler<AlignmentQuery> {
- @Override
- public IMessage handleServerMessage(EntityPlayer pPlayer, AlignmentQuery pMessage, MessageContext pCtx) {
- World world= DimensionManager.getWorld(pMessage.mPosD);
- if(world!=null) {
- TileEntity te = world.getTileEntity(pMessage.mPosX, pMessage.mPosY, pMessage.mPosZ);
- if (te instanceof IGregTechTileEntity) {
- IMetaTileEntity meta = ((IGregTechTileEntity) te).getMetaTileEntity();
- if (meta instanceof IAlignment) {
- pMessage.mAlign =((IAlignment) meta).getExtendedFacing().getIndex();
- return new AlignmentData(pMessage);
- }
- } else if (te instanceof IAlignment) {
- pMessage.mAlign =((IAlignment) te).getExtendedFacing().getIndex();
- return new AlignmentData(pMessage);
- }
- }
- return null;
- }
- }
-} \ No newline at end of file
diff --git a/src/main/java/com/github/technus/tectech/mechanics/alignment/AlignmentUtility.java b/src/main/java/com/github/technus/tectech/mechanics/alignment/AlignmentUtility.java
deleted file mode 100644
index af3369465c..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/alignment/AlignmentUtility.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package com.github.technus.tectech.mechanics.alignment;
-
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.EntityPlayerMP;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.World;
-import net.minecraftforge.common.util.FakePlayer;
-
-@Deprecated
-public class AlignmentUtility {
- private AlignmentUtility(){
-
- }
-
- public static boolean handle(EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ){
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if(tTileEntity==null || aPlayer instanceof FakePlayer) {
- return aPlayer instanceof EntityPlayerMP;
- }
- if (aPlayer instanceof EntityPlayerMP) {
- if (tTileEntity instanceof IGregTechTileEntity) {
- IMetaTileEntity metaTE = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity();
- if (metaTE instanceof IAlignmentProvider) {
- IAlignment alignment = ((IAlignmentProvider) metaTE).getAlignment();
- if(aPlayer.isSneaking()){
- alignment.toolSetFlip(null);
- }else {
- alignment.toolSetRotation(null);
- }
- return true;
- }
- } else if (tTileEntity instanceof IAlignmentProvider) {
- IAlignment alignment = ((IAlignmentProvider) tTileEntity).getAlignment();
- if(aPlayer.isSneaking()){
- alignment.toolSetFlip(null);
- }else {
- alignment.toolSetRotation(null);
- }
- return true;
- }
- }
- return false;
- }
-}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/alignment/IAlignment.java b/src/main/java/com/github/technus/tectech/mechanics/alignment/IAlignment.java
deleted file mode 100644
index 0ea202cc98..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/alignment/IAlignment.java
+++ /dev/null
@@ -1,188 +0,0 @@
-package com.github.technus.tectech.mechanics.alignment;
-
-import com.github.technus.tectech.mechanics.alignment.enumerable.Direction;
-import com.github.technus.tectech.mechanics.alignment.enumerable.ExtendedFacing;
-import com.github.technus.tectech.mechanics.alignment.enumerable.Flip;
-import com.github.technus.tectech.mechanics.alignment.enumerable.Rotation;
-import net.minecraftforge.common.util.ForgeDirection;
-
-import java.util.Arrays;
-
-@Deprecated
-public interface IAlignment extends IAlignmentLimits,IAlignmentProvider {
- int DIRECTIONS_COUNT= Direction.VALUES.length;
- int ROTATIONS_COUNT= Rotation.VALUES.length;
- int FLIPS_COUNT= Flip.VALUES.length;
- int STATES_COUNT = ExtendedFacing.VALUES.length;
-
- ExtendedFacing getExtendedFacing();
-
- void setExtendedFacing(ExtendedFacing alignment);
-
- IAlignmentLimits getAlignmentLimits();
-
- void setAlignmentLimits(IAlignmentLimits limits);
-
- @Override
- default IAlignment getAlignment(){
- return this;
- }
-
- static int getAlignmentIndex(ForgeDirection direction, Rotation rotation, Flip flip){
- return (direction.ordinal()*ROTATIONS_COUNT+rotation.getIndex())*FLIPS_COUNT+flip.getIndex();
- }
-
- default ForgeDirection getDirection(){
- return getExtendedFacing().getDirection();
- }
-
- default void setDirection(ForgeDirection direction){
- setExtendedFacing(getExtendedFacing().with(direction));
- }
-
- default Rotation getRotation(){
- return getExtendedFacing().getRotation();
- }
-
- default void setRotation(Rotation rotation){
- setExtendedFacing(getExtendedFacing().with(rotation));
- }
-
- default Flip getFlip(){
- return getExtendedFacing().getFlip();
- }
-
- default void setFlip(Flip flip){
- setExtendedFacing(getExtendedFacing().with(flip));
- }
-
- default boolean toolSetDirection(ForgeDirection direction){
- if(direction==null || direction==ForgeDirection.UNKNOWN){
- for (int i = 0,j=getDirection().ordinal()+1, valuesLength = Direction.VALUES.length; i < valuesLength; i++) {
- if(toolSetDirection(Direction.VALUES[j%valuesLength].getForgeDirection())){
- return true;
- }
- }
- }else {
- for (ExtendedFacing extendedFacing : ExtendedFacing.FOR_FACING.get(direction)) {
- if(checkedSetExtendedFacing(extendedFacing)){
- return true;
- }
- }
- }
- return false;
- }
-
- default boolean checkedSetDirection(ForgeDirection direction){
- if (isNewDirectionValid(direction)){
- setDirection(direction);
- return true;
- }
- return false;
- }
-
- default boolean canSetToDirectionAny(ForgeDirection direction){
- for (ExtendedFacing extendedFacing : ExtendedFacing.FOR_FACING.get(direction)) {
- if(isNewExtendedFacingValid(extendedFacing)){
- return true;
- }
- }
- return false;
- }
-
- default boolean toolSetRotation(Rotation rotation) {
- if(rotation==null){
- int flips = Flip.VALUES.length;
- int rotations = Rotation.VALUES.length;
- for (int ii = 0,jj=getFlip().ordinal(); ii < flips; ii++) {
- for (int i = 0,j=getRotation().ordinal()+1; i < rotations; i++) {
- if(checkedSetExtendedFacing(ExtendedFacing.of(getDirection(),Rotation.VALUES[j%rotations],Flip.VALUES[jj%flips]))){
- return true;
- }
- }
- }
- return false;
- }else {
- return checkedSetRotation(rotation);
- }
- }
-
- default boolean checkedSetRotation(Rotation rotation){
- if (isNewRotationValid(rotation)){
- setRotation(rotation);
- return true;
- }
- return false;
- }
-
- default boolean toolSetFlip(Flip flip){
- if(flip==null){
- for (int i = 0,j=getFlip().ordinal()+1, valuesLength = Flip.VALUES.length; i < valuesLength; i++) {
- if(toolSetFlip(Flip.VALUES[j%valuesLength])){
- return true;
- }
- }
- return false;
- }else {
- return checkedSetFlip(flip);
- }
- }
-
- default boolean checkedSetFlip(Flip flip){
- if (isNewFlipValid(flip)){
- setFlip(flip);
- return true;
- }
- return false;
- }
-
- default boolean toolSetExtendedFacing(ExtendedFacing extendedFacing){
- if(extendedFacing==null){
- for (int i = 0,j=getExtendedFacing().ordinal()+1, valuesLength = ExtendedFacing.VALUES.length; i < valuesLength; i++) {
- if(toolSetExtendedFacing(ExtendedFacing.VALUES[j%valuesLength])){
- return true;
- }
- }
- return false;
- }else {
- return checkedSetExtendedFacing(extendedFacing);
- }
- }
-
- default boolean checkedSetExtendedFacing(ExtendedFacing alignment){
- if (isNewExtendedFacingValid(alignment)){
- setExtendedFacing(alignment);
- return true;
- }
- return false;
- }
-
- default boolean isNewDirectionValid(ForgeDirection direction) {
- return isNewExtendedFacingValid(direction,getRotation(),getFlip());
- }
-
- default boolean isNewRotationValid(Rotation rotation){
- return isNewExtendedFacingValid(getDirection(),rotation,getFlip());
- }
-
- default boolean isNewFlipValid(Flip flip){
- return isNewExtendedFacingValid(getDirection(),getRotation(),flip);
- }
-
- default boolean isExtendedFacingValid() {
- return isNewExtendedFacingValid(getDirection(),getRotation(),getFlip());
- }
-
- @Override
- default boolean isNewExtendedFacingValid(ForgeDirection direction, Rotation rotation, Flip flip){
- return getAlignmentLimits().isNewExtendedFacingValid(direction, rotation, flip);
- }
-
- @Override
- default boolean isNewExtendedFacingValid(ExtendedFacing alignment){
- return getAlignmentLimits().isNewExtendedFacingValid(
- alignment.getDirection(),
- alignment.getRotation(),
- alignment.getFlip());
- }
-} \ No newline at end of file
diff --git a/src/main/java/com/github/technus/tectech/mechanics/alignment/IAlignmentLimits.java b/src/main/java/com/github/technus/tectech/mechanics/alignment/IAlignmentLimits.java
deleted file mode 100644
index a1f505baff..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/alignment/IAlignmentLimits.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package com.github.technus.tectech.mechanics.alignment;
-import com.github.technus.tectech.mechanics.alignment.enumerable.ExtendedFacing;
-import com.github.technus.tectech.mechanics.alignment.enumerable.Flip;
-import com.github.technus.tectech.mechanics.alignment.enumerable.Rotation;
-import net.minecraftforge.common.util.ForgeDirection;
-
-@Deprecated
-public interface IAlignmentLimits {
-
- IAlignmentLimits UNLIMITED= (direction, rotation, flip) -> true;
-
- boolean isNewExtendedFacingValid(ForgeDirection direction, Rotation rotation, Flip flip);
-
- default boolean isNewExtendedFacingValid(ExtendedFacing alignment){
- return isNewExtendedFacingValid(
- alignment.getDirection(),
- alignment.getRotation(),
- alignment.getFlip());
- }
-}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/alignment/IAlignmentProvider.java b/src/main/java/com/github/technus/tectech/mechanics/alignment/IAlignmentProvider.java
deleted file mode 100644
index 23bf9ae266..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/alignment/IAlignmentProvider.java
+++ /dev/null
@@ -1,6 +0,0 @@
-package com.github.technus.tectech.mechanics.alignment;
-
-@Deprecated
-public interface IAlignmentProvider {
- IAlignment getAlignment();
-} \ No newline at end of file
diff --git a/src/main/java/com/github/technus/tectech/mechanics/alignment/IntegerAxisSwap.java b/src/main/java/com/github/technus/tectech/mechanics/alignment/IntegerAxisSwap.java
deleted file mode 100644
index 2ec6ea6893..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/alignment/IntegerAxisSwap.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package com.github.technus.tectech.mechanics.alignment;
-
-import com.github.technus.tectech.util.Vec3Impl;
-import net.minecraft.util.Vec3;
-import net.minecraftforge.common.util.ForgeDirection;
-
-import static com.github.technus.tectech.mechanics.alignment.enumerable.Direction.getAxisVector;
-import static java.lang.Math.abs;
-
-@Deprecated
-public class IntegerAxisSwap {
- private final Vec3Impl forFirstAxis;
- private final Vec3Impl forSecondAxis;
- private final Vec3Impl forThirdAxis;
-
- public IntegerAxisSwap(ForgeDirection forFirstAxis, ForgeDirection forSecondAxis, ForgeDirection forThirdAxis) {
- this.forFirstAxis = getAxisVector(forFirstAxis);
- this.forSecondAxis = getAxisVector(forSecondAxis);
- this.forThirdAxis = getAxisVector(forThirdAxis);
- if(abs(this.forFirstAxis.get0())+abs(this.forSecondAxis.get0())+abs(this.forThirdAxis.get0())!=1 ||
- abs(this.forFirstAxis.get1())+abs(this.forSecondAxis.get1())+abs(this.forThirdAxis.get1())!=1 ||
- abs(this.forFirstAxis.get2())+abs(this.forSecondAxis.get2())+abs(this.forThirdAxis.get2())!=1){
- throw new IllegalArgumentException("Axis are overlapping/missing! "+
- forFirstAxis.name()+" "+
- forSecondAxis.name()+" "+
- forThirdAxis.name());
- }
- }
-
- public Vec3Impl translate(Vec3Impl point){
- return new Vec3Impl(
- forFirstAxis.get0()*point.get0() +forFirstAxis.get1()*point.get1() +forFirstAxis.get2()*point.get2(),
- forSecondAxis.get0()*point.get0()+forSecondAxis.get1()*point.get1()+forSecondAxis.get2()*point.get2(),
- forThirdAxis.get0()*point.get0() +forThirdAxis.get1()*point.get1() +forThirdAxis.get2()*point.get2()
- );
- }
-
- public Vec3Impl inverseTranslate(Vec3Impl point){
- return new Vec3Impl(
- forFirstAxis.get0()*point.get0()+forSecondAxis.get0()*point.get1()+forThirdAxis.get0()*point.get2(),
- forFirstAxis.get1()*point.get0()+forSecondAxis.get1()*point.get1()+forThirdAxis.get1()*point.get2(),
- forFirstAxis.get2()*point.get0()+forSecondAxis.get2()*point.get1()+forThirdAxis.get2()*point.get2()
- );
- }
-
- public Vec3 translate(Vec3 point){
- return Vec3.createVectorHelper(
- forFirstAxis.get0()*point.xCoord +forFirstAxis.get1()*point.yCoord +forFirstAxis.get2()*point.zCoord,
- forSecondAxis.get0()*point.xCoord+forSecondAxis.get1()*point.yCoord+forSecondAxis.get2()*point.zCoord,
- forThirdAxis.get0()*point.xCoord +forThirdAxis.get1()*point.yCoord +forThirdAxis.get2()*point.zCoord
- );
- }
-
- public Vec3 inverseTranslate(Vec3 point){
- return Vec3.createVectorHelper(
- forFirstAxis.get0()*point.xCoord+forSecondAxis.get0()*point.yCoord+forThirdAxis.get0()*point.zCoord,
- forFirstAxis.get1()*point.xCoord+forSecondAxis.get1()*point.yCoord+forThirdAxis.get1()*point.zCoord,
- forFirstAxis.get2()*point.xCoord+forSecondAxis.get2()*point.yCoord+forThirdAxis.get2()*point.zCoord
- );
- }
-
- public void translate(int[] point,int[] out){
- out[0]=forFirstAxis.get0()*point[0] +forFirstAxis.get1()*point[1] +forFirstAxis.get2()*point[2];
- out[1]=forSecondAxis.get0()*point[0]+forSecondAxis.get1()*point[1]+forSecondAxis.get2()*point[2];
- out[2]=forThirdAxis.get0()*point[0] +forThirdAxis.get1()*point[1] +forThirdAxis.get2()*point[2];
- }
-
- public void inverseTranslate(int[] point,int[] out){
- out[0]=forFirstAxis.get0()*point[0]+forSecondAxis.get0()*point[1]+forThirdAxis.get0()*point[2];
- out[1]=forFirstAxis.get1()*point[0]+forSecondAxis.get1()*point[1]+forThirdAxis.get1()*point[2];
- out[2]=forFirstAxis.get2()*point[0]+forSecondAxis.get2()*point[1]+forThirdAxis.get2()*point[2];
- }
-
- public void translate(double[] point,double[] out){
- out[0]=forFirstAxis.get0()*point[0] +forFirstAxis.get1()*point[1] +forFirstAxis.get2()*point[2];
- out[1]=forSecondAxis.get0()*point[0]+forSecondAxis.get1()*point[1]+forSecondAxis.get2()*point[2];
- out[2]=forThirdAxis.get0()*point[0] +forThirdAxis.get1()*point[1] +forThirdAxis.get2()*point[2];
- }
-
- public void inverseTranslate(double[] point,double[] out){
- out[0]=forFirstAxis.get0()*point[0]+forSecondAxis.get0()*point[1]+forThirdAxis.get0()*point[2];
- out[1]=forFirstAxis.get1()*point[0]+forSecondAxis.get1()*point[1]+forThirdAxis.get1()*point[2];
- out[2]=forFirstAxis.get2()*point[0]+forSecondAxis.get2()*point[1]+forThirdAxis.get2()*point[2];
- }
-}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/alignment/enumerable/Direction.java b/src/main/java/com/github/technus/tectech/mechanics/alignment/enumerable/Direction.java
deleted file mode 100644
index 56356b3606..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/alignment/enumerable/Direction.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package com.github.technus.tectech.mechanics.alignment.enumerable;
-
-import com.github.technus.tectech.util.Vec3Impl;
-import net.minecraftforge.common.util.ForgeDirection;
-
-@Deprecated
-public enum Direction {
- DOWN(ForgeDirection.DOWN),
- UP(ForgeDirection.UP),
- NORTH(ForgeDirection.NORTH),
- SOUTH(ForgeDirection.SOUTH),
- WEST(ForgeDirection.WEST),
- EAST(ForgeDirection.EAST);
-
- private final ForgeDirection forgeDirection;
- private final Vec3Impl axisVector;
- public static final Direction[] VALUES=values();
-
- Direction(ForgeDirection forgeDirection) {
- this.forgeDirection = forgeDirection;
- axisVector=new Vec3Impl(forgeDirection.offsetX,forgeDirection.offsetY,forgeDirection.offsetZ);
- }
-
- public ForgeDirection getForgeDirection() {
- return forgeDirection;
- }
-
- public Vec3Impl getAxisVector() {
- return axisVector;
- }
-
- public static Vec3Impl getAxisVector(ForgeDirection forgeDirection){
- return VALUES[forgeDirection.ordinal()].axisVector;
- }
-}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/alignment/enumerable/ExtendedFacing.java b/src/main/java/com/github/technus/tectech/mechanics/alignment/enumerable/ExtendedFacing.java
deleted file mode 100644
index 8e384e098c..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/alignment/enumerable/ExtendedFacing.java
+++ /dev/null
@@ -1,359 +0,0 @@
-package com.github.technus.tectech.mechanics.alignment.enumerable;
-
-import com.github.technus.tectech.mechanics.alignment.IAlignment;
-import com.github.technus.tectech.mechanics.alignment.IntegerAxisSwap;
-import com.github.technus.tectech.util.Vec3Impl;
-import net.minecraft.util.Vec3;
-import net.minecraftforge.common.util.ForgeDirection;
-
-import java.util.*;
-
-import static com.github.technus.tectech.mechanics.alignment.IAlignment.FLIPS_COUNT;
-import static com.github.technus.tectech.mechanics.alignment.IAlignment.ROTATIONS_COUNT;
-import static java.lang.Math.abs;
-import static java.util.Arrays.stream;
-import static java.util.stream.Collectors.toMap;
-
-@Deprecated
-public enum ExtendedFacing {
- DOWN_NORMAL_NONE("down normal none"),
- DOWN_NORMAL_HORIZONTAL("down normal horizontal"),
- DOWN_NORMAL_VERTICAL("down normal vertical"),
- DOWN_NORMAL_BOTH("down normal both"),
- DOWN_CLOCKWISE_NONE("down clockwise none"),
- DOWN_CLOCKWISE_HORIZONTAL("down clockwise horizontal"),
- DOWN_CLOCKWISE_VERTICAL("down clockwise vertical"),
- DOWN_CLOCKWISE_BOTH("down clockwise both"),
- DOWN_UPSIDE_DOWN_NONE("down upside down none"),
- DOWN_UPSIDE_DOWN_HORIZONTAL("down upside down horizontal"),
- DOWN_UPSIDE_DOWN_VERTICAL("down upside down vertical"),
- DOWN_UPSIDE_DOWN_BOTH("down upside down both"),
- DOWN_COUNTER_CLOCKWISE_NONE("down counter clockwise none"),
- DOWN_COUNTER_CLOCKWISE_HORIZONTAL("down counter clockwise horizontal"),
- DOWN_COUNTER_CLOCKWISE_VERTICAL("down counter clockwise vertical"),
- DOWN_COUNTER_CLOCKWISE_BOTH("down counter clockwise both"),
- UP_NORMAL_NONE("up normal none"),
- UP_NORMAL_HORIZONTAL("up normal horizontal"),
- UP_NORMAL_VERTICAL("up normal vertical"),
- UP_NORMAL_BOTH("up normal both"),
- UP_CLOCKWISE_NONE("up clockwise none"),
- UP_CLOCKWISE_HORIZONTAL("up clockwise horizontal"),
- UP_CLOCKWISE_VERTICAL("up clockwise vertical"),
- UP_CLOCKWISE_BOTH("up clockwise both"),
- UP_UPSIDE_DOWN_NONE("up upside down none"),
- UP_UPSIDE_DOWN_HORIZONTAL("up upside down horizontal"),
- UP_UPSIDE_DOWN_VERTICAL("up upside down vertical"),
- UP_UPSIDE_DOWN_BOTH("up upside down both"),
- UP_COUNTER_CLOCKWISE_NONE("up counter clockwise none"),
- UP_COUNTER_CLOCKWISE_HORIZONTAL("up counter clockwise horizontal"),
- UP_COUNTER_CLOCKWISE_VERTICAL("up counter clockwise vertical"),
- UP_COUNTER_CLOCKWISE_BOTH("up counter clockwise both"),
- NORTH_NORMAL_NONE("north normal none"),
- NORTH_NORMAL_HORIZONTAL("north normal horizontal"),
- NORTH_NORMAL_VERTICAL("north normal vertical"),
- NORTH_NORMAL_BOTH("north normal both"),
- NORTH_CLOCKWISE_NONE("north clockwise none"),
- NORTH_CLOCKWISE_HORIZONTAL("north clockwise horizontal"),
- NORTH_CLOCKWISE_VERTICAL("north clockwise vertical"),
- NORTH_CLOCKWISE_BOTH("north clockwise both"),
- NORTH_UPSIDE_DOWN_NONE("north upside down none"),
- NORTH_UPSIDE_DOWN_HORIZONTAL("north upside down horizontal"),
- NORTH_UPSIDE_DOWN_VERTICAL("north upside down vertical"),
- NORTH_UPSIDE_DOWN_BOTH("north upside down both"),
- NORTH_COUNTER_CLOCKWISE_NONE("north counter clockwise none"),
- NORTH_COUNTER_CLOCKWISE_HORIZONTAL("north counter clockwise horizontal"),
- NORTH_COUNTER_CLOCKWISE_VERTICAL("north counter clockwise vertical"),
- NORTH_COUNTER_CLOCKWISE_BOTH("north counter clockwise both"),
- SOUTH_NORMAL_NONE("south normal none"),
- SOUTH_NORMAL_HORIZONTAL("south normal horizontal"),
- SOUTH_NORMAL_VERTICAL("south normal vertical"),
- SOUTH_NORMAL_BOTH("south normal both"),
- SOUTH_CLOCKWISE_NONE("south clockwise none"),
- SOUTH_CLOCKWISE_HORIZONTAL("south clockwise horizontal"),
- SOUTH_CLOCKWISE_VERTICAL("south clockwise vertical"),
- SOUTH_CLOCKWISE_BOTH("south clockwise both"),
- SOUTH_UPSIDE_DOWN_NONE("south upside down none"),
- SOUTH_UPSIDE_DOWN_HORIZONTAL("south upside down horizontal"),
- SOUTH_UPSIDE_DOWN_VERTICAL("south upside down vertical"),
- SOUTH_UPSIDE_DOWN_BOTH("south upside down both"),
- SOUTH_COUNTER_CLOCKWISE_NONE("south counter clockwise none"),
- SOUTH_COUNTER_CLOCKWISE_HORIZONTAL("south counter clockwise horizontal"),
- SOUTH_COUNTER_CLOCKWISE_VERTICAL("south counter clockwise vertical"),
- SOUTH_COUNTER_CLOCKWISE_BOTH("south counter clockwise both"),
- WEST_NORMAL_NONE("west normal none"),
- WEST_NORMAL_HORIZONTAL("west normal horizontal"),
- WEST_NORMAL_VERTICAL("west normal vertical"),
- WEST_NORMAL_BOTH("west normal both"),
- WEST_CLOCKWISE_NONE("west clockwise none"),
- WEST_CLOCKWISE_HORIZONTAL("west clockwise horizontal"),
- WEST_CLOCKWISE_VERTICAL("west clockwise vertical"),
- WEST_CLOCKWISE_BOTH("west clockwise both"),
- WEST_UPSIDE_DOWN_NONE("west upside down none"),
- WEST_UPSIDE_DOWN_HORIZONTAL("west upside down horizontal"),
- WEST_UPSIDE_DOWN_VERTICAL("west upside down vertical"),
- WEST_UPSIDE_DOWN_BOTH("west upside down both"),
- WEST_COUNTER_CLOCKWISE_NONE("west counter clockwise none"),
- WEST_COUNTER_CLOCKWISE_HORIZONTAL("west counter clockwise horizontal"),
- WEST_COUNTER_CLOCKWISE_VERTICAL("west counter clockwise vertical"),
- WEST_COUNTER_CLOCKWISE_BOTH("west counter clockwise both"),
- EAST_NORMAL_NONE("east normal none"),
- EAST_NORMAL_HORIZONTAL("east normal horizontal"),
- EAST_NORMAL_VERTICAL("east normal vertical"),
- EAST_NORMAL_BOTH("east normal both"),
- EAST_CLOCKWISE_NONE("east clockwise none"),
- EAST_CLOCKWISE_HORIZONTAL("east clockwise horizontal"),
- EAST_CLOCKWISE_VERTICAL("east clockwise vertical"),
- EAST_CLOCKWISE_BOTH("east clockwise both"),
- EAST_UPSIDE_DOWN_NONE("east upside down none"),
- EAST_UPSIDE_DOWN_HORIZONTAL("east upside down horizontal"),
- EAST_UPSIDE_DOWN_VERTICAL("east upside down vertical"),
- EAST_UPSIDE_DOWN_BOTH("east upside down both"),
- EAST_COUNTER_CLOCKWISE_NONE("east counter clockwise none"),
- EAST_COUNTER_CLOCKWISE_HORIZONTAL("east counter clockwise horizontal"),
- EAST_COUNTER_CLOCKWISE_VERTICAL("east counter clockwise vertical"),
- EAST_COUNTER_CLOCKWISE_BOTH("east counter clockwise both");
-
- public static final ExtendedFacing DEFAULT=NORTH_NORMAL_NONE;
- public static final ExtendedFacing[] VALUES = values();
- public static final Map<ForgeDirection, List<ExtendedFacing>> FOR_FACING=new HashMap<>();
- static {
- stream(values()).forEach(extendedFacing ->
- FOR_FACING.compute(extendedFacing.direction,((forgeDirection, extendedFacings) -> {
- if(extendedFacings==null){
- extendedFacings = new ArrayList<>();
- }
- extendedFacings.add(extendedFacing);
- return extendedFacings;
- })));
- }
- private static final Map<String, ExtendedFacing> NAME_LOOKUP = stream(VALUES).collect(toMap(ExtendedFacing::getName2, (extendedFacing) -> extendedFacing));
-
- private final ForgeDirection direction;
- private final ForgeDirection a,b,c;
- private final Rotation rotation;
- private final Flip flip;
-
- private final String name;
- private final IntegerAxisSwap integerAxisSwap;
-
- ExtendedFacing(String name) {
- this.name = name;
- direction= Direction.VALUES[ordinal()/(Rotation.COUNT*Flip.COUNT)].getForgeDirection();
- rotation=Rotation.VALUES[ordinal()/Flip.COUNT-direction.ordinal()*Rotation.COUNT];
- flip=Flip.VALUES[ordinal()%Flip.COUNT];
- ForgeDirection a,b,c;
- switch (direction){
- case DOWN:
- a= ForgeDirection.WEST;
- b= ForgeDirection.SOUTH;
- c= ForgeDirection.UP;
- break;
- case UP:
- a= ForgeDirection.EAST;
- b= ForgeDirection.SOUTH;
- c= ForgeDirection.DOWN;
- break;
- case NORTH:
- a= ForgeDirection.WEST;
- b= ForgeDirection.DOWN;
- c= ForgeDirection.SOUTH;
- break;
- case SOUTH:
- a= ForgeDirection.EAST;
- b= ForgeDirection.DOWN;
- c= ForgeDirection.NORTH;
- break;
- case WEST:
- a= ForgeDirection.SOUTH;
- b= ForgeDirection.DOWN;
- c= ForgeDirection.EAST;
- break;
- case EAST:
- a= ForgeDirection.NORTH;
- b= ForgeDirection.DOWN;
- c= ForgeDirection.WEST;
- break;
- default:throw new RuntimeException("Is impossible...");
- }
- switch (flip){//This duplicates some axis swaps since flip boolean would do, but seems more convenient to use
- case HORIZONTAL:
- a=a.getOpposite();
- break;
- case BOTH:
- a=a.getOpposite();
- case VERTICAL:
- b=b.getOpposite();
- break;
- case NONE: break;
- default:throw new RuntimeException("Even more impossible...");
- }
- switch (rotation) {
- case CLOCKWISE: {
- ForgeDirection _a=a;
- a =b;
- b =_a.getOpposite();
- break;
- }
- case UPSIDE_DOWN:
- a=a.getOpposite();
- b=b.getOpposite();
- break;
- case COUNTER_CLOCKWISE: {
- ForgeDirection _a=a;
- a =b.getOpposite();
- b =_a;
- break;
- }
- case NORMAL: break;
- default:
- throw new RuntimeException("More impossible...");
- }
- this.a=a;
- this.b=b;
- this.c=c;
- integerAxisSwap =new IntegerAxisSwap(a,b,c);
- }
-
- public static ExtendedFacing of(ForgeDirection direction, Rotation rotation, Flip flip){
- if(direction==ForgeDirection.UNKNOWN){
- return VALUES[IAlignment.getAlignmentIndex(ForgeDirection.NORTH, rotation, flip)];
- }
- return VALUES[IAlignment.getAlignmentIndex(direction, rotation, flip)];
- }
-
- public static ExtendedFacing of(ForgeDirection direction){
- if(direction==ForgeDirection.UNKNOWN){
- return DEFAULT;
- }
- return VALUES[IAlignment.getAlignmentIndex(direction, Rotation.NORMAL, Flip.NONE)];
- }
-
- public ExtendedFacing with(ForgeDirection direction){
- return of(direction,rotation,flip);
- }
-
- public ExtendedFacing with(Rotation rotation){
- return of(direction,rotation,flip);
- }
-
- public ExtendedFacing with(Flip flip){
- return of(direction,rotation,flip);
- }
-
- public ExtendedFacing getOppositeDirection() {
- return of(direction.getOpposite(),rotation,flip);
- }
-
- public ExtendedFacing getOppositeRotation() {
- return of(direction,rotation.getOpposite(),flip);
- }
-
- public ExtendedFacing getOppositeFlip() {
- return of(direction,rotation,flip.getOpposite());
- }
-
- /**
- * Gets the same effective facing achieved by different rot/flip combo
- * @return same effective facing, but different enum value
- */
- public ExtendedFacing getDuplicate(){
- return of(direction,rotation.getOpposite(),flip.getOpposite());
- }
-
- public int getIndex(){
- return ordinal();
- }
-
- public String getName2() {
- return this.name;
- }
-
- public static ExtendedFacing byName(String name) {
- return name == null ? null : NAME_LOOKUP.get(name.toLowerCase(Locale.ROOT));
- }
-
- public static ExtendedFacing byIndex(int index) {
- return VALUES[abs(index % VALUES.length)];
- }
-
- public static ExtendedFacing random(Random rand) {
- return VALUES[rand.nextInt(VALUES.length)];
- }
-
- public ForgeDirection getDirection() {
- return direction;
- }
-
- public Rotation getRotation() {
- return rotation;
- }
-
- public Flip getFlip() {
- return flip;
- }
-
- /**
- * Translates relative to front facing offset to world offset
- * @param abcOffset A,B,C offset (facing relative L-->R,U-->D,F-->B)
- * @return X,Y,Z offset in world
- */
- public Vec3 getWorldOffset(Vec3 abcOffset) {
- return integerAxisSwap.inverseTranslate(abcOffset);
- }
- public Vec3Impl getWorldOffset(Vec3Impl abcOffset) {
- return integerAxisSwap.inverseTranslate(abcOffset);
- }
- public void getWorldOffset(int[] point,int[] out){
- integerAxisSwap.inverseTranslate(point,out);
- }
- public void getWorldOffset(double[] point,double[] out){
- integerAxisSwap.inverseTranslate(point,out);
- }
-
-
- /**
- * Translates world offset to relative front facing offset
- * @param xyzOffset X,Y,Z offset in world
- * @return A,B,C offset (facing relative L-->R,U-->D,F-->B)
- */
- public Vec3 getOffsetABC(Vec3 xyzOffset){
- return integerAxisSwap.translate(xyzOffset);
- }
- public Vec3Impl getOffsetABC(Vec3Impl xyzOffset){
- return integerAxisSwap.translate(xyzOffset);
- }
- public void getOffsetABC(int[] point,int[] out){
- integerAxisSwap.translate(point,out);
- }
- public void getOffsetABC(double[] point,double[] out){
- integerAxisSwap.translate(point,out);
- }
-
- public IntegerAxisSwap getIntegerAxisSwap() {
- return integerAxisSwap;
- }
-
- public ForgeDirection getRelativeLeftInWorld() {
- return a;
- }
-
- public ForgeDirection getRelativeRightInWorld() {
- return a.getOpposite();
- }
-
- public ForgeDirection getRelativeDownInWorld() {
- return b;
- }
-
- public ForgeDirection getRelativeUpInWorld() {
- return b.getOpposite();
- }
-
- public ForgeDirection getRelativeBackInWorld() {
- return c;
- }
-
- public ForgeDirection getRelativeForwardInWorld() {
- return c.getOpposite();
- }
-}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/alignment/enumerable/Flip.java b/src/main/java/com/github/technus/tectech/mechanics/alignment/enumerable/Flip.java
deleted file mode 100644
index 400f94f869..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/alignment/enumerable/Flip.java
+++ /dev/null
@@ -1,78 +0,0 @@
-package com.github.technus.tectech.mechanics.alignment.enumerable;
-
-import javax.annotation.Nonnull;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Random;
-
-import static java.lang.Math.abs;
-import static java.util.Arrays.stream;
-import static java.util.stream.Collectors.toMap;
-
-@Deprecated
-public enum Flip {
- NONE(3, "none"),
- HORIZONTAL(2, "horizontal"),
- VERTICAL(1, "vertical"),
- BOTH(0, "both");
-
- private final int opposite;
- private final String name;
-
- public static final Flip[] VALUES = values();
- public static final int COUNT = VALUES.length;
- private static final Map<String, Flip> NAME_LOOKUP = stream(VALUES).collect(toMap(Flip::getName2, (flip) -> flip));
-
- Flip(int oppositeIn, String nameIn) {
- this.opposite = oppositeIn;
- this.name = nameIn;
- }
-
- public int getIndex(){
- return ordinal();
- }
-
- public Flip getOpposite() {
- return VALUES[opposite];
- }
-
- public String getName2() {
- return this.name;
- }
-
- public static Flip byName(String name) {
- return name == null ? null : NAME_LOOKUP.get(name.toLowerCase(Locale.ROOT));
- }
-
- public static Flip byIndex(int index) {
- return VALUES[abs(index % VALUES.length)];
- }
-
- public static Flip random(@Nonnull Random rand) {
- return VALUES[rand.nextInt(VALUES.length)];
- }
-
- public String toString() {
- return this.name;
- }
-
- public String getName() {
- return this.name;
- }
-
- public boolean isNotFlipped(){
- return this==NONE;
- }
-
- public boolean isBothFlipped(){
- return this==BOTH;
- }
-
- public boolean isHorizontallyFlipped() {
- return this==HORIZONTAL || isBothFlipped();
- }
-
- public boolean isVerticallyFliped() {
- return this==VERTICAL || isBothFlipped();
- }
-}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/alignment/enumerable/Rotation.java b/src/main/java/com/github/technus/tectech/mechanics/alignment/enumerable/Rotation.java
deleted file mode 100644
index ed4872828a..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/alignment/enumerable/Rotation.java
+++ /dev/null
@@ -1,78 +0,0 @@
-package com.github.technus.tectech.mechanics.alignment.enumerable;
-
-import javax.annotation.Nonnull;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Random;
-
-import static java.lang.Math.abs;
-import static java.util.Arrays.stream;
-import static java.util.stream.Collectors.toMap;
-
-@Deprecated
-public enum Rotation {
- NORMAL(2, "normal"),
- CLOCKWISE(3, "clockwise"),
- UPSIDE_DOWN(0, "upside down"),
- COUNTER_CLOCKWISE(1, "counter clockwise");
-
- private final int opposite;
- private final String name;
-
- public static final Rotation[] VALUES = values();
- public static final int COUNT = VALUES.length;
- private static final Map<String, Rotation> NAME_LOOKUP = stream(VALUES).collect(toMap(Rotation::getName2, (rotation) -> rotation));
-
- Rotation(int oppositeIn, String nameIn) {
- this.opposite = oppositeIn;
- this.name = nameIn;
- }
-
- public int getIndex(){
- return ordinal();
- }
-
- public Rotation getOpposite() {
- return VALUES[opposite];
- }
-
- public String getName2() {
- return this.name;
- }
-
- public static Rotation byName(String name) {
- return name == null ? null : NAME_LOOKUP.get(name.toLowerCase(Locale.ROOT));
- }
-
- public static Rotation byIndex(int index) {
- return VALUES[abs(index % VALUES.length)];
- }
-
- public static Rotation random(@Nonnull Random rand) {
- return VALUES[rand.nextInt(VALUES.length)];
- }
-
- public String toString() {
- return this.name;
- }
-
- public String getName() {
- return this.name;
- }
-
- public boolean isNotRotated(){
- return this==NORMAL;
- }
-
- public boolean isClockwise(){
- return this==CLOCKWISE;
- }
-
- public boolean isCounterClockwise(){
- return this==COUNTER_CLOCKWISE;
- }
-
- public boolean isUpsideDown(){
- return this==UPSIDE_DOWN;
- }
-}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/constructable/ConstructableUtility.java b/src/main/java/com/github/technus/tectech/mechanics/constructable/ConstructableUtility.java
deleted file mode 100644
index 6d605eef6e..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/constructable/ConstructableUtility.java
+++ /dev/null
@@ -1,115 +0,0 @@
-package com.github.technus.tectech.mechanics.constructable;
-
-import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.mechanics.alignment.IAlignment;
-import com.github.technus.tectech.mechanics.alignment.enumerable.ExtendedFacing;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.EntityPlayerMP;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.World;
-import net.minecraftforge.common.util.FakePlayer;
-import net.minecraftforge.common.util.ForgeDirection;
-
-@Deprecated
-public class ConstructableUtility {
- private ConstructableUtility(){
-
- }
-
- public static boolean handle(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if(tTileEntity==null || aPlayer instanceof FakePlayer) {
- return aPlayer instanceof EntityPlayerMP;
- }
- if (aPlayer instanceof EntityPlayerMP) {
- //struct gen
- if (aPlayer.isSneaking() && aPlayer.capabilities.isCreativeMode) {
- if (tTileEntity instanceof IGregTechTileEntity) {
- IMetaTileEntity metaTE = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity();
- if (metaTE instanceof IConstructable) {
- ((IConstructable) metaTE).construct(aStack, false);
- } else if (IMultiblockInfoContainer.contains(metaTE.getClass())) {
- IMultiblockInfoContainer<IMetaTileEntity> iMultiblockInfoContainer =IMultiblockInfoContainer.get(metaTE.getClass());
- if(metaTE instanceof IAlignment){
- iMultiblockInfoContainer.construct(aStack, false, metaTE, (
- (IAlignment) metaTE).getExtendedFacing());
- }else {
- iMultiblockInfoContainer.construct(aStack, false, metaTE,
- ExtendedFacing.of(ForgeDirection.getOrientation(((IGregTechTileEntity) tTileEntity).getFrontFacing())));
- }
- }
- } else if (tTileEntity instanceof IConstructable) {
- ((IConstructable) tTileEntity).construct(aStack, false);
- } else if (IMultiblockInfoContainer.contains(tTileEntity.getClass())) {
- IMultiblockInfoContainer<TileEntity> iMultiblockInfoContainer =IMultiblockInfoContainer.get(tTileEntity.getClass());
- if(tTileEntity instanceof IAlignment){
- iMultiblockInfoContainer.construct(aStack, false, tTileEntity,
- ((IAlignment) tTileEntity).getExtendedFacing());
- }else {
- iMultiblockInfoContainer.construct(aStack, false, tTileEntity,
- ExtendedFacing.of(ForgeDirection.getOrientation(aSide)));
- }
- }
- }
- return true;
- }else if (TecTech.proxy.isThePlayer(aPlayer)){//particles and text client side
- //if ((!aPlayer.isSneaking() || !aPlayer.capabilities.isCreativeMode)) {
- if(tTileEntity instanceof IGregTechTileEntity) {
- IMetaTileEntity metaTE = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity();
- if (metaTE instanceof IConstructable) {
- ((IConstructable) metaTE).construct(aStack, true);
- TecTech.proxy.printInchat(((IConstructable) metaTE).getStructureDescription(aStack));
- return false;
- } else if(IMultiblockInfoContainer.contains(metaTE.getClass())){
- IMultiblockInfoContainer<IMetaTileEntity> iMultiblockInfoContainer =IMultiblockInfoContainer.get(metaTE.getClass());
- if(metaTE instanceof IAlignment){
- iMultiblockInfoContainer.construct(aStack, true, metaTE,
- ((IAlignment) metaTE).getExtendedFacing());
- }else {
- iMultiblockInfoContainer.construct(aStack, true, metaTE,
- ExtendedFacing.of(ForgeDirection.getOrientation(((IGregTechTileEntity) tTileEntity).getFrontFacing())));
- }
- TecTech.proxy.printInchat(IMultiblockInfoContainer.get(metaTE.getClass()).getDescription(aStack));
- return false;
- }
- } else if(tTileEntity instanceof IConstructable){
- ((IConstructable) tTileEntity).construct(aStack,true);
- TecTech.proxy.printInchat(((IConstructable) tTileEntity).getStructureDescription(aStack));
- return false;
- } else if(IMultiblockInfoContainer.contains(tTileEntity.getClass())){
- IMultiblockInfoContainer<TileEntity> iMultiblockInfoContainer = IMultiblockInfoContainer.get(tTileEntity.getClass());
- if(tTileEntity instanceof IAlignment){
- iMultiblockInfoContainer.construct(aStack, true, tTileEntity,
- ((IAlignment) tTileEntity).getExtendedFacing());
- }else {
- iMultiblockInfoContainer.construct(aStack, true, tTileEntity,
- ExtendedFacing.of(ForgeDirection.getOrientation(aSide)));
- }
- TecTech.proxy.printInchat(IMultiblockInfoContainer.get(tTileEntity.getClass()).getDescription(aStack));
- return false;
- }
- //} else {
- // if(tTileEntity instanceof IGregTechTileEntity) {
- // IMetaTileEntity metaTE = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity();
- // if (metaTE instanceof IConstructable) {
- // TecTech.proxy.printInchat(((IConstructable) metaTE).getStructureDescription(aStack.stackSize));
- // return false;
- // } else if(multiblockMap.containsKey(metaTE.getClass().getCanonicalName())){
- // TecTech.proxy.printInchat(multiblockMap.get(metaTE.getClass().getCanonicalName()).getDescription(aStack.stackSize));
- // return false;
- // }
- // } else if(tTileEntity instanceof IConstructable){
- // TecTech.proxy.printInchat(((IConstructable) tTileEntity).getStructureDescription(aStack.stackSize));
- // return false;
- // } else if(multiblockMap.containsKey(tTileEntity.getClass().getCanonicalName())){
- // TecTech.proxy.printInchat(multiblockMap.get(tTileEntity.getClass().getCanonicalName()).getDescription(aStack.stackSize));
- // return false;
- // }
- //}
- }
- return false;
- }
-}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/constructable/IConstructable.java b/src/main/java/com/github/technus/tectech/mechanics/constructable/IConstructable.java
deleted file mode 100644
index ed0cdfbf7d..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/constructable/IConstructable.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.github.technus.tectech.mechanics.constructable;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import net.minecraft.item.ItemStack;
-
-/**
- * Created by Tec on 24.03.2017.
- */
-@Deprecated
-public interface IConstructable {
- void construct(ItemStack stackSize, boolean hintsOnly);
-
- @SideOnly(Side.CLIENT)
- String[] getStructureDescription(ItemStack stackSize);
-}
-
diff --git a/src/main/java/com/github/technus/tectech/mechanics/constructable/IMultiblockInfoContainer.java b/src/main/java/com/github/technus/tectech/mechanics/constructable/IMultiblockInfoContainer.java
deleted file mode 100644
index da124fcf4d..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/constructable/IMultiblockInfoContainer.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package com.github.technus.tectech.mechanics.constructable;
-
-import com.github.technus.tectech.mechanics.alignment.enumerable.ExtendedFacing;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-
-import java.util.HashMap;
-
-/**
- * To implement IConstructable on not own TileEntities
- */
-@Deprecated
-public interface IMultiblockInfoContainer<T> {
- HashMap<String, IMultiblockInfoContainer<?>> MULTIBLOCK_MAP = new HashMap<>();
-
- static <T extends TileEntity> void registerTileClass(Class<T> clazz, IMultiblockInfoContainer<?> info){
- MULTIBLOCK_MAP.put(clazz.getCanonicalName(),info);
- }
-
- static <T extends IMetaTileEntity> void registerMetaClass(Class<T> clazz, IMultiblockInfoContainer<?> info){
- MULTIBLOCK_MAP.put(clazz.getCanonicalName(),info);
- }
-
- @SuppressWarnings("unchecked")
- static <T> IMultiblockInfoContainer<T> get(Class<?> tClass){
- return (IMultiblockInfoContainer<T>)MULTIBLOCK_MAP.get(tClass.getCanonicalName());
- }
-
- static boolean contains(Class<?> tClass){
- return MULTIBLOCK_MAP.containsKey(tClass.getCanonicalName());
- }
-
- void construct(ItemStack stackSize, boolean hintsOnly, T tileEntity, ExtendedFacing aSide);
-
- @SideOnly(Side.CLIENT)
- String[] getDescription(ItemStack stackSize);
-}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/IBlockPosConsumer.java b/src/main/java/com/github/technus/tectech/mechanics/structure/IBlockPosConsumer.java
deleted file mode 100644
index d37e29c36a..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/structure/IBlockPosConsumer.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package com.github.technus.tectech.mechanics.structure;
-
-import net.minecraft.world.World;
-
-@Deprecated
-public interface IBlockPosConsumer {
- void consume(World world, int x, int y, int z);
-}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/ICustomBlockSetting.java b/src/main/java/com/github/technus/tectech/mechanics/structure/ICustomBlockSetting.java
deleted file mode 100644
index 10d9dcca73..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/structure/ICustomBlockSetting.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package com.github.technus.tectech.mechanics.structure;
-
-import net.minecraft.block.Block;
-import net.minecraft.world.World;
-
-@Deprecated
-public interface ICustomBlockSetting {
- /**
- * Default block setting calls {@link World#setBlock(int x, int y, int z, Block block, int meta, int updateType)} like:
- * {@code world.setBlock(x,y,z,this/block,meta,2)} where updateType 2 means to update lighting and stuff
- * @param world world that should be affected
- * @param x x position to set
- * @param y y position to set
- * @param z z position to set
- * @param meta required meta
- */
- void setBlock(World world, int x, int y, int z, int meta);
-}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureDefinition.java b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureDefinition.java
deleted file mode 100644
index cb40214eac..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureDefinition.java
+++ /dev/null
@@ -1,168 +0,0 @@
-package com.github.technus.tectech.mechanics.structure;
-
-import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.mechanics.alignment.enumerable.ExtendedFacing;
-import net.minecraft.item.ItemStack;
-import net.minecraft.world.World;
-
-import java.util.Arrays;
-
-import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE;
-
-@Deprecated
-public interface IStructureDefinition<T> {
- /**
- * Used internally
- * @param name same name as for other methods here
- * @return the array of elements to process
- */
- IStructureElement<T>[] getStructureFor(String name);
-
- default boolean check(T object,String piece, World world, ExtendedFacing extendedFacing,
- int basePositionX, int basePositionY, int basePositionZ,
- int basePositionA, int basePositionB, int basePositionC,
- boolean forceCheckAllBlocks){
- return iterate(object, null, getStructureFor(piece), world, extendedFacing, basePositionX, basePositionY, basePositionZ,
- basePositionA, basePositionB, basePositionC,false,forceCheckAllBlocks);
- }
-
- default boolean hints(T object, ItemStack trigger,String piece, World world, ExtendedFacing extendedFacing,
- int basePositionX, int basePositionY, int basePositionZ,
- int basePositionA, int basePositionB, int basePositionC) {
- return iterate(object, trigger, getStructureFor(piece), world, extendedFacing, basePositionX, basePositionY, basePositionZ,
- basePositionA, basePositionB, basePositionC,true,null);
- }
-
- default boolean build(T object, ItemStack trigger,String piece, World world, ExtendedFacing extendedFacing,
- int basePositionX, int basePositionY, int basePositionZ,
- int basePositionA, int basePositionB, int basePositionC) {
- return iterate(object, trigger, getStructureFor(piece), world, extendedFacing, basePositionX, basePositionY, basePositionZ,
- basePositionA, basePositionB, basePositionC,false,null);
- }
-
- default boolean buildOrHints(T object, ItemStack trigger,String piece, World world, ExtendedFacing extendedFacing,
- int basePositionX, int basePositionY, int basePositionZ,
- int basePositionA, int basePositionB, int basePositionC,
- boolean hintsOnly){
- return iterate(object, trigger, getStructureFor(piece), world, extendedFacing, basePositionX, basePositionY, basePositionZ,
- basePositionA, basePositionB, basePositionC,hintsOnly,null);
- }
-
- static <T> boolean iterate(T object, ItemStack trigger, IStructureElement<T>[] elements, World world, ExtendedFacing extendedFacing,
- int basePositionX, int basePositionY, int basePositionZ,
- int basePositionA, int basePositionB, int basePositionC,
- boolean hintsOnly, Boolean checkBlocksIfNotNullForceCheckAllIfTrue){
- if(world.isRemote ^ hintsOnly){
- return false;
- }
-
- //change base position to base offset
- basePositionA=-basePositionA;
- basePositionB=-basePositionB;
- basePositionC=-basePositionC;
-
- int[] abc = new int[]{basePositionA,basePositionB,basePositionC};
- int[] xyz = new int[3];
-
- if(checkBlocksIfNotNullForceCheckAllIfTrue!=null){
- if(checkBlocksIfNotNullForceCheckAllIfTrue){
- for (IStructureElement<T> element : elements) {
- if(element.isNavigating()) {
- abc[0] = (element.resetA() ? basePositionA : abc[0]) + element.getStepA();
- abc[1] = (element.resetB() ? basePositionB : abc[1]) + element.getStepB();
- abc[2] = (element.resetC() ? basePositionC : abc[2]) + element.getStepC();
- }else {
- extendedFacing.getWorldOffset(abc, xyz);
- xyz[0] += basePositionX;
- xyz[1] += basePositionY;
- xyz[2] += basePositionZ;
-
- if (world.blockExists(xyz[0], xyz[1], xyz[2])) {
- if(!element.check(object, world, xyz[0], xyz[1], xyz[2])){
- if(DEBUG_MODE){
- TecTech.LOGGER.info("Multi ["+basePositionX+", "+basePositionY+", "+basePositionZ+"] failed @ "+
- Arrays.toString(xyz)+" "+Arrays.toString(abc));
- }
- return false;
- }
- } else {
- if(DEBUG_MODE){
- TecTech.LOGGER.info("Multi ["+basePositionX+", "+basePositionY+", "+basePositionZ+"] !blockExists @ "+
- Arrays.toString(xyz)+" "+Arrays.toString(abc));
- }
- return false;
- }
- abc[0]+=1;
- }
- }
- } else {
- for (IStructureElement<T> element : elements) {
- if(element.isNavigating()) {
- abc[0] = (element.resetA() ? basePositionA : abc[0]) + element.getStepA();
- abc[1] = (element.resetB() ? basePositionB : abc[1]) + element.getStepB();
- abc[2] = (element.resetC() ? basePositionC : abc[2]) + element.getStepC();
- }else {
- extendedFacing.getWorldOffset(abc, xyz);
- xyz[0] += basePositionX;
- xyz[1] += basePositionY;
- xyz[2] += basePositionZ;
-
- if (world.blockExists(xyz[0], xyz[1], xyz[2])) {
- if(!element.check(object, world, xyz[0], xyz[1], xyz[2])){
- if(DEBUG_MODE){
- TecTech.LOGGER.info("Multi ["+basePositionX+", "+basePositionY+", "+basePositionZ+"] failed @ "+
- Arrays.toString(xyz)+" "+Arrays.toString(abc));
- }
- return false;
- }
- } else {
- if(DEBUG_MODE){
- TecTech.LOGGER.info("Multi ["+basePositionX+", "+basePositionY+", "+basePositionZ+"] !blockExists @ "+
- Arrays.toString(xyz)+" "+Arrays.toString(abc));
- }
- }
- abc[0]+=1;
- }
- }
- }
- }else {
- if(hintsOnly) {
- for (IStructureElement<T> element : elements) {
- if(element.isNavigating()) {
- abc[0] = (element.resetA() ? basePositionA : abc[0]) + element.getStepA();
- abc[1] = (element.resetB() ? basePositionB : abc[1]) + element.getStepB();
- abc[2] = (element.resetC() ? basePositionC : abc[2]) + element.getStepC();
- }else {
- extendedFacing.getWorldOffset(abc, xyz);
- xyz[0] += basePositionX;
- xyz[1] += basePositionY;
- xyz[2] += basePositionZ;
-
- element.spawnHint(object, world, xyz[0], xyz[1], xyz[2], trigger);
-
- abc[0]+=1;
- }
- }
- } else {
- for (IStructureElement<T> element : elements) {
- if(element.isNavigating()) {
- abc[0] = (element.resetA() ? basePositionA : abc[0]) + element.getStepA();
- abc[1] = (element.resetB() ? basePositionB : abc[1]) + element.getStepB();
- abc[2] = (element.resetC() ? basePositionC : abc[2]) + element.getStepC();
- }else {
- extendedFacing.getWorldOffset(abc, xyz);
- xyz[0] += basePositionX;
- xyz[1] += basePositionY;
- xyz[2] += basePositionZ;
-
- if (world.blockExists(xyz[0], xyz[1], xyz[2])) {
- element.placeBlock(object, world, xyz[0], xyz[1], xyz[2], trigger);
- }
- abc[0]+=1;
- }
- }
- }
- }
- return true;
- }
-}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElement.java b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElement.java
deleted file mode 100644
index ac5f4f7296..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElement.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package com.github.technus.tectech.mechanics.structure;
-
-import net.minecraft.item.ItemStack;
-import net.minecraft.world.World;
-
-/**
- * Use StructureUtility to instantiate
- */
-@Deprecated
-public interface IStructureElement<T> {
- boolean check(T t,World world,int x,int y,int z);
-
- boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger);
-
- boolean placeBlock(T t,World world,int x,int y,int z, ItemStack trigger);
-
- default int getStepA(){
- return 1;
- }
-
- default int getStepB(){
- return 0;
- }
-
- default int getStepC(){
- return 0;
- }
-
- default boolean resetA(){
- return false;
- }
-
- default boolean resetB(){
- return false;
- }
-
- default boolean resetC(){
- return false;
- }
-
- default boolean isNavigating(){
- return false;
- }
-}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementChain.java b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementChain.java
deleted file mode 100644
index 2051e06c4d..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementChain.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package com.github.technus.tectech.mechanics.structure;
-
-import net.minecraft.item.ItemStack;
-import net.minecraft.world.World;
-
-/**
- * Use StructureUtility to instantiate
- */
-@Deprecated
-public interface IStructureElementChain<T> extends IStructureElement<T> {
- IStructureElement<T>[] fallbacks();
-
- @Override
- default boolean check(T t, World world, int x, int y, int z){
- for (IStructureElement<T> fallback : fallbacks()) {
- if (fallback.check(t, world, x, y, z)) {
- return true;
- }
- }
- return false;
- }
-
- @Override
- default boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- for (IStructureElement<T> fallback : fallbacks()) {
- if (fallback.spawnHint(t, world, x, y, z, trigger)) {
- return true;
- }
- }
- return false;
- }
-
- @Override
- default boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- for (IStructureElement<T> fallback : fallbacks()) {
- if (fallback.placeBlock(t, world, x, y, z, trigger)) {
- return true;
- }
- }
- return false;
- }
-}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementCheckOnly.java b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementCheckOnly.java
deleted file mode 100644
index a866da828d..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementCheckOnly.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.github.technus.tectech.mechanics.structure;
-
-import net.minecraft.item.ItemStack;
-import net.minecraft.world.World;
-
-@Deprecated
-public interface IStructureElementCheckOnly<T> extends IStructureElement<T> {
- @Override
- default boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger){
- return false;
- }
-
- @Override
- default boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger){
- return false;
- }
-}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementDeferred.java b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementDeferred.java
deleted file mode 100644
index e1714e520c..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementDeferred.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package com.github.technus.tectech.mechanics.structure;
-
-/**
- * Use StructureUtility to instantiate
- */
-@Deprecated
-public interface IStructureElementDeferred<T> extends IStructureElement<T> {
-}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementNoPlacement.java b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementNoPlacement.java
deleted file mode 100644
index 1ba5dc30f5..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementNoPlacement.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package com.github.technus.tectech.mechanics.structure;
-
-import net.minecraft.item.ItemStack;
-import net.minecraft.world.World;
-
-@Deprecated
-public interface IStructureElementNoPlacement<T> extends IStructureElement<T> {
- @Override
- default boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger){
- return false;
- }
-}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureNavigate.java b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureNavigate.java
deleted file mode 100644
index 5e73f25640..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureNavigate.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package com.github.technus.tectech.mechanics.structure;
-
-import net.minecraft.item.ItemStack;
-import net.minecraft.world.World;
-
-/**
- * Use StructureUtility to instantiate
- */
-@Deprecated
-interface IStructureNavigate<T> extends IStructureElement<T> {
- @Override
- default boolean check(T t, World world, int x, int y, int z){
- return true;
- }
-
- @Override
- default boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- return true;
- }
-
- @Override
- default boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- return true;
- }
-
- default boolean isNavigating(){
- return true;
- }
-}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/Structure.java b/src/main/java/com/github/technus/tectech/mechanics/structure/Structure.java
deleted file mode 100644
index b37ae0bbda..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/structure/Structure.java
+++ /dev/null
@@ -1,263 +0,0 @@
-package com.github.technus.tectech.mechanics.structure;
-
-import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.mechanics.structure.adders.IHatchAdder;
-import com.github.technus.tectech.thing.casing.TT_Container_Casings;
-import com.gtnewhorizon.structurelib.alignment.enumerable.ExtendedFacing;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.util.IGT_HatchAdder;
-import net.minecraft.block.Block;
-import net.minecraft.block.material.Material;
-import net.minecraft.init.Blocks;
-import net.minecraft.world.World;
-import net.minecraftforge.common.util.ForgeDirection;
-
-import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE;
-
-@Deprecated
-public class Structure {
- private Structure() {
- }
-
- @Deprecated
- @SafeVarargs
- public static <T> IHatchAdder<T>[] adders(IHatchAdder<T>... iHatchAdder) {
- return iHatchAdder;
- }
-
- //Check Machine Structure based on string[][] (effectively char[][][]), ond offset of the controller
- //This only checks for REGULAR BLOCKS!
- @Deprecated
- public static <T extends IMetaTileEntity> boolean checker(
- String[][] structure,//0-9 casing, +- air no air, A... ignore 'A'-CHAR-1 blocks
- Block[] blockType,//use numbers 0-9 for casing types
- byte[] blockMeta,//use numbers 0-9 for casing types
- IGT_HatchAdder<T>[] addingMethods,
- short[] casingTextures,
- Block[] blockTypeFallback,//use numbers 0-9 for casing types
- byte[] blockMetaFallback,//use numbers 0-9 for casing types
- int horizontalOffset, int verticalOffset, int depthOffset,
- T metaTile,
- ExtendedFacing extendedFacing,
- boolean forceCheck) {
- IGregTechTileEntity aBaseMetaTileEntity = metaTile.getBaseMetaTileEntity();
- World world = aBaseMetaTileEntity.getWorld();
- if (world.isRemote) {
- return false;
- }
- //TE Rotation
- if (extendedFacing == null) {
- extendedFacing = ExtendedFacing.of(ForgeDirection.getOrientation(aBaseMetaTileEntity.getFrontFacing()));
- }
-
- IGregTechTileEntity igt;
-
- int[] xyz = new int[3];
- int[] abc = new int[3];
- int pointer;
- int baseX = aBaseMetaTileEntity.getXCoord(),
- baseZ = aBaseMetaTileEntity.getZCoord(),
- baseY = aBaseMetaTileEntity.getYCoord();
- //a,b,c - relative to block face!
- //x,y,z - relative to block position on map!
- //yPos - absolute height of checked block
-
- //perform your duties
- abc[2] = -depthOffset;
- for (String[] _structure : structure) {//front to back
- abc[1] = -verticalOffset;
- for (String __structure : _structure) {//top to bottom
- abc[0] = -horizontalOffset;
- for (char block : __structure.toCharArray()) {//left to right
- if (block < ' ') {
- //Control chars allow skipping
- abc[1] += block;
- break;
- } else if (block > '@') {
- //characters allow to skip check A-1 skip, B-2 skips etc.
- abc[0] += block - '@';
- }//else if (block < '+')//used to mark THINGS
- // a++;
- else if (block == '.') {
- abc[0]++;
- } else {
- //get x y z from rotation
- extendedFacing.getWorldOffset(abc, xyz);
- xyz[0] += baseX;
- xyz[1] += baseY;
- xyz[2] += baseZ;
-
- //that must be here since in some cases other axis (b,c) controls y
- if (xyz[1] < 0 || xyz[1] >= 256) {
- return false;
- }
-
- //Check block
- if (world.blockExists(xyz[0], xyz[1], xyz[2])) {//this actually checks if the chunk is loaded at this pos
- switch (block) {
- case '-'://must be air
- if (world.getBlock(xyz[0], xyz[1], xyz[2]).getMaterial() != Material.air) {
- return false;
- }
- break;
- case '+'://must not be air
- if (world.getBlock(xyz[0], xyz[1], xyz[2]).getMaterial() == Material.air) {
- return false;
- }
- break;
- default://check for block (countable)
- Block worldblock = world.getBlock(xyz[0], xyz[1], xyz[2]);
- int dmg = worldblock.getDamageValue(world, xyz[0], xyz[1], xyz[2]);
- if ((pointer = block - '0') >= 0) {
- //countable air -> net.minecraft.block.BlockAir
- if (worldblock != blockType[pointer]) {
- if (DEBUG_MODE) {
- TecTech.LOGGER.info("Struct-block-error " + xyz[0] + ' ' + xyz[1] + ' ' + xyz[2] + " / " + abc[0] + ' ' + abc[1] + ' ' + abc[2] + " / " + worldblock.getUnlocalizedName() + ' ' + blockType[pointer].getUnlocalizedName());
- }
- return false;
- }
- if (dmg != blockMeta[pointer]) {
- if (DEBUG_MODE) {
- TecTech.LOGGER.info("Struct-meta-id-error " + xyz[0] + ' ' + xyz[1] + ' ' + xyz[2] + " / " + abc[0] + ' ' + abc[1] + ' ' + abc[2] + " / " + dmg + ' ' + blockMeta[pointer]);
- }
- return false;
- }
- } else if ((pointer = block - ' ') >= 0) {
- igt = aBaseMetaTileEntity.getIGregTechTileEntity(xyz[0], xyz[1], xyz[2]);
- if (igt == null || !addingMethods[pointer].apply(metaTile, igt, casingTextures[pointer])) {
- if (worldblock != blockTypeFallback[pointer]) {
- if (DEBUG_MODE) {
- TecTech.LOGGER.info("Fallback-struct-block-error " + xyz[0] + ' ' + xyz[1] + ' ' + xyz[2] + " / " + abc[0] + ' ' + abc[1] + ' ' + abc[2] + " / " + worldblock.getUnlocalizedName() + ' ' + (blockTypeFallback[pointer] == null ? "null" : blockTypeFallback[pointer].getUnlocalizedName()));
- }
- return false;
- }
- if (dmg != blockMetaFallback[pointer]) {
- if (DEBUG_MODE) {
- TecTech.LOGGER.info("Fallback-Struct-meta-id-error " + xyz[0] + ' ' + xyz[1] + ' ' + xyz[2] + " / " + abc[0] + ' ' + abc[1] + ' ' + abc[2] + " / " + dmg + ' ' + blockMetaFallback[pointer]);
- }
- return false;
- }
- }
- }
- }
- } else if (forceCheck) {
- return false;
- }
- abc[0]++;//block in horizontal layer
- }
- }
- abc[1]++;//horizontal layer
- }
- abc[2]++;//depth
- }
- return true;
- }
-
- @Deprecated
- public static boolean builder(String[][] structure,//0-9 casing, +- air no air, A... ignore 'A'-CHAR+1 blocks
- Block[] blockType,//use numbers 0-9 for casing types
- byte[] blockMeta,//use numbers 0-9 for casing types
- int horizontalOffset, int verticalOffset, int depthOffset,
- IGregTechTileEntity tileEntity, ExtendedFacing extendedFacing, boolean hintsOnly) {
- World world = tileEntity.getWorld();
- int baseX = tileEntity.getXCoord();
- int baseY = tileEntity.getYCoord();
- int baseZ = tileEntity.getZCoord();
- if (world == null || (!world.isRemote && hintsOnly)) {
- return false;
- }
-
- //TE Rotation
- int[] xyz = new int[3];
- int[] abc = new int[3];
- int pointer;
-
- //a,b,c - relative to block face!
- //x,y,z - relative to block position on map!
-
- //perform your duties
- abc[2] = -depthOffset;
- for (String[] _structure : structure) {//front to back
- abc[1] = -verticalOffset;
- for (String __structure : _structure) {//top to bottom
- abc[0] = -horizontalOffset;
- for (char block : __structure.toCharArray()) {//left to right
- if (block < ' ') {//Control chars allow skipping
- abc[1] += block;
- break;
- }
- if (block > '@')//characters allow to skip check a-1 skip, b-2 skips etc.
- {
- abc[0] += block - '@';
- }//else if (block < '+')//used to mark THINGS
- // a++;
- else if (block == '.')// this TE
- {
- abc[0]++;
- } else {
- //get x y z from rotation
- extendedFacing.getWorldOffset(abc, xyz);
- xyz[0] += baseX;
- xyz[1] += baseY;
- xyz[2] += baseZ;
-
- //that must be here since in some cases other axis (b,c) controls y
- if (xyz[1] < 0 || xyz[1] >= 256) {
- return false;
- }
-
- //Check block
- if (world.blockExists(xyz[0], xyz[1], xyz[2])) {//this actually checks if the chunk is loaded
- if (hintsOnly) {
- switch (block) {
- case '-'://must be air
- TecTech.proxy.hint_particle(world, xyz[0], xyz[1], xyz[2], TT_Container_Casings.sHintCasingsTT, 13);
- break;
- case '+'://must not be air
- TecTech.proxy.hint_particle(world, xyz[0], xyz[1], xyz[2], TT_Container_Casings.sHintCasingsTT, 14);
- break;
- default: //check for block
- if ((pointer = block - '0') >= 0) {
- if (world.getBlock(xyz[0], xyz[1], xyz[2]) != blockType[pointer] || blockType[pointer].getDamageValue(world, xyz[0], xyz[1], xyz[2]) != blockMeta[pointer]) {
- TecTech.proxy.hint_particle(world, xyz[0], xyz[1], xyz[2], blockType[pointer], blockMeta[pointer]);
- }
- } else if ((pointer = block - ' ') >= 0) {
- if (pointer < 12) {
- TecTech.proxy.hint_particle(world, xyz[0], xyz[1], xyz[2], TT_Container_Casings.sHintCasingsTT, pointer);
- } else {
- TecTech.proxy.hint_particle(world, xyz[0], xyz[1], xyz[2], TT_Container_Casings.sHintCasingsTT, 12);
- }
- } else {
- TecTech.proxy.hint_particle(world, xyz[0], xyz[1], xyz[2], TT_Container_Casings.sHintCasingsTT, 15);
- }
- }
- } else {
- switch (block) {
- case '-'://must be air
- world.setBlock(xyz[0], xyz[1], xyz[2], Blocks.air, 0, 2);
- break;
- case '+'://must not be air
- world.setBlock(xyz[0], xyz[1], xyz[2], TT_Container_Casings.sBlockCasingsTT, 14, 2);
- break;
- default: //check for block
- if ((pointer = block - '0') >= 0) {
- if (blockType[pointer] instanceof ICustomBlockSetting) {
- ((ICustomBlockSetting) blockType[pointer]).setBlock(world, xyz[0], xyz[1], xyz[2], blockMeta[pointer]);
- } else {
- world.setBlock(xyz[0], xyz[1], xyz[2], blockType[pointer], blockMeta[pointer], 2);
- }
- }
- }
- }
- }
- abc[0]++;//block in horizontal layer
- }
- }
- abc[1]++;//horizontal layer
- }
- abc[2]++;//depth
- }
- return true;
- }
-}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/StructureDefinition.java b/src/main/java/com/github/technus/tectech/mechanics/structure/StructureDefinition.java
deleted file mode 100644
index ca1dbce77b..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/structure/StructureDefinition.java
+++ /dev/null
@@ -1,289 +0,0 @@
-package com.github.technus.tectech.mechanics.structure;
-
-import com.github.technus.tectech.util.Vec3Impl;
-
-import java.util.*;
-
-import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE;
-import static com.github.technus.tectech.mechanics.structure.StructureUtility.*;
-
-@Deprecated
-public class StructureDefinition<T> implements IStructureDefinition<T> {
- private final Map<Character, IStructureElement<T>> elements;
- private final Map<String, String> shapes;
- private final Map<String, IStructureElement<T>[]> structures;
-
- public static <B> Builder<B> builder() {
- return new Builder<>();
- }
-
- private StructureDefinition(
- Map<Character, IStructureElement<T>> elements,
- Map<String, String> shapes,
- Map<String, IStructureElement<T>[]> structures) {
- this.elements =elements;
- this.shapes=shapes;
- this.structures = structures;
- }
-
- public static class Builder<T> {
- private static final char A='\uA000';
- private static final char B='\uB000';
- private static final char C='\uC000';
- private char d ='\uD000';
- private final Map<Vec3Impl,Character> navigates;
- private final Map<Character, IStructureElement<T>> elements;
- private final Map<String, String> shapes;
-
- private Builder() {
- navigates=new HashMap<>();
- elements = new HashMap<>();
- shapes = new HashMap<>();
- }
-
- public Map<Character, IStructureElement<T>> getElements() {
- return elements;
- }
-
- public Map<String, String> getShapes() {
- return shapes;
- }
-
- /**
- * Casings go: 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
- * <br/>
- * HatchAdders go: space ! " # $ % & ' ( ) *
- * @param name
- * @param structurePiece
- * @return
- */
- @Deprecated
- public Builder<T> addShapeOldApi(String name, String[][] structurePiece) {
- StringBuilder builder = new StringBuilder();
- if (structurePiece.length > 0) {
- for (String[] strings : structurePiece) {
- if (strings.length > 0) {
- for (String string : strings) {
- for (int i = 0; i < string.length(); i++) {
- char ch = string.charAt(i);
- if(ch<' '){
- for (int b = 0; b < ch; b++) {
- builder.append(B);
- }
- }else if(ch>'@'){
- for (int a = '@'; a < ch; a++) {
- builder.append(A);
- }
- }else if(ch=='.'){
- builder.append(A);
- }else{
- builder.append(ch);
- }
- }
- builder.append(B);
- }
- builder.setLength(builder.length() - 1);
- }
- builder.append(C);
- }
- builder.setLength(builder.length() - 1);
- }
- int a=0,b=0,c=0;
- for (int i = 0; i < builder.length(); i++) {
- char ch = builder.charAt(i);
- if(ch==A){
- a++;
- }else if(ch==B){
- a=0;
- b++;
- }else if(ch==C){
- a=0;
- b=0;
- c++;
- }else if(a!=0 || b!=0 || c!=0){
- Vec3Impl vec3 = new Vec3Impl(a, b, c);
- Character navigate = navigates.get(vec3);
- if(navigate==null){
- navigate= d++;
- navigates.put(vec3,navigate);
- addElement(navigate,step(vec3));
- }
- builder.setCharAt(i-1,navigate);
- a=0;
- b=0;
- c=0;
- }
- }
-
- String built = builder.toString().replaceAll("[\\uA000\\uB000\\uC000]","");
-
- if(built.contains("+")){
- addElement('+',notAir());
- }
- if (built.contains("-")) {
- addElement('-', isAir());
- }
- shapes.put(name, built);
- return this;
- }
-
- /**
- * Adds shape
- * +- is air/no air checks
- * space bar is skip
- * ~ is also skip (but marks controller position, optional and logically it is a space...)
- * rest needs to be defined
- *
- * next char is next block(a)
- * next string is next line(b)
- * next string[] is next slice(c)
- *
- * char A000-FFFF range is reserved for generated skips
- * @param name unlocalized/code name
- * @param structurePiece generated or written struct - DO NOT STORE IT ANYWHERE, or at least set them to null afterwards
- * @return this builder
- */
- public Builder<T> addShape(String name, String[][] structurePiece) {
- StringBuilder builder = new StringBuilder();
- if (structurePiece.length > 0) {
- for (String[] strings : structurePiece) {
- if (strings.length > 0) {
- for (String string : strings) {
- builder.append(string).append(B);
- }
- builder.setLength(builder.length() - 1);
- }
- builder.append(C);
- }
- builder.setLength(builder.length() - 1);
- }
- int a=0,b=0,c=0;
- for (int i = 0; i < builder.length(); i++) {
- char ch = builder.charAt(i);
- if(ch ==' ' || ch =='~'){
- builder.setCharAt(i,A);
- ch=A;
- }
- if(ch==A){
- a++;
- }else if(ch==B){
- a=0;
- b++;
- }else if(ch==C){
- a=0;
- b=0;
- c++;
- }else if(a!=0 || b!=0 || c!=0){
- Vec3Impl vec3 = new Vec3Impl(a, b, c);
- Character navigate = navigates.get(vec3);
- if(navigate==null){
- navigate=d++;
- navigates.put(vec3,navigate);
- addElement(navigate,step(vec3));
- }
- builder.setCharAt(i-1,navigate);
- a=0;
- b=0;
- c=0;
- }
- }
-
- String built = builder.toString().replaceAll("[\\uA000\\uB000\\uC000]","");
-
- if(built.contains("+")){
- addElement('+',notAir());
- }
- if (built.contains("-")) {
- addElement('-', isAir());
- }
- shapes.put(name, built);
- return this;
- }
-
- public Builder<T> addElement(Character name, IStructureElement<T> structurePiece) {
- elements.putIfAbsent(name, structurePiece);
- return this;
- }
-
- public IStructureDefinition<T> build() {
- Map<String, IStructureElement<T>[]> structures = compileStructureMap();
- if(DEBUG_MODE){
- return new StructureDefinition<>(new HashMap<>(elements), new HashMap<>(shapes), structures);
- }else {
- return structures::get;
- }
- }
-
- @SuppressWarnings("unchecked")
- private Map<String, IStructureElement<T>[]> compileElementSetMap() {
- Set<Integer> missing = new HashSet<>();
- shapes.values().stream().map(CharSequence::chars).forEach(intStream -> intStream.forEach(c -> {
- IStructureElement<T> iStructureElement = elements.get((char) c);
- if (iStructureElement == null) {
- missing.add(c);
- }
- }));
- if (missing.isEmpty()) {
- Map<String, IStructureElement<T>[]> map = new HashMap<>();
- shapes.forEach((key, value) -> {
- Set<Character> chars=new HashSet<>();
- for (char c : value.toCharArray()) {
- chars.add(c);
- }
- IStructureElement<T>[] compiled = new IStructureElement[chars.size()];
- int i=0;
- for (Character aChar : chars) {
- compiled[i++]=elements.get(aChar);
- }
- map.put(key, compiled);
- });
- return map;
- } else {
- throw new RuntimeException("Missing Structure Element bindings for (chars as integers): " +
- Arrays.toString(missing.toArray()));
- }
- }
-
- @SuppressWarnings("unchecked")
- private Map<String, IStructureElement<T>[]> compileStructureMap() {
- Set<Integer> mising = new HashSet<>();
- shapes.values().stream().map(CharSequence::chars).forEach(intStream -> intStream.forEach(c -> {
- IStructureElement<T> iStructureElement = elements.get((char) c);
- if (iStructureElement == null) {
- mising.add(c);
- }
- }));
- if (mising.isEmpty()) {
- Map<String, IStructureElement<T>[]> map = new HashMap<>();
- shapes.forEach((key, value) -> {
- IStructureElement<T>[] compiled = new IStructureElement[value.length()];
- for (int i = 0; i < value.length(); i++) {
- compiled[i] = elements.get(value.charAt(i));
- }
- map.put(key, compiled);
- });
- return map;
- } else {
- throw new RuntimeException("Missing Structure Element bindings for (chars as integers): " +
- Arrays.toString(mising.toArray()));
- }
- }
- }
-
- public Map<Character, IStructureElement<T>> getElements(){
- return elements;
- }
-
- public Map<String, String> getShapes() {
- return shapes;
- }
-
- public Map<String, IStructureElement<T>[]> getStructures() {
- return structures;
- }
-
- @Override
- public IStructureElement<T>[] getStructureFor(String name) {
- return structures.get(name);
- }
-} \ No newline at end of file
diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java b/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java
deleted file mode 100644
index f469925dbc..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java
+++ /dev/null
@@ -1,1396 +0,0 @@
-package com.github.technus.tectech.mechanics.structure;
-
-import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.mechanics.alignment.enumerable.ExtendedFacing;
-import com.github.technus.tectech.mechanics.structure.adders.IBlockAdder;
-import com.github.technus.tectech.mechanics.structure.adders.IHatchAdder;
-import com.github.technus.tectech.mechanics.structure.adders.ITileAdder;
-import com.github.technus.tectech.util.Vec3Impl;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import net.minecraft.block.Block;
-import net.minecraft.block.material.Material;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.IIcon;
-import net.minecraft.world.World;
-
-import java.util.*;
-import java.util.function.BiFunction;
-import java.util.function.Consumer;
-import java.util.function.Function;
-import java.util.function.Supplier;
-
-import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sHintCasingsTT;
-import static java.lang.Integer.MIN_VALUE;
-
-/**
- * Fluent API for structure checking!
- *
- * (Just import static this class to have a nice fluent syntax while defining structure definitions)
- */
-@Deprecated
-public class StructureUtility {
- private static final String NICE_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz=|!@#$%&()[]{};:<>/?_,.*^'`";
- @SuppressWarnings("rawtypes")
- private static final Map<Vec3Impl, IStructureNavigate> STEP = new HashMap<>();
- @SuppressWarnings("rawtypes")
- private static final IStructureElement AIR = new IStructureElement() {
- @Override
- public boolean check(Object t, World world, int x, int y, int z) {
- return world.isAirBlock(x, y, z);
- }
-
- @Override
- public boolean spawnHint(Object o, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, sHintCasingsTT, 13);
- return true;
- }
-
- @Override
- public boolean placeBlock(Object o, World world, int x, int y, int z, ItemStack trigger) {
- world.setBlock(x, y, z, Blocks.air, 0, 2);
- return false;
- }
- };
- @SuppressWarnings("rawtypes")
- private static final IStructureElement NOT_AIR = new IStructureElement() {
- @Override
- public boolean check(Object t, World world, int x, int y, int z) {
- return !world.isAirBlock(x, y, z);
- }
-
- @Override
- public boolean spawnHint(Object o, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, sHintCasingsTT, 14);
- return true;
- }
-
- @Override
- public boolean placeBlock(Object o, World world, int x, int y, int z, ItemStack trigger) {
- world.setBlock(x, y, z, sHintCasingsTT, 14, 2);
- return true;
- }
- };
- @SuppressWarnings("rawtypes")
- private static final IStructureElement ERROR = new IStructureElement() {
- @Override
- public boolean check(Object t, World world, int x, int y, int z) {
- return false;
- }
-
- @Override
- public boolean spawnHint(Object o, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, sHintCasingsTT, 15);
- return true;
- }
-
- @Override
- public boolean placeBlock(Object o, World world, int x, int y, int z, ItemStack trigger) {
- return true;
- }
- };
-
- private StructureUtility() {
-
- }
-
- @SuppressWarnings("unchecked")
- public static <T> IStructureElement<T> isAir() {
- return AIR;
- }
-
- @SuppressWarnings("unchecked")
- public static <T> IStructureElement<T> notAir() {
- return NOT_AIR;
- }
-
- /**
- * Check returns false.
- * Placement is always handled by this and does nothing.
- * Makes little to no use it in fallback chain.
- *
- * @param <T>
- * @return
- */
- @SuppressWarnings("unchecked")
- public static <T> IStructureElement<T> error() {
- return ERROR;
- }
-
- //region hint only
-
- /**
- * Check always returns: true.
- *
- * @param dots
- * @param <T>
- * @return
- */
- public static <T> IStructureElementNoPlacement<T> ofHint(int dots) {
- int meta = dots - 1;
- return new IStructureElementNoPlacement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- return true;
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, sHintCasingsTT, meta);
- return false;
- }
- };
- }
-
- /**
- * Check always returns: true.
- *
- * @param icons
- * @param <T>
- * @return
- */
- public static <T> IStructureElementNoPlacement<T> ofHintDeferred(Supplier<IIcon[]> icons) {
- return new IStructureElementNoPlacement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- return true;
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, icons.get());
- return false;
- }
- };
- }
-
- /**
- * Check always returns: true.
- *
- * @param icons
- * @param RGBa
- * @param <T>
- * @return
- */
- public static <T> IStructureElementNoPlacement<T> ofHintDeferred(Supplier<IIcon[]> icons, short[] RGBa) {
- return new IStructureElementNoPlacement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- return true;
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle_tinted(world, x, y, z, icons.get(), RGBa);
- return false;
- }
- };
- }
-
- //endregion
-
- //region block
-
- /**
- * Does not allow Block duplicates (with different meta)
- */
- public static <T> IStructureElementNoPlacement<T> ofBlocksFlatHint(Map<Block, Integer> blocsMap, Block hintBlock, int hintMeta) {
- if (blocsMap == null || blocsMap.isEmpty() || hintBlock == null) {
- throw new IllegalArgumentException();
- }
- return new IStructureElementNoPlacement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- Block worldBlock = world.getBlock(x, y, z);
- return blocsMap.getOrDefault(worldBlock, MIN_VALUE) == worldBlock.getDamageValue(world, x, y, z);
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, hintBlock, hintMeta);
- return true;
- }
- };
- }
-
- /**
- * Allows block duplicates (with different meta)
- */
- public static <T> IStructureElementNoPlacement<T> ofBlocksMapHint(Map<Block, Collection<Integer>> blocsMap, Block hintBlock, int hintMeta) {
- if (blocsMap == null || blocsMap.isEmpty() || hintBlock == null) {
- throw new IllegalArgumentException();
- }
- for (Collection<Integer> value : blocsMap.values()) {
- if (value.isEmpty()) {
- throw new IllegalArgumentException();
- }
- }
- return new IStructureElementNoPlacement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- Block worldBlock = world.getBlock(x, y, z);
- return blocsMap.getOrDefault(worldBlock, Collections.emptySet()).contains(worldBlock.getDamageValue(world, x, y, z));
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, hintBlock, hintMeta);
- return true;
- }
- };
- }
-
- public static <T> IStructureElementNoPlacement<T> ofBlockHint(Block block, int meta, Block hintBlock, int hintMeta) {
- if (block == null || hintBlock == null) {
- throw new IllegalArgumentException();
- }
- return new IStructureElementNoPlacement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- Block worldBlock = world.getBlock(x, y, z);
- return block == worldBlock && meta == worldBlock.getDamageValue(world, x, y, z);
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, hintBlock, hintMeta);
- return true;
- }
- };
- }
-
- public static <T> IStructureElementNoPlacement<T> ofBlockHint(Block block, int meta) {
- return ofBlockHint(block, meta, block, meta);
- }
-
- public static <T> IStructureElementNoPlacement<T> ofBlockAdderHint(IBlockAdder<T> iBlockAdder, Block hintBlock, int hintMeta) {
- if (iBlockAdder == null || hintBlock == null) {
- throw new IllegalArgumentException();
- }
- return new IStructureElementNoPlacement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- Block worldBlock = world.getBlock(x, y, z);
- return iBlockAdder.apply(t, worldBlock, worldBlock.getDamageValue(world, x, y, z));
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, hintBlock, hintMeta);
- return true;
- }
- };
- }
-
- /**
- * Does not allow Block duplicates (with different meta)
- */
- public static <T> IStructureElement<T> ofBlocksFlat(Map<Block, Integer> blocsMap, Block defaultBlock, int defaultMeta) {
- if (blocsMap == null || blocsMap.isEmpty() || defaultBlock == null) {
- throw new IllegalArgumentException();
- }
- if(defaultBlock instanceof ICustomBlockSetting){
- return new IStructureElement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- Block worldBlock = world.getBlock(x, y, z);
- return blocsMap.getOrDefault(worldBlock, MIN_VALUE) == worldBlock.getDamageValue(world, x, y, z);
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- ((ICustomBlockSetting) defaultBlock).setBlock(world, x, y, z, defaultMeta);
- return true;
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, defaultBlock, defaultMeta);
- return true;
- }
- };
- }else {
- return new IStructureElement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- Block worldBlock = world.getBlock(x, y, z);
- return blocsMap.getOrDefault(worldBlock, MIN_VALUE) == worldBlock.getDamageValue(world, x, y, z);
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- world.setBlock(x, y, z, defaultBlock, defaultMeta, 2);
- return true;
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, defaultBlock, defaultMeta);
- return true;
- }
- };
- }
- }
-
- /**
- * Allows block duplicates (with different meta)
- */
- public static <T> IStructureElement<T> ofBlocksMap(Map<Block, Collection<Integer>> blocsMap, Block defaultBlock, int defaultMeta) {
- if (blocsMap == null || blocsMap.isEmpty() || defaultBlock == null) {
- throw new IllegalArgumentException();
- }
- for (Collection<Integer> value : blocsMap.values()) {
- if (value.isEmpty()) {
- throw new IllegalArgumentException();
- }
- }
- if(defaultBlock instanceof ICustomBlockSetting){
- return new IStructureElement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- Block worldBlock = world.getBlock(x, y, z);
- return blocsMap.getOrDefault(worldBlock, Collections.emptySet()).contains(worldBlock.getDamageValue(world, x, y, z));
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- ((ICustomBlockSetting) defaultBlock).setBlock(world, x, y, z, defaultMeta);
- return true;
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, defaultBlock, defaultMeta);
- return true;
- }
- };
- }else {
- return new IStructureElement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- Block worldBlock = world.getBlock(x, y, z);
- return blocsMap.getOrDefault(worldBlock, Collections.emptySet()).contains(worldBlock.getDamageValue(world, x, y, z));
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- world.setBlock(x, y, z, defaultBlock, defaultMeta, 2);
- return true;
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, defaultBlock, defaultMeta);
- return true;
- }
- };
- }
- }
-
- public static <T> IStructureElement<T> ofBlock(Block block, int meta, Block defaultBlock, int defaultMeta) {
- if (block == null || defaultBlock == null) {
- throw new IllegalArgumentException();
- }
- if(block instanceof ICustomBlockSetting){
- return new IStructureElement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- Block worldBlock = world.getBlock(x, y, z);
- return block == worldBlock && meta == worldBlock.getDamageValue(world, x, y, z);
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- ((ICustomBlockSetting) defaultBlock).setBlock(world, x, y, z, defaultMeta);
- return true;
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, defaultBlock, defaultMeta);
- return true;
- }
- };
- } else {
- return new IStructureElement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- Block worldBlock = world.getBlock(x, y, z);
- return block == worldBlock && meta == worldBlock.getDamageValue(world, x, y, z);
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- world.setBlock(x, y, z, defaultBlock, defaultMeta, 2);
- return true;
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, defaultBlock, defaultMeta);
- return true;
- }
- };
- }
- }
-
- /**
- * Same as above but ignores target meta id
- */
- public static <T> IStructureElement<T> ofBlockAnyMeta(Block block, Block defaultBlock, int defaultMeta) {
- if (block == null || defaultBlock == null) {
- throw new IllegalArgumentException();
- }
- if(block instanceof ICustomBlockSetting){
- return new IStructureElement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- return block == world.getBlock(x, y, z);
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- ((ICustomBlockSetting) defaultBlock).setBlock(world, x, y, z, defaultMeta);
- return true;
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, defaultBlock, defaultMeta);
- return true;
- }
- };
- } else {
- return new IStructureElement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- return block == world.getBlock(x, y, z);
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- world.setBlock(x, y, z, defaultBlock, defaultMeta, 2);
- return true;
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, defaultBlock, defaultMeta);
- return true;
- }
- };
- }
- }
-
- public static <T> IStructureElement<T> ofBlock(Block block, int meta) {
- return ofBlock(block, meta, block, meta);
- }
-
- /**
- * Same as above but ignores target meta id
- */
- public static <T> IStructureElement<T> ofBlockAnyMeta(Block block) {
- return ofBlockAnyMeta(block, block, 0);
- }
-
- /**
- * Same as above but allows to set hint particle render
- */
- public static <T> IStructureElement<T> ofBlockAnyMeta(Block block,int defaultMeta) {
- return ofBlockAnyMeta(block, block, defaultMeta);
- }
-
- //endregion
-
- //region adders
-
- public static <T> IStructureElement<T> ofBlockAdder(IBlockAdder<T> iBlockAdder, Block defaultBlock, int defaultMeta) {
- if (iBlockAdder == null || defaultBlock == null) {
- throw new IllegalArgumentException();
- }
- if(defaultBlock instanceof ICustomBlockSetting){
- return new IStructureElement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- Block worldBlock = world.getBlock(x, y, z);
- return iBlockAdder.apply(t, worldBlock, worldBlock.getDamageValue(world, x, y, z));
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- ((ICustomBlockSetting) defaultBlock).setBlock(world, x, y, z, defaultMeta);
- return true;
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, defaultBlock, defaultMeta);
- return true;
- }
- };
- }else {
- return new IStructureElement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- Block worldBlock = world.getBlock(x, y, z);
- return iBlockAdder.apply(t, worldBlock, worldBlock.getDamageValue(world, x, y, z));
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- world.setBlock(x, y, z, defaultBlock, defaultMeta, 2);
- return true;
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, defaultBlock, defaultMeta);
- return true;
- }
- };
- }
- }
-
- public static <T> IStructureElement<T> ofBlockAdder(IBlockAdder<T> iBlockAdder, int dots) {
- return ofBlockAdder(iBlockAdder, sHintCasingsTT, dots - 1);
- }
-
- public static <T> IStructureElementNoPlacement<T> ofTileAdder(ITileAdder<T> iTileAdder, Block hintBlock, int hintMeta) {
- if (iTileAdder == null || hintBlock == null) {
- throw new IllegalArgumentException();
- }
- return new IStructureElementNoPlacement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- TileEntity tileEntity = world.getTileEntity(x, y, z);
- return tileEntity instanceof IGregTechTileEntity && iTileAdder.apply(t, tileEntity);
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, hintBlock, hintMeta);
- return true;
- }
- };
- }
-
- public static <T> IStructureElementNoPlacement<T> ofHatchAdder(IHatchAdder<T> iHatchAdder, int textureIndex, int dots) {
- return ofHatchAdder(iHatchAdder, textureIndex, sHintCasingsTT, dots - 1);
- }
-
- public static <T> IStructureElementNoPlacement<T> ofHatchAdder(IHatchAdder<T> iHatchAdder, int textureIndex, Block hintBlock, int hintMeta) {
- if (iHatchAdder == null || hintBlock == null) {
- throw new IllegalArgumentException();
- }
- return new IStructureElementNoPlacement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- TileEntity tileEntity = world.getTileEntity(x, y, z);
- return tileEntity instanceof IGregTechTileEntity && iHatchAdder.apply(t, (IGregTechTileEntity) tileEntity, (short) textureIndex);
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, hintBlock, hintMeta);
- return true;
- }
- };
- }
-
- public static <T> IStructureElement<T> ofHatchAdderOptional(IHatchAdder<T> iHatchAdder, int textureIndex, int dots, Block placeCasing, int placeCasingMeta) {
- return ofHatchAdderOptional(iHatchAdder, textureIndex, sHintCasingsTT, dots - 1, placeCasing, placeCasingMeta);
- }
-
- public static <T> IStructureElement<T> ofHatchAdderOptional(IHatchAdder<T> iHatchAdder, int textureIndex, Block hintBlock, int hintMeta, Block placeCasing, int placeCasingMeta) {
- if (iHatchAdder == null || hintBlock == null) {
- throw new IllegalArgumentException();
- }
- if(placeCasing instanceof ICustomBlockSetting){
- return new IStructureElement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- TileEntity tileEntity = world.getTileEntity(x, y, z);
- Block worldBlock = world.getBlock(x, y, z);
- return (tileEntity instanceof IGregTechTileEntity &&
- iHatchAdder.apply(t, (IGregTechTileEntity) tileEntity, (short) textureIndex)) ||
- (worldBlock == placeCasing && worldBlock.getDamageValue(world, x, y, z) == placeCasingMeta);
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, hintBlock, hintMeta);
- return true;
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- ((ICustomBlockSetting) placeCasing).setBlock(world, x, y, z, placeCasingMeta);
- return true;
- }
- };
- }else {
- return new IStructureElement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- TileEntity tileEntity = world.getTileEntity(x, y, z);
- Block worldBlock = world.getBlock(x, y, z);
- return (tileEntity instanceof IGregTechTileEntity &&
- iHatchAdder.apply(t, (IGregTechTileEntity) tileEntity, (short) textureIndex)) ||
- (worldBlock == placeCasing && worldBlock.getDamageValue(world, x, y, z) == placeCasingMeta);
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, hintBlock, hintMeta);
- return true;
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- world.setBlock(x, y, z, placeCasing, placeCasingMeta, 2);
- return true;
- }
- };
- }
- }
-
- //endregion
-
- //region side effects
-
- public static <B extends IStructureElement<T>, T> IStructureElement<T> onElementPass(Consumer<T> onCheckPass, B element) {
- return new IStructureElement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- boolean check = element.check(t, world, x, y, z);
- if (check) {
- onCheckPass.accept(t);
- }
- return check;
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- return element.placeBlock(t, world, x, y, z, trigger);
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- return element.spawnHint(t, world, x, y, z, trigger);
- }
- };
- }
-
- public static <B extends IStructureElement<T>, T> IStructureElement<T> onElementFail(Consumer<T> onFail, B element) {
- return new IStructureElement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- boolean check = element.check(t, world, x, y, z);
- if (!check) {
- onFail.accept(t);
- }
- return check;
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- return element.placeBlock(t, world, x, y, z, trigger);
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- return element.spawnHint(t, world, x, y, z, trigger);
- }
- };
- }
-
- //endregion
-
- /**
- * Take care while chaining, as it will try to call every structure element until it returns true.
- * If none does it will finally return false.
- *
- * @param elementChain
- * @param <T>
- * @return
- */
- @SafeVarargs
- public static <T> IStructureElementChain<T> ofChain(IStructureElement<T>... elementChain) {
- if (elementChain == null || elementChain.length == 0) {
- throw new IllegalArgumentException();
- }
- for (IStructureElement<T> iStructureElement : elementChain) {
- if (iStructureElement == null) {
- throw new IllegalArgumentException();
- }
- }
- return () -> elementChain;
- }
-
- /**
- * Take care while chaining, as it will try to call every structure element until it returns true.
- * If none does it will finally return false.
- *
- * @param elementChain
- * @param <T>
- * @return
- */
- @SuppressWarnings("unchecked")
- public static <T> IStructureElementChain<T> ofChain(List<IStructureElement<T>> elementChain) {
- return ofChain(elementChain.toArray(new IStructureElement[0]));
- }
-
- //region defer
-
- public static <T> IStructureElementDeferred<T> defer(Supplier<IStructureElement<T>> to) {
- if (to == null) {
- throw new IllegalArgumentException();
- }
- return new IStructureElementDeferred<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- return to.get().check(t, world, x, y, z);
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- return to.get().placeBlock(t, world, x, y, z, trigger);
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- return to.get().spawnHint(t, world, x, y, z, trigger);
- }
- };
- }
-
- public static <T> IStructureElementDeferred<T> defer(Function<T, IStructureElement<T>> to) {
- if (to == null) {
- throw new IllegalArgumentException();
- }
- return new IStructureElementDeferred<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- return to.apply(t).check(t, world, x, y, z);
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- return to.apply(t).placeBlock(t, world, x, y, z, trigger);
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- return to.apply(t).spawnHint(t, world, x, y, z, trigger);
- }
- };
- }
-
- public static <T, K> IStructureElementDeferred<T> defer(Function<T, K> keyExtractor, Map<K, IStructureElement<T>> map) {
- if (keyExtractor == null || map == null) {
- throw new IllegalArgumentException();
- }
- return new IStructureElementDeferred<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- return map.get(keyExtractor.apply(t)).check(t, world, x, y, z);
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- return map.get(keyExtractor.apply(t)).placeBlock(t, world, x, y, z, trigger);
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- return map.get(keyExtractor.apply(t)).spawnHint(t, world, x, y, z, trigger);
- }
- };
- }
-
- public static <T, K> IStructureElementDeferred<T> defer(Function<T, K> keyExtractor, Map<K, IStructureElement<T>> map, IStructureElement<T> defaultElem) {
- if (keyExtractor == null || map == null) {
- throw new IllegalArgumentException();
- }
- return new IStructureElementDeferred<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- return map.getOrDefault(keyExtractor.apply(t), defaultElem).check(t, world, x, y, z);
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- return map.getOrDefault(keyExtractor.apply(t), defaultElem).placeBlock(t, world, x, y, z, trigger);
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- return map.getOrDefault(keyExtractor.apply(t), defaultElem).spawnHint(t, world, x, y, z, trigger);
- }
- };
- }
-
- @SafeVarargs
- public static <T> IStructureElementDeferred<T> defer(Function<T, Integer> keyExtractor, IStructureElement<T>... array) {
- if (keyExtractor == null || array == null) {
- throw new IllegalArgumentException();
- }
- return new IStructureElementDeferred<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- return array[keyExtractor.apply(t)].check(t, world, x, y, z);
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- return array[keyExtractor.apply(t)].placeBlock(t, world, x, y, z, trigger);
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- return array[keyExtractor.apply(t)].spawnHint(t, world, x, y, z, trigger);
- }
- };
- }
-
- @SuppressWarnings("unchecked")
- public static <T> IStructureElementDeferred<T> defer(Function<T, Integer> keyExtractor, List<IStructureElement<T>> array) {
- return defer(keyExtractor, array.toArray(new IStructureElement[0]));
- }
-
- public static <T> IStructureElementDeferred<T> defer(BiFunction<T, ItemStack, IStructureElement<T>> to) {
- if (to == null) {
- throw new IllegalArgumentException();
- }
- return new IStructureElementDeferred<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- return to.apply(t, null).check(t, world, x, y, z);
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- return to.apply(t, trigger).placeBlock(t, world, x, y, z, trigger);
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- return to.apply(t, trigger).spawnHint(t, world, x, y, z, trigger);
- }
- };
- }
-
- public static <T, K> IStructureElementDeferred<T> defer(BiFunction<T, ItemStack, K> keyExtractor, Map<K, IStructureElement<T>> map) {
- if (keyExtractor == null || map == null) {
- throw new IllegalArgumentException();
- }
- return new IStructureElementDeferred<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- return map.get(keyExtractor.apply(t, null)).check(t, world, x, y, z);
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- return map.get(keyExtractor.apply(t, trigger)).placeBlock(t, world, x, y, z, trigger);
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- return map.get(keyExtractor.apply(t, trigger)).spawnHint(t, world, x, y, z, trigger);
- }
- };
- }
-
- public static <T, K> IStructureElementDeferred<T> defer(BiFunction<T, ItemStack, K> keyExtractor, Map<K, IStructureElement<T>> map, IStructureElement<T> defaultElem) {
- if (keyExtractor == null || map == null) {
- throw new IllegalArgumentException();
- }
- return new IStructureElementDeferred<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- return map.getOrDefault(keyExtractor.apply(t, null), defaultElem).check(t, world, x, y, z);
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- return map.getOrDefault(keyExtractor.apply(t, trigger), defaultElem).placeBlock(t, world, x, y, z, trigger);
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- return map.getOrDefault(keyExtractor.apply(t, trigger), defaultElem).spawnHint(t, world, x, y, z, trigger);
- }
- };
- }
-
- @SafeVarargs
- public static <T> IStructureElementDeferred<T> defer(BiFunction<T, ItemStack, Integer> keyExtractor, IStructureElement<T>... array) {
- if (keyExtractor == null || array == null) {
- throw new IllegalArgumentException();
- }
- return new IStructureElementDeferred<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- return array[keyExtractor.apply(t, null)].check(t, world, x, y, z);
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- return array[keyExtractor.apply(t, trigger)].placeBlock(t, world, x, y, z, trigger);
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- return array[keyExtractor.apply(t, trigger)].spawnHint(t, world, x, y, z, trigger);
- }
- };
- }
-
- @SuppressWarnings("unchecked")
- public static <T> IStructureElementDeferred<T> defer(BiFunction<T, ItemStack, Integer> keyExtractor, List<IStructureElement<T>> array) {
- return defer(keyExtractor, array.toArray(new IStructureElement[0]));
- }
-
- public static <T> IStructureElementDeferred<T> defer(Function<T, IStructureElement<T>> toCheck, BiFunction<T, ItemStack, IStructureElement<T>> to) {
- if (to == null) {
- throw new IllegalArgumentException();
- }
- return new IStructureElementDeferred<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- return toCheck.apply(t).check(t, world, x, y, z);
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- return to.apply(t, trigger).placeBlock(t, world, x, y, z, trigger);
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- return to.apply(t, trigger).spawnHint(t, world, x, y, z, trigger);
- }
- };
- }
-
- public static <T, K> IStructureElementDeferred<T> defer(Function<T, K> keyExtractorCheck, BiFunction<T, ItemStack, K> keyExtractor, Map<K, IStructureElement<T>> map) {
- if (keyExtractor == null || map == null) {
- throw new IllegalArgumentException();
- }
- return new IStructureElementDeferred<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- return map.get(keyExtractorCheck.apply(t)).check(t, world, x, y, z);
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- return map.get(keyExtractor.apply(t, trigger)).placeBlock(t, world, x, y, z, trigger);
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- return map.get(keyExtractor.apply(t, trigger)).spawnHint(t, world, x, y, z, trigger);
- }
- };
- }
-
- public static <T, K> IStructureElementDeferred<T> defer(Function<T, K> keyExtractorCheck, BiFunction<T, ItemStack, K> keyExtractor, Map<K, IStructureElement<T>> map, IStructureElement<T> defaultElem) {
- if (keyExtractor == null || map == null) {
- throw new IllegalArgumentException();
- }
- return new IStructureElementDeferred<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- return map.getOrDefault(keyExtractorCheck.apply(t), defaultElem).check(t, world, x, y, z);
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- return map.getOrDefault(keyExtractor.apply(t, trigger), defaultElem).placeBlock(t, world, x, y, z, trigger);
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- return map.getOrDefault(keyExtractor.apply(t, trigger), defaultElem).spawnHint(t, world, x, y, z, trigger);
- }
- };
- }
-
- @SafeVarargs
- public static <T> IStructureElementDeferred<T> defer(Function<T, Integer> keyExtractorCheck, BiFunction<T, ItemStack, Integer> keyExtractor, IStructureElement<T>... array) {
- if (keyExtractor == null || array == null) {
- throw new IllegalArgumentException();
- }
- return new IStructureElementDeferred<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- return array[keyExtractorCheck.apply(t)].check(t, world, x, y, z);
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- return array[keyExtractor.apply(t, trigger)].placeBlock(t, world, x, y, z, trigger);
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- return array[keyExtractor.apply(t, trigger)].spawnHint(t, world, x, y, z, trigger);
- }
- };
- }
-
- @SuppressWarnings("unchecked")
- public static <T> IStructureElementDeferred<T> defer(Function<T, Integer> keyExtractorCheck, BiFunction<T, ItemStack, Integer> keyExtractor, List<IStructureElement<T>> array) {
- return defer(keyExtractorCheck, keyExtractor, array.toArray(new IStructureElement[0]));
- }
-
- //endregion
-
- /**
- * Used internally, to generate skips for structure definitions
- *
- * @param a
- * @param b
- * @param c
- * @param <T>
- * @return
- */
- public static <T> IStructureNavigate<T> step(int a, int b, int c) {
- return step(new Vec3Impl(a, b, c));
- }
-
- /**
- * Used internally, to generate skips for structure definitions
- *
- * @param step
- * @param <T>
- * @return
- */
- @SuppressWarnings("unchecked")
- public static <T> IStructureNavigate<T> step(Vec3Impl step) {
- if (step == null || step.get0() < 0 || step.get1() < 0 || step.get2() < 0) {
- throw new IllegalArgumentException();
- }
- return STEP.computeIfAbsent(step, vec3 -> {
- if (vec3.get2() > 0) {
- return stepC(vec3.get0(), vec3.get1(), vec3.get2());
- } else if (vec3.get1() > 0) {
- return stepB(vec3.get0(), vec3.get1(), vec3.get2());
- } else {
- return stepA(vec3.get0(), vec3.get1(), vec3.get2());
- }
- });
- }
-
- private static <T> IStructureNavigate<T> stepA(int a, int b, int c) {
- return new IStructureNavigate<T>() {
- @Override
- public int getStepA() {
- return a;
- }
-
- @Override
- public int getStepB() {
- return b;
- }
-
- @Override
- public int getStepC() {
- return c;
- }
- };
- }
-
- private static <T> IStructureNavigate<T> stepB(int a, int b, int c) {
- return new IStructureNavigate<T>() {
- @Override
- public int getStepA() {
- return a;
- }
-
- @Override
- public int getStepB() {
- return b;
- }
-
- @Override
- public int getStepC() {
- return c;
- }
-
- @Override
- public boolean resetA() {
- return true;
- }
- };
- }
-
- private static <T> IStructureNavigate<T> stepC(int a, int b, int c) {
- return new IStructureNavigate<T>() {
- @Override
- public int getStepA() {
- return a;
- }
-
- @Override
- public int getStepB() {
- return b;
- }
-
- @Override
- public int getStepC() {
- return c;
- }
-
- @Override
- public boolean resetA() {
- return true;
- }
-
- @Override
- public boolean resetB() {
- return true;
- }
- };
- }
-
- /**
- * Used only to get pseudo code in structure writer...
- *
- * @param world
- * @return
- */
- public static String getPseudoJavaCode(World world, ExtendedFacing extendedFacing,
- int basePositionX, int basePositionY, int basePositionZ,
- int basePositionA, int basePositionB, int basePositionC,
- int sizeA, int sizeB, int sizeC, boolean transpose) {
- Map<Block, Set<Integer>> blocks = new TreeMap<>(Comparator.comparing(Block::getUnlocalizedName));
- Set<Class<? extends TileEntity>> tiles = new TreeSet<>(Comparator.comparing(Class::getCanonicalName));
- Set<Class<? extends IMetaTileEntity>> gtTiles = new TreeSet<>(Comparator.comparing(Class::getCanonicalName));
- iterate(world, extendedFacing, basePositionX, basePositionY, basePositionZ,
- basePositionA, basePositionB, basePositionC,
- sizeA, sizeB, sizeC, ((w, x, y, z) -> {
- TileEntity tileEntity = w.getTileEntity(x, y, z);
- if (tileEntity == null) {
- Block block = w.getBlock(x, y, z);
- if (block != null && block != Blocks.air) {
- blocks.compute(block, (b, set) -> {
- if (set == null) {
- set = new TreeSet<>();
- }
- set.add(block.getDamageValue(world, x, y, z));
- return set;
- });
- }
- } else {
- if (tileEntity instanceof IGregTechTileEntity) {
- IMetaTileEntity meta = ((IGregTechTileEntity) tileEntity).getMetaTileEntity();
- if (meta != null) {
- gtTiles.add(meta.getClass());
- } else {
- tiles.add(tileEntity.getClass());
- }
- } else {
- tiles.add(tileEntity.getClass());
- }
- }
- }));
- Map<String, Character> map = new HashMap<>();
- StringBuilder builder = new StringBuilder();
- {
- int i = 0;
- char c;
- builder.append("\n\nStructure:\n")
- .append("\nBlocks:\n");
- for (Map.Entry<Block, Set<Integer>> entry : blocks.entrySet()) {
- Block block = entry.getKey();
- Set<Integer> set = entry.getValue();
- for (Integer meta : set) {
- c = NICE_CHARS.charAt(i++);
- if (i > NICE_CHARS.length()) {
- return "Too complicated for nice chars";
- }
- map.put(block.getUnlocalizedName() + '\0' + meta, c);
- builder.append(c).append(" -> ofBlock...(")
- .append(block.getUnlocalizedName()).append(", ").append(meta).append(", ...);\n");
- }
- }
- builder.append("\nTiles:\n");
- for (Class<? extends TileEntity> tile : tiles) {
- c = NICE_CHARS.charAt(i++);
- if (i > NICE_CHARS.length()) {
- return "Too complicated for nice chars";
- }
- map.put(tile.getCanonicalName(), c);
- builder.append(c).append(" -> ofTileAdder(")
- .append(tile.getCanonicalName()).append(", ...);\n");
- }
- builder.append("\nMeta:\n");
- for (Class<? extends IMetaTileEntity> gtTile : gtTiles) {
- c = NICE_CHARS.charAt(i++);
- if (i > NICE_CHARS.length()) {
- return "Too complicated for nice chars";
- }
- map.put(gtTile.getCanonicalName(), c);
- builder.append(c).append(" -> ofHatchAdder(")
- .append(gtTile.getCanonicalName()).append(", textureId, ...);\n");
- }
- }
- builder.append("\nOffsets:\n")
- .append(basePositionA).append(' ').append(basePositionB).append(' ').append(basePositionC).append('\n');
- if (transpose) {
- builder.append("\nTransposed Scan:\n")
- .append("new String[][]{\n")
- .append(" {\"");
- iterate(world, extendedFacing, basePositionX, basePositionY, basePositionZ,
- basePositionA, basePositionB, basePositionC, true,
- sizeA, sizeB, sizeC, ((w, x, y, z) -> {
- TileEntity tileEntity = w.getTileEntity(x, y, z);
- if (tileEntity == null) {
- Block block = w.getBlock(x, y, z);
- if (block != null && block != Blocks.air) {
- builder.append(map.get(block.getUnlocalizedName() + '\0' + block.getDamageValue(world, x, y, z)));
- } else {
- builder.append(' ');
- }
- } else {
- if (tileEntity instanceof IGregTechTileEntity) {
- IMetaTileEntity meta = ((IGregTechTileEntity) tileEntity).getMetaTileEntity();
- if (meta != null) {
- builder.append(map.get(meta.getClass().getCanonicalName()));
- } else {
- builder.append(map.get(tileEntity.getClass().getCanonicalName()));
- }
- } else {
- builder.append(map.get(tileEntity.getClass().getCanonicalName()));
- }
- }
- }),
- () -> builder.append("\",\""),
- () -> {
- builder.setLength(builder.length() - 2);
- builder.append("},\n {\"");
- });
- builder.setLength(builder.length() - 8);
- builder.append("\n}\n\n");
- } else {
- builder.append("\nNormal Scan:\n")
- .append("new String[][]{{\n")
- .append(" \"");
- iterate(world, extendedFacing, basePositionX, basePositionY, basePositionZ,
- basePositionA, basePositionB, basePositionC, false,
- sizeA, sizeB, sizeC, ((w, x, y, z) -> {
- TileEntity tileEntity = w.getTileEntity(x, y, z);
- if (tileEntity == null) {
- Block block = w.getBlock(x, y, z);
- if (block != null && block != Blocks.air) {
- builder.append(map.get(block.getUnlocalizedName() + '\0' + block.getDamageValue(world, x, y, z)));
- } else {
- builder.append(' ');
- }
- } else {
- if (tileEntity instanceof IGregTechTileEntity) {
- IMetaTileEntity meta = ((IGregTechTileEntity) tileEntity).getMetaTileEntity();
- if (meta != null) {
- builder.append(map.get(meta.getClass().getCanonicalName()));
- } else {
- builder.append(map.get(tileEntity.getClass().getCanonicalName()));
- }
- } else {
- builder.append(map.get(tileEntity.getClass().getCanonicalName()));
- }
- }
- }),
- () -> builder.append("\",\n").append(" \""),
- () -> {
- builder.setLength(builder.length() - 7);
- builder.append("\n").append("},{\n").append(" \"");
- });
- builder.setLength(builder.length() - 8);
- builder.append("}\n\n");
- }
- return (builder.toString().replaceAll("\"\"", "E"));
- }
-
- public static void iterate(World world, ExtendedFacing extendedFacing,
- int basePositionX, int basePositionY, int basePositionZ,
- int basePositionA, int basePositionB, int basePositionC,
- int sizeA, int sizeB, int sizeC,
- IBlockPosConsumer iBlockPosConsumer) {
- sizeA -= basePositionA;
- sizeB -= basePositionB;
- sizeC -= basePositionC;
-
- int[] abc = new int[3];
- int[] xyz = new int[3];
-
- for (abc[2] = -basePositionC; abc[2] < sizeC; abc[2]++) {
- for (abc[1] = -basePositionB; abc[1] < sizeB; abc[1]++) {
- for (abc[0] = -basePositionA; abc[0] < sizeA; abc[0]++) {
- extendedFacing.getWorldOffset(abc, xyz);
- iBlockPosConsumer.consume(world, xyz[0] + basePositionX, xyz[1] + basePositionY, xyz[2] + basePositionZ);
- }
-
- }
- }
- }
-
- public static void iterate(World world, ExtendedFacing extendedFacing,
- int basePositionX, int basePositionY, int basePositionZ,
- int basePositionA, int basePositionB, int basePositionC,
- boolean transpose, int sizeA, int sizeB, int sizeC,
- IBlockPosConsumer iBlockPosConsumer,
- Runnable nextB,
- Runnable nextC) {
- sizeA -= basePositionA;
- sizeB -= basePositionB;
- sizeC -= basePositionC;
-
- int[] abc = new int[3];
- int[] xyz = new int[3];
- if (transpose) {
- for (abc[1] = -basePositionB; abc[1] < sizeB; abc[1]++) {
- for (abc[2] = -basePositionC; abc[2] < sizeC; abc[2]++) {
- for (abc[0] = -basePositionA; abc[0] < sizeA; abc[0]++) {
- extendedFacing.getWorldOffset(abc, xyz);
- iBlockPosConsumer.consume(world, xyz[0] + basePositionX, xyz[1] + basePositionY, xyz[2] + basePositionZ);
- }
- nextB.run();
- }
- nextC.run();
- }
- } else {
- for (abc[2] = -basePositionC; abc[2] < sizeC; abc[2]++) {
- for (abc[1] = -basePositionB; abc[1] < sizeB; abc[1]++) {
- for (abc[0] = -basePositionA; abc[0] < sizeA; abc[0]++) {
- extendedFacing.getWorldOffset(abc, xyz);
- iBlockPosConsumer.consume(world, xyz[0] + basePositionX, xyz[1] + basePositionY, xyz[2] + basePositionZ);
- }
- nextB.run();
- }
- nextC.run();
- }
- }
- }
-
- /**
- * Transposes shape (swaps B and C axis, can be used to un-transpose transposed shape)
- * WARNING! Do not use on old api...
- *
- * @param structurePiece shape (transposed shape)
- * @return transposed shape (untransposed shape)
- */
- public static String[][] transpose(String[][] structurePiece) {
- String[][] shape = new String[structurePiece[0].length][structurePiece.length];
- for (int i = 0; i < structurePiece.length; i++) {
- for (int j = 0; j < structurePiece[i].length; j++) {
- shape[j][i] = structurePiece[i][j];
- }
- }
- return shape;
- }
-}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/adders/IBlockAdder.java b/src/main/java/com/github/technus/tectech/mechanics/structure/adders/IBlockAdder.java
deleted file mode 100644
index 29229f7902..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/structure/adders/IBlockAdder.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package com.github.technus.tectech.mechanics.structure.adders;
-
-
-import net.minecraft.block.Block;
-
-@Deprecated
-public interface IBlockAdder<T> {
- /**
- * Callback on block added, needs to check if block is valid (and add it)
- * @param block block attempted to add
- * @param meta meta of block attempted to add
- * @return is structure still valid
- */
- boolean apply(T t,Block block, Integer meta);
-}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/adders/IHatchAdder.java b/src/main/java/com/github/technus/tectech/mechanics/structure/adders/IHatchAdder.java
deleted file mode 100644
index 197dd2fd45..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/structure/adders/IHatchAdder.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package com.github.technus.tectech.mechanics.structure.adders;
-
-
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-
-@Deprecated
-public interface IHatchAdder<T> {
- /**
- * Callback to add hatch, needs to check if hatch is valid (and add it)
- * @param iGregTechTileEntity hatch
- * @param aShort requested texture index, or null if not...
- * @return managed to add hatch (structure still valid)
- */
- boolean apply(T t,IGregTechTileEntity iGregTechTileEntity, Short aShort);
-}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/adders/ITileAdder.java b/src/main/java/com/github/technus/tectech/mechanics/structure/adders/ITileAdder.java
deleted file mode 100644
index c262bbb154..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/structure/adders/ITileAdder.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package com.github.technus.tectech.mechanics.structure.adders;
-
-import net.minecraft.tileentity.TileEntity;
-
-@Deprecated
-public interface ITileAdder<T> {
- /**
- * Callback to add hatch, needs to check if tile is valid (and add it)
- * @param tileEntity tile
- * @return managed to add hatch (structure still valid)
- */
- boolean apply(T t,TileEntity tileEntity);
-}
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 6a2a81057e..d7baec4ef5 100644
--- a/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java
+++ b/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java
@@ -1,10 +1,7 @@
package com.github.technus.tectech.proxy;
import com.github.technus.tectech.Reference;
-import com.github.technus.tectech.TecTech;
import com.github.technus.tectech.compatibility.openmodularturrets.TT_turret_loader;
-import com.github.technus.tectech.entity.fx.BlockHint;
-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;
@@ -12,11 +9,11 @@ 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;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityClientPlayerMP;
import net.minecraft.client.gui.GuiNewChat;
@@ -24,7 +21,6 @@ import net.minecraft.client.particle.EntityFX;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.ChatComponentText;
-import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.common.util.ForgeDirection;
@@ -49,42 +45,6 @@ public class ClientProxy extends CommonProxy {
}
@Override
- public void hint_particle_tinted(World w,int x, int y, int z, IIcon[] icons,short[] RGBa) {
- Minecraft.getMinecraft().effectRenderer.addEffect(new BlockHint(w,x,y,z,icons).withColorTint(RGBa));
-
- EntityFX particle = new WeightlessParticleFX(w, x + RANDOM.nextFloat() * 0.5F, y + RANDOM.nextFloat() * 0.5F, z + RANDOM.nextFloat() * 0.5F, 0, 0, 0);
- particle.setRBGColorF(0, 0.6F * RANDOM.nextFloat(), 0.8f);
- Minecraft.getMinecraft().effectRenderer.addEffect(particle);
- }
-
- @Override
- public void hint_particle_tinted(World w,int x, int y, int z, Block block, int meta,short[] RGBa) {
- Minecraft.getMinecraft().effectRenderer.addEffect(new BlockHint(w,x,y,z,block,meta).withColorTint(RGBa));
-
- EntityFX particle = new WeightlessParticleFX(w, x + RANDOM.nextFloat() * 0.5F, y + RANDOM.nextFloat() * 0.5F, z + RANDOM.nextFloat() * 0.5F, 0, 0, 0);
- particle.setRBGColorF(0, 0.6F * RANDOM.nextFloat(), 0.8f);
- Minecraft.getMinecraft().effectRenderer.addEffect(particle);
- }
-
- @Override
- public void hint_particle(World w,int x, int y, int z, IIcon[] icons) {
- Minecraft.getMinecraft().effectRenderer.addEffect(new BlockHint(w,x,y,z,icons));
-
- EntityFX particle = new WeightlessParticleFX(w, x + RANDOM.nextFloat() * 0.5F, y + RANDOM.nextFloat() * 0.5F, z + RANDOM.nextFloat() * 0.5F, 0, 0, 0);
- particle.setRBGColorF(0, 0.6F * RANDOM.nextFloat(), 0.8f);
- Minecraft.getMinecraft().effectRenderer.addEffect(particle);
- }
-
- @Override
- public void hint_particle(World w,int x, int y, int z, Block block, int meta) {
- Minecraft.getMinecraft().effectRenderer.addEffect(new BlockHint(w,x,y,z,block,meta));
-
- EntityFX particle = new WeightlessParticleFX(w, x + RANDOM.nextFloat() * 0.5F, y + RANDOM.nextFloat() * 0.5F, z + RANDOM.nextFloat() * 0.5F, 0, 0, 0);
- particle.setRBGColorF(0, 0.6F * RANDOM.nextFloat(), 0.8f);
- Minecraft.getMinecraft().effectRenderer.addEffect(particle);
- }
-
- @Override
public void em_particle(IGregTechTileEntity aMuffler, byte facing) {//CUTE!
ForgeDirection aDir = ForgeDirection.getOrientation(facing);
float xPos = aDir.offsetX * 0.76F + aMuffler.getXCoord() + 0.25F;
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_Block_HintTT.java b/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_HintTT.java
deleted file mode 100644
index 9648e41d8d..0000000000
--- a/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_HintTT.java
+++ /dev/null
@@ -1,106 +0,0 @@
-package com.github.technus.tectech.thing.casing;
-
-import com.github.technus.tectech.Reference;
-import com.github.technus.tectech.thing.CustomItemList;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gregtech.api.util.GT_LanguageManager;
-import gregtech.common.blocks.GT_Block_Casings_Abstract;
-import gregtech.common.blocks.GT_Material_Casings;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.IIcon;
-import net.minecraft.world.IBlockAccess;
-
-import java.util.List;
-
-import static com.github.technus.tectech.TecTech.creativeTabTecTech;
-
-/**
- * Created by danie_000 on 03.10.2016.
- */
-public class GT_Block_HintTT extends GT_Block_Casings_Abstract {
- private static IIcon[] hint = new IIcon[16];
-
- public GT_Block_HintTT() {
- super(GT_Item_HintTT.class, "gt.blockhintTT", GT_Material_Casings.INSTANCE);
- setCreativeTab(creativeTabTecTech);
-
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Hint 1 dot");//id is -1
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "Hint 2 dots");
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".2.name", "Hint 3 dots");
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".3.name", "Hint 4 dots");
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".4.name", "Hint 5 dots");
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".5.name", "Hint 6 dots");
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".6.name", "Hint 7 dots");
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".7.name", "Hint 8 dots");
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".8.name", "Hint 9 dots");
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".9.name", "Hint 10 dots");
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".10.name", "Hint 11 dots");
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".11.name", "Hint 12 dots");
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".12.name", "Hint general");
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".13.name", "Hint air");
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".14.name", "Hint no air");
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".15.name", "Hint error");
-
-
- CustomItemList.hint_0.set(new ItemStack(this, 1, 0));
- CustomItemList.hint_1.set(new ItemStack(this, 1, 1));
- CustomItemList.hint_2.set(new ItemStack(this, 1, 2));
- CustomItemList.hint_3.set(new ItemStack(this, 1, 3));
- CustomItemList.hint_4.set(new ItemStack(this, 1, 4));
- CustomItemList.hint_5.set(new ItemStack(this, 1, 5));
- CustomItemList.hint_6.set(new ItemStack(this, 1, 6));
- CustomItemList.hint_7.set(new ItemStack(this, 1, 7));
- CustomItemList.hint_8.set(new ItemStack(this, 1, 8));
- CustomItemList.hint_9.set(new ItemStack(this, 1, 9));
- CustomItemList.hint_10.set(new ItemStack(this, 1, 10));
- CustomItemList.hint_11.set(new ItemStack(this, 1, 11));
- CustomItemList.hint_general.set(new ItemStack(this, 1, 12));
- CustomItemList.hint_air.set(new ItemStack(this, 1, 13));
- CustomItemList.hint_noAir.set(new ItemStack(this, 1, 14));
- CustomItemList.hint_error.set(new ItemStack(this, 1, 15));
- }
-
- @Override
- public void registerBlockIcons(IIconRegister aIconRegister) {
- //super.registerBlockIcons(aIconRegister);
- hint[0] = aIconRegister.registerIcon(Reference.MODID+":iconsets/HINT_0");
- hint[1] = aIconRegister.registerIcon(Reference.MODID+":iconsets/HINT_1");
- hint[2] = aIconRegister.registerIcon(Reference.MODID+":iconsets/HINT_2");
- hint[3] = aIconRegister.registerIcon(Reference.MODID+":iconsets/HINT_3");
- hint[4] = aIconRegister.registerIcon(Reference.MODID+":iconsets/HINT_4");
- hint[5] = aIconRegister.registerIcon(Reference.MODID+":iconsets/HINT_5");
- hint[6] = aIconRegister.registerIcon(Reference.MODID+":iconsets/HINT_6");
- hint[7] = aIconRegister.registerIcon(Reference.MODID+":iconsets/HINT_7");
- hint[8] = aIconRegister.registerIcon(Reference.MODID+":iconsets/HINT_8");
- hint[9] = aIconRegister.registerIcon(Reference.MODID+":iconsets/HINT_9");
- hint[10] = aIconRegister.registerIcon(Reference.MODID+":iconsets/HINT_10");
- hint[11] = aIconRegister.registerIcon(Reference.MODID+":iconsets/HINT_11");
- hint[12] = aIconRegister.registerIcon(Reference.MODID+":iconsets/HINT_DEFAULT");
- hint[13] = aIconRegister.registerIcon(Reference.MODID+":iconsets/HINT_AIR");
- hint[14] = aIconRegister.registerIcon(Reference.MODID+":iconsets/HINT_NOAIR");
- hint[15] = aIconRegister.registerIcon(Reference.MODID+":iconsets/HINT_ERROR");
- }
-
- @Override
- public IIcon getIcon(int aSide, int aMeta) {
- return hint[aMeta];
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(IBlockAccess aWorld, int xCoord, int yCoord, int zCoord, int aSide) {
- int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord);
- return getIcon(aSide, tMeta);
- }
-
- @Override
- public void getSubBlocks(Item aItem, CreativeTabs par2CreativeTabs, List aList) {
- for (int i = 0; i <= 15; i++) {
- aList.add(new ItemStack(aItem, 1, i));
- }
- }
-}
diff --git a/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java b/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java
deleted file mode 100644
index 082c0458c0..0000000000
--- a/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package com.github.technus.tectech.thing.item;
-
-import com.github.technus.tectech.mechanics.constructable.ConstructableUtility;
-import com.github.technus.tectech.util.CommonValues;
-import cpw.mods.fml.common.registry.GameRegistry;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.world.World;
-
-import java.util.List;
-
-import static com.github.technus.tectech.Reference.MODID;
-import static com.github.technus.tectech.TecTech.creativeTabTecTech;
-import static net.minecraft.util.StatCollector.translateToLocal;
-
-/**
- * Created by Tec on 15.03.2017.
- */
-@Deprecated
-public final class ConstructableTriggerItem extends Item {
- public static ConstructableTriggerItem INSTANCE;
-
- private ConstructableTriggerItem() {
- setUnlocalizedName("em.constructable");
- setTextureName(MODID + ":itemConstructable");
- setCreativeTab(creativeTabTecTech);
- }
-
- @Override
- public boolean onItemUseFirst(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) {
- return ConstructableUtility.handle(aStack, aPlayer, aWorld, aX, aY, aZ, aSide);
- }
-
- @Override
- public void addInformation(ItemStack aStack, EntityPlayer ep, List aList, boolean boo) {
- aList.add(CommonValues.TEC_MARK_GENERAL);
- aList.add(translateToLocal("item.em.constructable.desc.0"));//Triggers Constructable Interface
- aList.add(EnumChatFormatting.BLUE + translateToLocal("item.em.constructable.desc.1"));//Shows multiblock construction details,
- aList.add(EnumChatFormatting.BLUE + translateToLocal("item.em.constructable.desc.2"));//just Use on a multiblock controller.
- aList.add(EnumChatFormatting.BLUE + translateToLocal("item.em.constructable.desc.3"));//(Sneak Use in creative to build)
- aList.add(EnumChatFormatting.BLUE + translateToLocal("item.em.constructable.desc.4"));//Quantity affects tier/mode/type
- }
-
- public static void run() {
- INSTANCE = new ConstructableTriggerItem();
- GameRegistry.registerItem(INSTANCE, INSTANCE.getUnlocalizedName());
- }
-}
diff --git a/src/main/java/com/github/technus/tectech/thing/item/FrontRotationTriggerItem.java b/src/main/java/com/github/technus/tectech/thing/item/FrontRotationTriggerItem.java
deleted file mode 100644
index 749249d768..0000000000
--- a/src/main/java/com/github/technus/tectech/thing/item/FrontRotationTriggerItem.java
+++ /dev/null
@@ -1,49 +0,0 @@
-package com.github.technus.tectech.thing.item;
-
-import com.github.technus.tectech.mechanics.alignment.AlignmentUtility;
-import com.github.technus.tectech.util.CommonValues;
-import cpw.mods.fml.common.registry.GameRegistry;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.world.World;
-
-import java.util.List;
-
-import static com.github.technus.tectech.Reference.MODID;
-import static com.github.technus.tectech.TecTech.creativeTabTecTech;
-import static net.minecraft.util.StatCollector.translateToLocal;
-
-/**
- * Created by Tec on 15.03.2017.
- */
-@Deprecated
-public final class FrontRotationTriggerItem extends Item {
- public static FrontRotationTriggerItem INSTANCE;
-
- private FrontRotationTriggerItem() {
- setMaxStackSize(1);
- setUnlocalizedName("em.frontRotate");
- setTextureName(MODID + ":itemFrontRotate");
- setCreativeTab(creativeTabTecTech);
- }
-
- @Override
- public boolean onItemUseFirst(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) {
- return AlignmentUtility.handle(aPlayer,aWorld,aX,aY,aZ);
- }
-
- @Override
- public void addInformation(ItemStack aStack, EntityPlayer ep, List aList, boolean boo) {
- aList.add(CommonValues.TEC_MARK_GENERAL);
- aList.add(translateToLocal("item.em.frontRotate.desc.0"));//Triggers Front Rotation Interface
- aList.add(EnumChatFormatting.BLUE + translateToLocal("item.em.frontRotate.desc.1"));//Rotates only the front panel,
- aList.add(EnumChatFormatting.BLUE + translateToLocal("item.em.frontRotate.desc.2"));//which allows structure rotation.
- }
-
- public static void run() {
- INSTANCE = new FrontRotationTriggerItem();
- GameRegistry.registerItem(INSTANCE, INSTANCE.getUnlocalizedName());
- }
-}
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 1978d2acfc..9e43205a85 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
@@ -1,10 +1,7 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
-import com.github.technus.tectech.mechanics.constructable.IConstructable;
-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.mechanics.structure.adders.IHatchAdder;
-import com.github.technus.tectech.mechanics.structure.Structure;
+import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap;
+import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputElemental;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM;
@@ -31,8 +28,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import org.apache.commons.lang3.reflect.FieldUtils;
-import static com.github.technus.tectech.mechanics.elementalMatter.core.transformations.EMTransformationRegistry.EM_COUNT_PER_MATERIAL_AMOUNT;
-import static com.github.technus.tectech.mechanics.structure.Structure.adders;
+import static com.github.technus.tectech.mechanics.elementalMatter.core.transformations.bTransformationInfo.AVOGADRO_CONSTANT;
import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset;
import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage;
import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT;
@@ -58,30 +54,28 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase
//endregion
//region structure
- private static final String[][] shape = new String[][]{
- {"0C0", "A ", "A . ", "A ", "0C0",},
- {"00000", "00000", "00000", "00000", "00000",},
- {"0C0", "A!!!", "A!0!", "A!!!", "0C0",},
- {"01110", "12221", "12221", "12221", "01110",},
- {"01310", "12221", "32223", "12221", "01310",},
- {"01110", "12221", "12221", "12221", "01110",},
- {"0C0", "A!!!", "A!0!", "A!!!", "0C0",},
- {"00000", "00000", "00000", "00000", "00000",},
- {"0C0", "A ", "A ", "A ", "0C0",},
- };
- private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT};
- private static final byte[] blockMeta = new byte[]{4, 5, 8, 6};
- private static final IHatchAdder<GT_MetaTileEntity_EM_decay>[] addingMethods = adders(
- GT_MetaTileEntity_EM_decay::addClassicToMachineList,
- GT_MetaTileEntity_EM_decay::addElementalToMachineList);
- private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4};
- private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT};
- private static final byte[] blockMetaFallback = new byte[]{0, 4};
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 =
+ StructureDefinition.<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
@@ -110,7 +104,7 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase
@Override
public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) {
- return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 2, 0);
+ return structureCheck_EM("main", 2, 2, 0);
}
@Override
@@ -189,21 +183,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,
};
}
@@ -248,11 +251,16 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase
@Override
public void construct(ItemStack stackSize, boolean hintsOnly) {
- Structure.builder(shape, blockType, blockMeta, 2, 2, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly);
+ structureBuild_EM("main", 2, 2, 0, hintsOnly, stackSize);
+ }
+
+ @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 7d5961f219..53ef9641b2 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
@@ -1,14 +1,11 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
-import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.mechanics.constructable.IConstructable;
-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.mechanics.elementalMatter.core.stacks.IEMStack;
-import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.EMDequantizationInfo;
-import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.OreDictionaryStack;
-import com.github.technus.tectech.mechanics.structure.Structure;
-import com.github.technus.tectech.mechanics.structure.adders.IHatchAdder;
+import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap;
+import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack;
+import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.iHasElementalDefinition;
+import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.aFluidDequantizationInfo;
+import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.aItemDequantizationInfo;
+import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.aOredictDequantizationInfo;
import com.github.technus.tectech.thing.block.QuantumGlassBlock;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputElemental;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM;
@@ -26,10 +23,9 @@ import net.minecraftforge.oredict.OreDictionary;
import java.util.ArrayList;
-import static com.github.technus.tectech.mechanics.elementalMatter.core.definitions.IEMDefinition.STABLE_RAW_LIFE_TIME;
-import static com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.EMAtomDefinition.refMass;
-import static com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.EMAtomDefinition.refUnstableMass;
-import static com.github.technus.tectech.mechanics.structure.Structure.adders;
+import static com.github.technus.tectech.mechanics.elementalMatter.core.templates.iElementalDefinition.STABLE_RAW_LIFE_TIME;
+import static com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.dAtomDefinition.refMass;
+import static com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.dAtomDefinition.refUnstableMass;
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;
@@ -41,21 +37,22 @@ 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 String[][] shape = new String[][]{
- {" ", " . ", " ",},
- {"010", "111", "010",},
- {"\"\"\"", "\"1\"", "\"\"\"",},
- {"121", "2!2", "121",},
- };
- private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, QuantumGlassBlock.INSTANCE};
- private static final byte[] blockMeta = new byte[]{0, 4, 0};
- private static final IHatchAdder<GT_MetaTileEntity_EM_dequantizer>[] addingMethods = adders(
- GT_MetaTileEntity_EM_dequantizer::addClassicToMachineList,
- GT_MetaTileEntity_EM_dequantizer::addElementalInputToMachineList,
- GT_MetaTileEntity_EM_dequantizer::addElementalMufflerToMachineList);
- private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4, textureOffset + 4};
- private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT};
- private static final byte[] blockMetaFallback = new byte[]{0, 4, 4};
+
+ private static final IStructureDefinition<GT_MetaTileEntity_EM_dequantizer> STRUCTURE_DEFINITION =
+ StructureDefinition.<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('C', ofHatchAdderOptional(GT_MetaTileEntity_EM_dequantizer::addClassicToMachineList, textureOffset, 1, sBlockCasingsTT, 0))
+ .addElement('D', ofBlock(QuantumGlassBlock.INSTANCE, 0))
+ .addElement('E', ofHatchAdderOptional(GT_MetaTileEntity_EM_dequantizer::addElementalMufflerToMachineList, textureOffset + 4, 3, sBlockCasingsTT, 4))
+ .addElement('F', ofHatchAdder(GT_MetaTileEntity_EM_dequantizer::addElementalInputToMachineList, textureOffset + 4, sHintCasingsTT, 1))
+ .build();
+
private static final String[] description = new String[]{
EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":",
translateToLocal("gt.blockmachines.multimachine.em.emtomatter.hint.0"),//1 - Classic Hatches or High Power Casing"
@@ -92,7 +89,7 @@ public class GT_MetaTileEntity_EM_dequantizer extends GT_MetaTileEntity_Multiblo
@Override
public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) {
- return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 1, 0);
+ return structureCheck_EM("main", 1, 1, 0);
}
@Override
@@ -138,11 +135,16 @@ public class GT_MetaTileEntity_EM_dequantizer extends GT_MetaTileEntity_Multiblo
@Override
public void construct(ItemStack stackSize, boolean hintsOnly) {
- Structure.builder(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly);
+ structureBuild_EM("main", 1, 1, 0, hintsOnly, stackSize);
+ }
+
+ @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_quantizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java
index be036050be..1d75cb420c 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
@@ -2,15 +2,13 @@ package com.github.technus.tectech.thing.metaTileEntity.multi;
import com.github.technus.tectech.Reference;
import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.mechanics.constructable.IConstructable;
-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.mechanics.elementalMatter.core.stacks.IEMStack;
-import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.EMFluidQuantizationInfo;
-import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.EMItemQuantizationInfo;
-import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.EMOredictQuantizationInfo;
-import com.github.technus.tectech.mechanics.structure.Structure;
-import com.github.technus.tectech.mechanics.structure.adders.IHatchAdder;
+import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap;
+import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack;
+import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.iHasElementalDefinition;
+import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.aFluidQuantizationInfo;
+import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.aItemQuantizationInfo;
+import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.aOredictQuantizationInfo;
+import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.bTransformationInfo;
import com.github.technus.tectech.thing.block.QuantumGlassBlock;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM;
import com.github.technus.tectech.util.CommonValues;
@@ -29,11 +27,10 @@ import net.minecraftforge.oredict.OreDictionary;
import java.util.ArrayList;
import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE;
-import static com.github.technus.tectech.mechanics.elementalMatter.core.definitions.IEMDefinition.DEFAULT_ENERGY_LEVEL;
-import static com.github.technus.tectech.mechanics.elementalMatter.core.definitions.IEMDefinition.STABLE_RAW_LIFE_TIME;
-import static com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.EMAtomDefinition.refMass;
-import static com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.EMAtomDefinition.refUnstableMass;
-import static com.github.technus.tectech.mechanics.structure.Structure.adders;
+import static com.github.technus.tectech.mechanics.elementalMatter.core.templates.iElementalDefinition.DEFAULT_ENERGY_LEVEL;
+import static com.github.technus.tectech.mechanics.elementalMatter.core.templates.iElementalDefinition.STABLE_RAW_LIFE_TIME;
+import static com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.dAtomDefinition.refMass;
+import static com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.dAtomDefinition.refUnstableMass;
import static com.github.technus.tectech.recipe.TT_recipeAdder.nullFluid;
import static com.github.technus.tectech.recipe.TT_recipeAdder.nullItem;
import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset;
@@ -48,21 +45,21 @@ 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 String[][] shape = new String[][]{
- {" ", " . ", " ",},
- {"010", "101", "010",},
- {"\"\"\"", "\"0\"", "\"\"\"",},
- {"202", "0!0", "202",},
- };
- private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, QuantumGlassBlock.INSTANCE};
- private static final byte[] blockMeta = new byte[]{4, 0, 0};
- private static final IHatchAdder<GT_MetaTileEntity_EM_quantizer>[] addingMethods = adders(
- GT_MetaTileEntity_EM_quantizer::addClassicToMachineList,
- GT_MetaTileEntity_EM_quantizer::addElementalOutputToMachineList,
- GT_MetaTileEntity_EM_quantizer::addElementalMufflerToMachineList);
- private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4, textureOffset + 4};
- private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT};
- private static final byte[] blockMetaFallback = new byte[]{0, 4, 4};
+ private static final IStructureDefinition<GT_MetaTileEntity_EM_quantizer> STRUCTURE_DEFINITION =
+ StructureDefinition.<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[]{
EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":",
translateToLocal("gt.blockmachines.multimachine.em.mattertoem.hint.0"),//1 - Classic Hatches or High Power Casing
@@ -86,7 +83,7 @@ public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_Multiblock
@Override
public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) {
- return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 1, 0);
+ return structureCheck_EM("main", 1, 1, 0);
}
@Override
@@ -198,11 +195,16 @@ public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_Multiblock
@Override
public void construct(ItemStack stackSize, boolean hintsOnly) {
- Structure.builder(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly);
+ structureBuild_EM("main", 1, 1, 0, hintsOnly, stackSize);
+ }
+
+ @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_scanner.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java
index 89255b331a..d63ccf2df1 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
@@ -1,13 +1,10 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.mechanics.constructable.IConstructable;
-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.core.EMException;
-import com.github.technus.tectech.mechanics.structure.adders.IHatchAdder;
-import com.github.technus.tectech.mechanics.structure.Structure;
+import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap;
+import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalDefinitionStack;
+import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack;
+import com.github.technus.tectech.mechanics.elementalMatter.core.tElementalException;
import com.github.technus.tectech.recipe.TT_recipe;
import com.github.technus.tectech.thing.CustomItemList;
import com.github.technus.tectech.thing.block.QuantumGlassBlock;
@@ -35,8 +32,7 @@ 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.mechanics.structure.Structure.adders;
+import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.cPrimitiveDefinition.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;
@@ -61,7 +57,7 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa
private TT_recipe.TT_EMRecipe.TT_EMRecipe eRecipe;
private EMDefinitionStack objectResearched;
private EMInstanceStackMap objectsScanned;
- private String machineType;
+ private String machineType;
private long computationRemaining, computationRequired;
private int[] scanComplexity;
@@ -69,26 +65,6 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa
//endregion
//region structure
- private static final String[][] shape = new String[][]{
- {" ", " 222 ", " 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#", "#####",},
- };
- private static final Block[] blockType = new Block[]{sBlockCasingsTT, QuantumGlassBlock.INSTANCE, sBlockCasingsTT};
- private static final byte[] blockMeta = new byte[]{4, 0, 0};
- private static final IHatchAdder<GT_MetaTileEntity_EM_scanner>[] addingMethods = adders(
- GT_MetaTileEntity_EM_scanner::addClassicToMachineList,
- GT_MetaTileEntity_EM_scanner::addElementalInputToMachineList,
- GT_MetaTileEntity_EM_scanner::addElementalOutputToMachineList,
- GT_MetaTileEntity_EM_scanner::addElementalMufflerToMachineList);
- private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4, textureOffset + 4, textureOffset + 4};
- private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT};
- private static final byte[] blockMetaFallback = new byte[]{0, 4, 4, 4};
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
@@ -96,6 +72,24 @@ 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 =
+ StructureDefinition.<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
@@ -108,9 +102,12 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa
return LedStatus.STATUS_WRONG;
}
v = (int) v;
- if (v == 0) return LedStatus.STATUS_NEUTRAL;
- if (v >= SCAN_GET_CLASS_TYPE) return LedStatus.STATUS_TOO_HIGH;
- if (v < 0) return LedStatus.STATUS_TOO_LOW;
+ if (v == 0)
+ return LedStatus.STATUS_NEUTRAL;
+ if (v >= SCAN_GET_CLASS_TYPE)
+ return LedStatus.STATUS_TOO_HIGH;
+ if (v < 0)
+ return LedStatus.STATUS_TOO_LOW;
return LedStatus.STATUS_OK;
};
protected Parameters.Group.ParameterIn[] scanConfiguration;
@@ -209,7 +206,7 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa
@Override
public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) {
- if (!structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 2, 0)) {
+ if (!structureCheck_EM("main", 2, 2, 0)) {
return false;
}
return eInputHatches.size() == 1 && eOutputHatches.size() == 1 && eOutputHatches.get(0).getBaseMetaTileEntity().getFrontFacing() == iGregTechTileEntity.getFrontFacing();
@@ -347,21 +344,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)
};
}
@@ -410,7 +417,7 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa
computationRequired = aNBT.getLong("eComputationRequired");
if (aNBT.hasKey("eObject")) {
objectResearched = EMDefinitionStack.fromNBT(TecTech.definitionsRegistry,aNBT.getCompoundTag("eObject"));
- if (objectResearched.getDefinition() == nbtE__) {
+ if (objectResearched.getDefinition() == EMPrimitiveDefinition.nbtE__) {
objectResearched = null;
}
} else {
@@ -516,11 +523,16 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa
@Override
public void construct(ItemStack stackSize, boolean hintsOnly) {
- Structure.builder(shape, blockType, blockMeta, 2, 2, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly);
+ structureBuild_EM("main", 2, 2, 0, hintsOnly, stackSize);
+ }
+
+ @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_TM_proccessingStack.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_proccessingStack.java
index 3a1a5a5418..427f448e2a 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
@@ -1,7 +1,7 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
-import com.github.technus.tectech.mechanics.constructable.IConstructable;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM;
+import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import net.minecraft.item.ItemStack;
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 cbc20143b3..0778feb1fd 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
@@ -46,7 +46,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;
@@ -102,6 +103,7 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock
private static final String[] description = new String[]{
EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":",
translateToLocal("gt.blockmachines.multimachine.tm.teslaCoil.hint.0"),//1 - Classic Hatches, Capacitor Hatches or Tesla Base Casing
+ translateToLocal("gt.blockmachines.multimachine.tm.teslaCoil.hint.1"),//2 - Titanium Frames
};
private static final IStructureDefinition<GT_MetaTileEntity_TM_teslaCoil> STRUCTURE_DEFINITION =
@@ -130,7 +132,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 2fe43cb8e1..b02d9cd0a5 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
@@ -2,25 +2,23 @@ package com.github.technus.tectech.thing.metaTileEntity.multi.base;
import com.github.technus.tectech.Reference;
import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.loader.NetworkDispatcher;
-import com.github.technus.tectech.mechanics.alignment.AlignmentLimits;
-import com.github.technus.tectech.mechanics.alignment.AlignmentMessage;
-import com.github.technus.tectech.mechanics.alignment.IAlignment;
-import com.github.technus.tectech.mechanics.alignment.IAlignmentLimits;
-import com.github.technus.tectech.mechanics.alignment.enumerable.ExtendedFacing;
-import com.github.technus.tectech.mechanics.alignment.enumerable.Flip;
-import com.github.technus.tectech.mechanics.alignment.enumerable.Rotation;
+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.core.EMException;
-import com.github.technus.tectech.mechanics.structure.IStructureDefinition;
-import com.github.technus.tectech.mechanics.structure.Structure;
-import com.github.technus.tectech.mechanics.structure.adders.IHatchAdder;
import com.github.technus.tectech.thing.metaTileEntity.hatch.*;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture;
import com.github.technus.tectech.util.Util;
-import com.github.technus.tectech.util.Vec3Impl;
+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;
@@ -33,7 +31,6 @@ import gregtech.api.metatileentity.implementations.*;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import gregtech.common.GT_Pollution;
-import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.InventoryPlayer;
@@ -144,7 +141,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
private boolean explodedThisTick = false;
//front rotation val
- private IAlignmentLimits alignmentLimits = AlignmentLimits.UNLIMITED;
+ private IAlignmentLimits alignmentLimits = IAlignmentLimits.UNLIMITED;
private ExtendedFacing extendedFacing = ExtendedFacing.DEFAULT;
//endregion
@@ -175,9 +172,12 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
IGregTechTileEntity base = getBaseMetaTileEntity();
mMachine = false;
if (getBaseMetaTileEntity().isServerSide()) {
- NetworkDispatcher.INSTANCE.sendToAllAround(new AlignmentMessage.AlignmentData(this),
- base.getWorld().provider.dimensionId,
- base.getXCoord(), base.getYCoord(), base.getZCoord(), 512);
+ //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();
}
@@ -230,22 +230,6 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
getExtendedFacing(), baseMetaTileEntity.getXCoord(), baseMetaTileEntity.getYCoord(),
baseMetaTileEntity.getZCoord(), horizontalOffset, verticalOffset, depthOffset, hintsOnly);
}
-
- @Deprecated
- @SuppressWarnings("unchecked")
- public final <T extends GT_MetaTileEntity_MultiblockBase_EM> boolean structureCheck_EM(
- String[][] structure,//0-9 casing, +- air no air, a-z ignore
- Block[] blockType,//use numbers 0-9 for casing types
- byte[] blockMeta,//use numbers 0-9 for casing types
- IHatchAdder<T>[] addingMethods,
- short[] casingTextures,
- Block[] blockTypeFallback,//use numbers 0-9 for casing types
- byte[] blockMetaFallback,//use numbers 0-9 for casing types
- int horizontalOffset, int verticalOffset, int depthOffset) {
- return Structure.checker(structure, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback,
- horizontalOffset, verticalOffset, depthOffset, (T)this, getExtendedFacing(), !mMachine);
- }
-
//endregion
//region METHODS TO OVERRIDE - general functionality, recipe check, output
@@ -387,21 +371,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
};
}
@@ -648,7 +634,9 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
*/
protected long getAvailableData_EM() {
long result = 0;
- Vec3Impl pos = new Vec3Impl(getBaseMetaTileEntity());
+ Vec3Impl pos = new Vec3Impl(getBaseMetaTileEntity().getXCoord(),
+ getBaseMetaTileEntity().getYCoord(),
+ getBaseMetaTileEntity().getZCoord());
for (GT_MetaTileEntity_Hatch_InputData in : eInputData) {
if (in.q != null) {
Long value = in.q.contentIfNotInTrace(pos);
@@ -1095,7 +1083,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
public final void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) {
isFacingValid(aBaseMetaTileEntity.getFrontFacing());
if (getBaseMetaTileEntity().isClientSide()) {
- NetworkDispatcher.INSTANCE.sendToServer(new AlignmentMessage.AlignmentQuery(this));
+ StructureLibAPI.queryAlignment((IAlignmentProvider) aBaseMetaTileEntity);
}
onFirstTick_EM(aBaseMetaTileEntity);
}
@@ -1675,7 +1663,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;
}
}
@@ -1688,7 +1676,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 cf8f26ff02..0550b5c8ee 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
@@ -1,19 +1,16 @@
package com.github.technus.tectech.thing.metaTileEntity.multi.em_collider;
import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.EMComplexAspectDefinition;
-import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.EMPrimalAspectDefinition;
-import com.github.technus.tectech.mechanics.constructable.IConstructable;
-import com.github.technus.tectech.mechanics.elementalMatter.core.decay.EMDecayResult;
-import com.github.technus.tectech.mechanics.elementalMatter.core.maps.EMInstanceStackMap;
-import com.github.technus.tectech.mechanics.elementalMatter.core.maps.EMDefinitionStackMap;
-import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.EMInstanceStack;
-import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.EMPrimitiveTemplate;
-import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.EMAtomDefinition;
-import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.EMHadronDefinition;
-import com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.EMQuarkDefinition;
-import com.github.technus.tectech.mechanics.structure.IStructureDefinition;
-import com.github.technus.tectech.mechanics.structure.StructureDefinition;
+import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.dComplexAspectDefinition;
+import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.ePrimalAspectDefinition;
+import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalDecayResult;
+import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap;
+import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalMutableDefinitionStackMap;
+import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack;
+import com.github.technus.tectech.mechanics.elementalMatter.core.templates.cElementalPrimitive;
+import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.dAtomDefinition;
+import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.dHadronDefinition;
+import com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.eQuarkDefinition;
import com.github.technus.tectech.thing.block.QuantumGlassBlock;
import com.github.technus.tectech.thing.casing.TT_Container_Casings;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputElemental;
@@ -23,6 +20,9 @@ import com.github.technus.tectech.thing.metaTileEntity.multi.base.IStatusFunctio
import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture;
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,8 +38,7 @@ import net.minecraftforge.common.util.ForgeDirection;
import java.util.HashMap;
import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE;
-import static com.github.technus.tectech.mechanics.elementalMatter.core.transformations.EMTransformationRegistry.EM_COUNT_PER_MATERIAL_AMOUNT;
-import static com.github.technus.tectech.mechanics.structure.StructureUtility.*;
+import static com.github.technus.tectech.mechanics.elementalMatter.core.transformations.bTransformationInfo.AVOGADRO_CONSTANT;
import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset;
import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage;
import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT;
@@ -294,49 +293,6 @@ 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 = StructureDefinition
- .<GT_MetaTileEntity_EM_collider>builder()
- .addShapeOldApi("main", new String[][]{
- {"I0A0A0", "I00000", "I0A0A0",},
- {"H0000000", "G001111100", "H0000000",},
- {"F22223332222", "F41155555114", "F22223332222",},
- {"E2000000000002", "E4155111115514", "E2000000000002",},
- {"D20000E00002", "D41511E11514", "D20000E00002",},
- {"C2000I0002", "C4151I1514", "C2000I0002",},
- {"B2000K0002", "B4151K1514", "B2000K0002",},
- {"B200M002", "A0151M1510", "B200M002",},
- {"A0200M0020", "A0151M1510", "A0200M0020",},
- {"0020O0200", "0151O1510", "0020O0200",},
- {"A030O030", "0151O1510", "A030O030",},
- {"0030O0300", "0151O1510", "0030O0300",},
- {"A030O030", "0151O1510", "A030O030",},
- {"0020O0200", "0151O1510", "0020O0200",},
- {"A0200M0020", "A0151M1510", "A0200M0020",},
- {"B200M002", "A0151M1510", "B200M002",},
- {"B2000K0002", "B4151K1514", "B2000K0002",},
- {"C2000I0002", "C4151I1514", "C2000I0002",},
- {"D200002&&&200002", "D415112&.&211514", "D200002&&&200002",},
- {"E20!!22222!!02", "E4155111115514", "E20!!22222!!02",},
- {"F2222#$#2222", "F41155555114", "F2222#$#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[]{
EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":",
translateToLocal("gt.blockmachines.multimachine.em.collider.hint.0"),//1 - Classic Hatches or High Power Casing
@@ -346,8 +302,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 =
+ StructureDefinition.<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;
}
@@ -693,7 +668,7 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB
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 +681,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 e653c1a357..9898e82d4c 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
@@ -2,14 +2,14 @@ package com.github.technus.tectech.thing.metaTileEntity.multi.em_machine;
import com.github.technus.tectech.TecTech;
import com.github.technus.tectech.mechanics.constructable.IConstructable;
-import com.github.technus.tectech.mechanics.elementalMatter.core.maps.EMInstanceStackMap;
-import com.github.technus.tectech.mechanics.structure.adders.IHatchAdder;
-import com.github.technus.tectech.mechanics.structure.Structure;
+import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap;
import com.github.technus.tectech.thing.block.QuantumGlassBlock;
import com.github.technus.tectech.thing.block.QuantumStuffBlock;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.*;
import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.util.Util;
+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.block.Block;
@@ -41,26 +41,28 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa
//endregion
//region structure
- private static final String[][] shape = new String[][]{
- {"B0", "A ", "0 - 0", "A ", "B0",},
- {"A000", "00000", "00.00", "00000", "A000",},
- {"A121", "1---1", "2---2", "1---1", "A121",},
- {"A131", "1---1", "3-A-3", "1---1", "A131",},
- {"A121", "1---1", "2---2", "1---1", "A121",},
- {"A000", "00000", "00-00", "00000", "A000",},
- {"B0", "A!!!", "0!!!0", "A!!!", "B0",},};
- private static final Block[] blockType = new Block[]{sBlockCasingsTT, QuantumGlassBlock.INSTANCE, sBlockCasingsTT, sBlockCasingsTT};
- private static final byte[] blockMeta = new byte[]{4, 0, 5, 6};
- private static final IHatchAdder<GT_MetaTileEntity_EM_machine>[] addingMethods = adders(
- GT_MetaTileEntity_EM_machine::addClassicToMachineList,
- GT_MetaTileEntity_EM_machine::addElementalToMachineList);
- private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4};
- private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT};
- private static final byte[] blockMetaFallback = new byte[]{0, 4};
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 =
+ StructureDefinition.<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
@@ -190,7 +192,7 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa
@Override
public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) {
- return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 2, 1);
+ return structureCheck_EM("main", 2, 2, 1);
}
@Override
@@ -354,11 +356,16 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa
@Override
public void construct(ItemStack stackSize, boolean hintsOnly) {
- Structure.builder(shape, blockType, blockMeta, 2, 2, 1, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly);
+ structureBuild_EM("main", 2, 2, 1, hintsOnly, stackSize);
+ }
+
+ @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/java/com/github/technus/tectech/util/Vec3Impl.java b/src/main/java/com/github/technus/tectech/util/Vec3Impl.java
deleted file mode 100644
index 56a9176767..0000000000
--- a/src/main/java/com/github/technus/tectech/util/Vec3Impl.java
+++ /dev/null
@@ -1,147 +0,0 @@
-package com.github.technus.tectech.util;
-
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import net.minecraft.dispenser.IPosition;
-import net.minecraftforge.common.util.ForgeDirection;
-
-@Deprecated
-public class Vec3Impl implements Comparable<Vec3Impl> {
- public static final Vec3Impl NULL_VECTOR = new Vec3Impl(0, 0, 0);
- private final int val0;
- private final int val1;
- private final int val2;
-
- public Vec3Impl(int in0, int in1, int in2) {
- this.val0 = in0;
- this.val1 = in1;
- this.val2 = in2;
- }
-
- public Vec3Impl(IGregTechTileEntity baseMetaTileEntity) {
- this(baseMetaTileEntity.getXCoord(),baseMetaTileEntity.getYCoord(),baseMetaTileEntity.getZCoord());
- }
-
- public int compareTo(Vec3Impl o) {
- return val1 == o.val1 ? val2 == o.val2 ? val0 - o.val0 : val2 - o.val2 : val1 - o.val1;
- }
-
- /**
- * Gets the coordinate.
- */
- public int get(int index) {
- switch (index){
- case 0: return val0;
- case 1: return val1;
- case 2: return val2;
- default: return 0;
- }
- }
-
- /**
- * Gets the X coordinate.
- */
- public int get0() {
- return this.val0;
- }
-
- /**
- * Gets the Y coordinate.
- */
- public int get1() {
- return this.val1;
- }
-
- /**
- * Gets the Z coordinate.
- */
- public int get2() {
- return this.val2;
- }
-
- public Vec3Impl offset(ForgeDirection facing, int n) {
- return n == 0 ? this : new Vec3Impl(val0 + facing.offsetX * n, val1 + facing.offsetY * n, val2 + facing.offsetZ * n);
- }
-
- public Vec3Impl add(IGregTechTileEntity tileEntity) {
- return new Vec3Impl(val0 + tileEntity.getXCoord(), val1 + tileEntity.getYCoord(), val2 + tileEntity.getZCoord());
- }
-
- public Vec3Impl sub(IGregTechTileEntity tileEntity) {
- return new Vec3Impl(val0 - tileEntity.getXCoord(), val1 - tileEntity.getYCoord(), val2 - tileEntity.getZCoord());
- }
-
- public Vec3Impl add(Vec3Impl pos) {
- return new Vec3Impl(val0 + pos.val0, val1 + pos.val1, val2 + pos.val2);
- }
-
- public Vec3Impl sub(Vec3Impl pos) {
- return new Vec3Impl(val0 - pos.val0, val1 - pos.val1, val2 - pos.val2);
- }
-
- public Vec3Impl add(int pos0,int pos1,int pos2) {
- return new Vec3Impl(val0 + pos0, val1 + pos1, val2 + pos2);
- }
-
- public Vec3Impl sub(int pos0,int pos1,int pos2) {
- return new Vec3Impl(val0 - pos0, val1 - pos1, val2 - pos2);
- }
-
- public Vec3Impl crossProduct(Vec3Impl vec) {
- return new Vec3Impl(val1 * vec.val2 - val2 * vec.val1, val2 * vec.val0 - val0 * vec.val2,
- val0 * vec.val1 - val1 * vec.val0);
- }
-
- public boolean withinDistance(Vec3Impl to, double distance) {
- return this.distanceSq(to.val0, to.val1, to.val2, false) < distance * distance;
- }
-
- public boolean withinDistance(IPosition to, double distance) {
- return this.distanceSq(to.getX(), to.getY(), to.getZ(), true) < distance * distance;
- }
-
- public double distanceSq(Vec3Impl to) {
- return this.distanceSq(to.val0, to.val1, to.val2, true);
- }
-
- public double distanceSq(IPosition to, boolean useCenter) {
- return this.distanceSq(to.getX(), to.getY(), to.getZ(), useCenter);
- }
-
- public double distanceSq(double x, double y, double z, boolean useCenter) {
- double d0 = useCenter ? 0.5D : 0.0D;
- double d1 = (double)val0 + d0 - x;
- double d2 = (double)val1 + d0 - y;
- double d3 = (double)val2 + d0 - z;
- return d1 * d1 + d2 * d2 + d3 * d3;
- }
-
- public int manhattanDistance(Vec3Impl to) {
- float f = (float)Math.abs(to.val0 - val0);
- float f1 = (float)Math.abs(to.val1 - val1);
- float f2 = (float)Math.abs(to.val2 - val2);
- return (int)(f + f1 + f2);
- }
-
- @Override
- public String toString() {
- return "Vec3[" + val0 + ", " + val1 + ", " + val2 + "]";
- }
-
- public Vec3Impl abs() {
- return new Vec3Impl(Math.abs(val0),Math.abs(val1),Math.abs(val2));
- }
-
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- } else if (o instanceof Vec3Impl) {
- Vec3Impl vec3i = (Vec3Impl)o;
- return val0 == vec3i.val0 && val1 == vec3i.val1 && val2 == vec3i.val2;
- }
- return false;
- }
-
- public int hashCode() {
- return (val1 + val2 * 31) * 31 + val0;
- }
-} \ 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_"],